Let $ABC$ be a triangle and $M$ be the midpoint of $BC$. Squares $ABQP$ and $ACYX$ are erected. Show that $PX = 2AM$. 
$\textbf{Question:}$ Let $ABC$ be a triangle and $M$ be the midpoint of $BC$. Squares $ABQP$ and $ACYX$ are erected. Show that $PX = 2AM$.

I could solve this problem using computational techniques but I am looking for purely synthetic solution. I tried drawing some extra midpoints, connected them. But still couldn't find the solution.
Any kind of hint or full solution both are appreciated.
 A: Rotate triangle $AXP$ by $90^{\circ}$ around $A$ so that $P$ goes to $B$ and $X$ goes to a new point $X'$. Then $PX$ goes to $BX'$.
But $X',A,C$ are collinear, and $A$ is the midpoint of $X'C$; so $AM$ is a medial line in triangle $X'BC$. Hence $X'B = 2AM$.

Notice that we prove also $PX\bot AM$.
A: Let's first give names to the sides of $\overset{\Delta}{PAX}$ triangle: $|PA| = k$, $|AX| = m$ and $|PX| = b$. Also for $\overset{\Delta}{ABC}$ triangle: $|AB| = k$, $|AC| = m$, $|BC| = 2l$ and the length of the median $|AM| = a$. Writing law of cosines for $\overset{\Delta}{PAX}$ triangle for angle $\widehat{PAX}$, which is the opposite of angle $\widehat{A}$ in $\overset{\Delta}{ABC}$ triangle, along with the fact that $\widehat{PAB} = 90^{\circ}$ and $\widehat{XAC} = 90^{\circ}$ ($\widehat{PAX} + \widehat{A} + \widehat{PAB} + \widehat{XAC} = 360^{\circ}$), we have:
\begin{align*}
b^{2} &= k^{2} + m^{2} - 2\ k\ m\ cos (180^{\circ} - \widehat{A}) \\
b^{2} &= k^{2} + m^{2} + 2\ k\ m\ cos (\widehat{A}) \tag{1}
\end{align*}
Then write the same law for $ABC$ triangle along with Apollonius's theorem and we have:
\begin{align*}
(2l)^{2} &= k^{2} + m^{2} - 2\ k\ m\ cos(\widehat{A}) \\
4 l^{2} &= k^{2} + m^{2} - 2\ k\ m\ cos(\widehat{A}) \tag{2}
\end{align*}
\begin{align*}
k^{2} + m^{2} = 2(l^{2} + a^{2}) \tag{3}
\end{align*}
Summing $(1)$ and $(2)$ and using the right-hand side of $(3)$ in place of $k^{2} + m^{2}$ we get:
\begin{align*}
b^{2} + 4 l^{2} &= 2 (k^{2} + m^{2}) \\
b^{2} + 4 l^{2} &= 4 (l^{2} + a^{2}) \\
b^{2} &= 4 a^{2} \\
b &= 2a \implies |PX| = 2 |AM| 
\end{align*}
A: To rotate a vector around some point in the plane by $\alpha$ it's the same to rotate this vector by $\alpha$ around the tail of the vector.
Let $R^{\alpha}(\vec{a})$ be a rotation of $\vec{a}$ by $\alpha$.
Thus,  $$R^{90^{\circ}}(\vec{AD})=R^{90^{\circ}}\left(\frac{1}{2}\left(\vec{AB}+\vec{AC}\right)\right)=\frac{1}{2}\left(\vec{PA}+\vec{AX}\right)=\frac{1}{2}\vec{PX}$$ and we are done!
