Given $f(x)= \sin(\pi x)^{2}$, find the derivative.
Using the chain rule my work is as follows: $(\sin(\pi x)^2)'$ becomes $$2 \sin(\pi x) \cdot \frac{d}{dx}(\sin(\pi x)$$ The derivative of sin is cos, thus $$2 \sin(\pi x) \cdot \cos(\pi x) \cdot \frac{d}{dx}(\pi x)$$ The derivative of $\pi x$ is $\pi$, and the equation stretches to
$$2 \sin(\pi x) \cos(\pi x) \pi == 2 \pi \sin(\pi x) \cos(\pi x)$$
However, the book states the answer as $$2 \pi^{2}~ x ~\cos(\pi x)^{2}$$ and that definitely doesn't match my result. Where did I go wrong?
EDIT
Thanks to Arturo Madigan, Jonas Meyer, et al for their help.
I re-did the problem based on having $(\pi x)^{2}$, having the exponent rather than the sin function, and it seems I have a missing exponent as well.
Differentiating the terms of the function via the chain rule, I get $$(\pi x)^{2} [\frac{d}{dx}sin] \cdot \frac{d}{dx}(\pi x)^{2}$$
$$ cos(\pi x)^{2} \cdot 2\pi x= 2~\pi~ x cos~(\pi x)^{2}$$
According to the book answer, $2~\pi x$ should actually be $2~ \pi^{2} x$