How find the maximum possible length of OC, where ABCD is a square, and AD is the chord of the circle? Given a circle $o(O(0,0), r=1)$. How to find the maximum possible length of $OC$, where $ABCD$ is a square, and $AD$ is the chord of the circle?
I have no idea how to do this, can this be proved with simple geometry?


With the diagram as labeled, we see that
$$\begin{align}
|\overline{OC}|^2 &= \cos^2\theta + ( \sin\theta+2\cos\theta )^2 \\
&= \cos^2\theta + \sin^2\theta + 4 \cos\theta\sin\theta + 4 \cos^2\theta \\
&= 3+2 \sin 2\theta + 2 \cos 2\theta  \\
&= 3+2\sqrt{2}\left( \sin 2\theta \cos45^\circ + \cos 2\theta \sin45^\circ \right) \\
&= 3+2\sqrt{2}\sin(2\theta+45^\circ)
\end{align}$$
This value is clearly maximized when $\sin(2\theta+45^\circ) = 1$ (which happens for $\theta = 22.5^\circ$), so that
$$|\overline{OC}|^2 = 3 + 2\sqrt{2} = ( 1 + \sqrt{2} )^2 \quad\to\quad |\overline{OC}| = 1 + \sqrt{2}$$
