In reply to gethin_allen:
I'm not sure that's 100% correct.
If we ignore the fact that the bike and it's rider have different efficiencies at different power outputs it's actual quite simple.
Let's imagine a hill with one steep side and one shallow side. Both sides gain the same amount of height. The energy required to get to the top of the hill by either route is exactly the same, it is the mass of the cyclist and bike times by the height gained times by a constant.
In terms of power (which is how much energy you're putting out per second) it all depends on how fast each route is done. If I ride up the shallow side in a high gear I'll be travelling faster but gaining less height with every meter of road. If I ride up the steep side in a smaller gear I'll be travelling slower but gaining more height with each meter of road and thus the power is the same.
For a power output of x both routes take the same amount of time and feel just as difficult.
In reality it's much more complicated than that but that's what I reckon the physics says.