The circle C has radius 1 and touches the line L at P. The point X lies on C and Y is the foot of the perpendicular from X to L. Find the maximum value of the area of triangle PXY as X varies.
Let the circle be $x^2+(y-1)^2=1$ and the point P be $(0,0)$
Let X be $(\cos\theta,1+\sin\theta)\implies$ area of triangle PXY=$\frac12\cos\theta(1+\sin\theta)$
The answer is $\frac{3\sqrt3}8$, that seems to come at $\theta=30^\circ$ but why?
Also, is there a general way to solve this question without letting a particular circle.

Let $\angle XPY=\theta$. Because of symmetry, WLOG $\theta<\dfrac\pi2$. By the law of sines, $PX=R\cdot\sin\theta=2\sin\theta$. So $PY=2\cos\theta\sin\theta$ and $XY=2\sin^2\theta$. By AM-GM inequality, \begin{align*} &[PXY]=\frac{PY\cdot XY}2=2\sin^3\theta\cdot\cos\theta\\[1em] ={}&6\sqrt3\sqrt{\frac13\sin^2\theta\cdot\frac13\sin^2\theta\cdot\frac13\sin^2\theta\cdot\cos^2\theta}\\[1em] \le{}&6\sqrt3\sqrt{\left(\tfrac{\textstyle\frac13\sin^2\theta+\frac13\sin^2\theta+\frac13\sin^2\theta+\cos^2\theta}{\textstyle4}\right)^4}=\frac{3\sqrt3}8. \end{align*}