<s>[INST] Prove that $\overrightarrow{GH}.\overrightarrow{IJ}=-2x^2+8x-2$ in a regular hexagon We know that the hexagon is regular and:
$\overline{AB}=1$;
$\overline{AG}=\overline{CI}=\overline{DH}=\overline{FJ}=x$;

How would you prove that $\overrightarrow{GH}.\overrightarrow{IJ}=-2x^2+8x-2$?
 [/INST] $\qquad\qquad\qquad$
Consider $\triangle{GAK}$ where $K$ is the intersection point between $GH$ and $IJ$. ($K$ is the center of the hexagon.) Since $GA=x,AK=1,\angle{GAK}=60^\circ$, by the law of cosines, we have
$$GK=\sqrt{x^2+1^2-2\cdot x\cdot 1\cos(60^\circ)}=\sqrt{x^2-x+1}$$
Here, note that $GK=HK=IK=JK$.
Also, consider an isosceles triangle $BIG$ where $BG=BI=1-x,\angle{GBI}=120^\circ$. So, we have $GI=\sqrt 3(1-x)$.
Hence, applying the law of cosines to $\triangle{GIK}$, we have
$$\cos\angle{GKI}=\frac{KI^2+KG^2-IG^2}{2\cdot KI\cdot KG}=\frac{2(x^2-x+1)-3(1-x)^2}{2(x^2-x+1)}$$
Thus, we have
$$\vec{GH}\cdot\vec{IJ}=|\vec{GH}|\times |\vec{IJ}|\times \cos\angle{GKI}$$$$=4(x^2-x+1)\cdot\frac{2(x^2-x+1)-3(1-x)^2}{2(x^2-x+1)}=-2x^2+8x-2.$$
</s>