Key property: Work by gravity is PATH-INDEPENDENT. It depends only on the vertical displacement (change in height).
= -mg * = mg( - )
Where = - .
Going down by h: = +mgh (gravity does positive work) Going up by h: = -mgh (gravity does negative work)
For any curved path: Only the vertical component of displacement matters. Along a curved incline of length L at angle theta: h = Lsin(theta) = mgLsin(theta)
This path independence is precisely what makes gravity a conservative force. Friction work DOES depend on path length, making friction non-conservative.