Chain rule to differentiate $\sin ^2\frac{x}{2}$ I have this equation $$\sin ^2(\frac{x}{2})$$
Using the chain rule $
M'(N(x)).N'(x)$:
$$\begin{align*}
&M= (\sin \frac{x}{2})^2 \\
&N= \frac{x}{2}\end{align*}$$
That makes
$$2\sin \frac{x}{2}*\frac{1}{2}$$ or $$\sin \frac{x}{2}$$
Going again, we should have 
$$\frac{1}{2} \cos \frac{x}{2}$$ or $$\frac{\cos \frac{x}{2}}{2}$$
Yet solution is giving me
$$(\sin \frac{x}{2})(\cos \frac{x}{2})$$
Why...?

Write down
$$\begin{cases}h(x)=x^2\\g(x)=\sin x\\k(x)=\frac x2\end{cases}\;\;\implies \sin^2\frac x2=h\circ g\circ k(x)=h(g(k(x)))\implies$$
$$\left(\sin^2\frac x2\right)'=h'(g(k(x))\cdot g'(k(x))\cdot k'(x)=2\sin\frac x2\cdot\cos\frac x2\cdot\frac12=\frac12\sin x$$
using the trigonometric identity
$$\sin2\alpha=2\sin\alpha\cos\alpha$$
