Essential University Physics: Volume 1 (4th Edition)

$U =\frac{1}{2}mgL\theta^2$
We use integration to find: $U = \int Fdx \\ U = \int_0^{\theta} mgsin\theta L d\theta$ $U = \int_0^{\theta} mg L \theta d\theta \\ U =\frac{1}{2}mgL\theta^2$