Help on derivative of trigonometric functions

I have simple problem in derivative of trigonometric functions, can anyone show me the way to calculate the derivative of following function?

$$y = \sin^2 x (\cos x + \sin x)$$

I think the answer should be:

$$y' = (2 \sin x \cos x)(\cos x + \sin x) + (-\sin x + \cos x)(\sin^2 x)$$

Is the above answer correct?

• You should apply the chain rule to differentiate $\sin^2 x$. – David Mitra Jan 4 '14 at 16:18
• It's incorrect. What's the derivative of $x\mapsto (\sin(x))^2$? – Git Gud Jan 4 '14 at 16:18

No. $$(\sin^2 x)^\prime\not=2\sin x.$$ $$(\sin^2 x)^\prime=2\sin x\cdot (\sin x)^\prime=2\sin x\cos x.$$
$$\frac{d\{\sin^2x(\cos x+\sin x)\}}{dx}=(\cos x+\sin x)\frac{d(\sin^2x)}{dx}+\sin^2x\frac{d(\cos x+\sin x)}{dx}$$
$$=(\cos x+\sin x)\cdot\frac{d(\sin^2x)}{d(\sin x)}\cdot\frac{d(\sin x)}{dx}+\sin^2x(-\cos x+\cos x)$$
$$=\cdots$$