In the Fig., OA is the position of rest of the simple pendulum of length l.
Let ∠AOB = θ
From B, draw BC ⊥ OA. In going from A to B,
the bob rises through a height AC, where
AC = OA - OC
= OA - OB cosθ = l - l cosθ
h = l (1 - cosθ)
P.E. acquired at B,
= mgh = mgl (1 - cosθ),
which would be the maximum K.E. on reaching A.