Let $M$ be the midpoint of the side $AB$ of a triangle $ABC$. A circle through point $C$ that has a point of tangency to the line $AB$ at point $A$ and a circle through point $C$ that has a point of tangency to the line $AB$ at point $B$ intersect the second time at point $N$. Prove that $|CM|^2 + |CN|^2 - |MN|^2 = |CA|^2 + |CB|^2 - |AB|^2$.
.All segments of the form $XY$ for some letters $X,Y$ are lengths First, note that because $CN$ is the radical axis of the two circles, and since they both are tangent to $AB$, then we see that $M$ lies on $CN$ (Since $MA=MB$) . Now, denote the lengths of $BC, AC, AB$ as $a,b,c$ respectively. From here, we apply Stewart's Theorem to find the length of $CM$: $$(\frac{c}{2})^2 \cdot c +CM^2 \cdot c = b^2 \cdot (\frac{c}{2}) + a^2 \cdot (\frac{c}{2}) \rightarrow CM=\frac{\sqrt{2a^2+2b^2-c^2}}{2}$$Also, we can simplify $CM^2 + CN^2 - MN^2 = CM^2+(CN+MN)(CN-MN)=CM^2+CM(CM-2MN)$ Now, by PoP (and our knowledge of $M$ on $CN$), $$AM^2=MN \cdot CM \rightarrow \frac{c^2}{4}=MN \cdot \frac{\sqrt{2a^2+2b^2-c^2}}{2} \rightarrow MN=\frac{c^2}{2\sqrt{2a^2+2b^2-c^2}}$$So, $$CM^2+CM(CM-2MN)=\frac{2a^2+2b^2-c^2}{4} + \frac{\sqrt{2a^2+2b^2-c^2}}{2} (\frac{\sqrt{2a^2+2b^2-c^2}}{2}-\frac{c^2}{\sqrt{2a^2+2b^2-c^2}})$$$$=\frac{2a^2+2b^2-c^2}{2}-\frac{c^2}{2}=a^2+b^2-c^2$$which we can see is equivalent to $CA^2+CB^2-AB^2$, as desired