The maths is pretty simple, actually. Energy = power x time (or integral P(t)dt if your power isn’t constant) and energy is also force x distance (same story with the calculus). Provided you also know how fast the bike is going, you can use either one of these formulas. With the force x distance calculation, you have to take into account the length of the slope, which is basically the hypotenuse.
If your climb has flat sections, you will have to calculate the energy for each section separately and sum them.

]]>