[Solution by Dr. Abubacker] Rewrite as $(1+\cos^2x)f'-f\sin2x=\sin x$. Since $\frac{d}{dx}\left[f(1+\cos^2x)\right]=f'(1+\cos^2x)-f\sin2x$, we get $\frac{d}{dx}\left[f(1+\cos^2x)\right]=\sin x$, so $f(1+\cos^2x)=-\cos x+C$. $f(0)=0$ gives $C=1$. At $x=\frac\pi2$: $f=1$. Answer (1).