In the equilateral triangle $ABC,AB=12.$One vertex of a square is at the midpoint of the side $BC$, and the two adjacent vertices are on the other two sides of the triangle.Find the length of the side of the square.
Let $DEFG$ be the square.Let $D$ be the midpoint of the side $BC.BD=DC=6.$
Let $E$ be on the side $AC$ and $G$ be on the side $AB$ such that $AG=12-a,BG=a$ and $AE=12-b,EC=b$.
In triangle $DEC,$ applying Cosine law,
In triangle $DGB,$ applying Cosine law,
I am stuck here.