Minimum square sum of inscripted triangle Problem: In a right triangle $ABC$, the hypotenuse is long $4$ and the angle in $B$ is $30°$. Calling $N$ the midpoint on the side $AB$ (the hypotenuse), and $M$ the middle point on the side $CB$, consider a random point on the side $AC$, lets call it $P$ and $AP = x$. Find the value of $x$ such that is minimum the sum of the squares of the sides of triangle $PNM$.
My Solution so far:

I have to minimise $NM^2+NP^2 + PM^2$ and

*

*$NM$ is fixed and equal to $1$, so I should only care about $NP$ and $MP$

*$ABC$ is a right triangle with two angles of one angle of $30°$ then the other angle will be $60°$ and therefore the side $AC$ is half the hypotenuse, therefore $AC=2$, and from this follow that $CB = 2 \sqrt{3}$

*$PM$ is the hypothenuse of the right triangle $CPM$ and therefore its equation is $PM^2 = CM^2 + PC^2 = (\sqrt{3})^2 + (2-x)^2 = x^2 -4x + 7$
But now I'm stuck since I don't know how to correctly parametrise $PN$ as a function of $AP$.
Once found a way to write $PN$ as a function of $AP$ I'm done, since I can write them inside my, equation, take the derivative and find the minimum of the function of $AP$
Final Solution:
Thanks to @mathlove, the triangle $APN$, can be solved by using the Law of Cosines, in our case used on the side $PN$ and with angle $\beta$ it results in:
\begin{equation}\begin{aligned}
 PN^2 &= AP^2 + AN^2 - 2\cdot AP\cdot AN\cdot cos(\beta) = \\
 &= x^2 + 2^2 - 4xcos(60) =\\
&= x^2 -2x + 4
\end{aligned}\end{equation}
Now I finally have an equation of both $PN^2$ and $PM^2$ both depending on $x$ and therefore I can find the minimum:
\begin{equation}\begin{aligned}
PN^2+PM^2 &= x^2 -2x + 4 + x^2 -4x +7 = \\
& = 2x^2 + -6x + 11  
\end{aligned}\end{equation}
Which by deriving in $x$ we obtain $4x -6 = 0$ which implies $x = 3/2$
 A: You can apply the law of cosines to $\triangle{APN}$ to have
$$PN^2=x^2+2^2-4x\cos 60^\circ=x^2-2x+4$$
Also, note that $CB=2\color{red}{\sqrt 3}$.
A: As an alternative, let the projection of $PN$ and $PM$ to $AC$ be $PN'$ and $PM'$ respectively. We have local extrema when $\vec{PM'}+\vec{PN'}=0$ i.e. when $x=1.5$.
A: I like mindless approaches.
Using Analytical Geometry, you can assign $(x,y)$ coordinates of

*

*C : $~\displaystyle (0,0).$

*B : $~\displaystyle \left(2\sqrt{3},0\right).$

*A : $~\displaystyle \left(0,2\right).$

*M : $~\displaystyle \left(\sqrt{3},0\right).$

*N : $~\displaystyle \left(\sqrt{3},1\right).$
First, consider what happens if you set $P = (0,1)$.
This must be superior to setting $P = (0,r) ~: 1 < r \leq 2$ because as $r$ moves from $1$ to $2$ both line segments $\overline{MP}$ and $\overline{NP}$ are increasing.
So, you can assume that $0 \leq r \leq 1$, assign $P = (0,r)$ calculate the sum of the squares of the line segments as a function of $r$, and then minimize the sum.
$$\left[\overline{MP}\right]^2 = 
\left[\overline{ ~\left(\sqrt{3},0\right) ~(0,r) ~}\right]^2 = r^2 + 3. \tag1 $$
$$\left[\overline{NP}\right]^2 = 
\left[\overline{ ~\left(\sqrt{3},1\right) ~(0,r) ~}\right]^2 = \left(1 - r\right)^2 + 3. \tag2 $$
Examination of (1) and (2) above indicates that you want to minimize the sum
$$r^2 + (1 - r)^2 ~: ~0 \leq r \leq 1.$$
This simplifies to choosing $r$ to minimize $r(r-1)$.
In Calculus (AKA Real Analysis) this would be simple.  In Pre-Calculus, you can employ the following trick:
Set $r = \dfrac{1}{2} + s ~: ~-\dfrac{1}{2} \leq s \leq \dfrac{1}{2}.$
Then, you are trying to minimize
$$r(r-1) = \left[ ~s + \frac{1}{2} ~\right] \times \left[ ~s - \frac{1}{2} ~\right] = s^2 - \frac{1}{4}.$$
Immediate that $r(r-1)$ is minimized by $s = 0 \implies r = \dfrac{1}{2}.$
