# Greatest distance one point can have from a vertice of a square given following conditions

A point $P$ lies in the same plane as a given square of side $1$.Let the vertices of the square,taken counterclockwise,be $A,B,C,$ and $D$.Also,let the distances from $P$ to $A,B,$ and $C$, respectively, be $u,v$ and $w$.

What is the greatest distance that $P$ can be from $D$ if $u^2+v^2=w^2$ ?

$1)$ Given a pair of vertices I could construct an ellipse with $P$ as a point on the ellipse.

$2)$ From the equality $u^2+v^2=w^2$ I think that I have to consider the case where the angle between $u$ and $v$ is $90^\circ$. In this case I would have $w=1$ and $PD \lt 2$

That being said,I still fail to come at a concrete solution of the problem,it might be that none of my thoughts are right... I don't know.

If that helps,this problem comes from the chapter of my book regarding conics .

We may suppose that $$A(1,0),B(1,1),C(0,1),D(0,0),P(x,y).$$
Then, we have $$u^2=(x-1)^2+y^2$$ $$v^2=(x-1)^2+(y-1)^2$$ $$w^2=x^2+(y-1)^2$$ So, we have $$u^2+v^2=w^2\iff 2(x-1)^2+y^2+(y-1)^2=x^2+(y-1)^2$$$$\iff x^2-4x+2+y^2=0\iff (x-2)^2+y^2=2$$
Hence, we want to find the greatest distance from the origin to a point on a circle $(x-2)^2+y^2=2$.
Thus, the answer is $\color{red}{2+\sqrt 2}$ when $P(2+\sqrt 2,0)$.