William W. answered 11/23/19
Experienced Tutor and Retired Engineer
This is a little nebulous because it doesn't say what they want the energy to be calculated in terms of but we'll take a stab at it.
Assume the pendulum swings to angle θ, has a mass m, and a length l:
Using the triangle on the left, we can say sin(θ/2) = x/l or x = lsin(θ/2)
Using the bottom triangle, we know know the hypotenuse which is 2x or 2lsin(θ/2).
So we can say sin(θ/2) = h/(2lsin(θ/2)) so h = 2lsin2(θ/2)
That means the potential energy (gravitational potential energy) is mgh = 2mglsin2(θ/2) and since there is no velocity at the top of the swing, that is the total energy.
You could also do it this way:
We could say cos(θ) = z/l or z = lcos(θ)
Then h = l - lcos(θ) or l(1 - cos(θ)). Then the potential energy (and total mechanical energy = mgl(1 - cos(θ))
Either of these turns out to be the same and is acceptable.