Here: length of pendulum =l
maximum angular displacement =θ
mass of the bob =m
Now height of the bob at maximum angular displacement is h=l−lcosθ=(1−cosθ)
Also at the end of the displacement kinetic energy of the bob = potential energy of the bob =mgh=mgl(1−cosθ)