Solution (source code)

= Solution

Use the <product rule> and the <fundamental theorem of calculus>:
$$
\frac d{dx}\left[\sin x\int_0^x\sin y\,dy\right]
=\cos x\int_0^x\sin y\,dy+\sin^2x.
$$
Since the <integral> is $1-\cos x$, this simplifies to
$$
\boxed{\cos x-\cos(2x)}.
$$