TITLE: How to find the derivative of this function?
QUESTION [7 upvotes]: $$f(x) = \int_0^{\cos x}t^2 \, dt$$
I computed and got $f'(x) = - \cos^2(x) \sin(x)$. I checked the answer in the book and I got this wrong. But I think I did this correctly. I used part 1 of FTC to do this. Any ideas?

REPLY [2 votes]: The direct method:
$$f(x)=\int_0^{\cos x}t^2\,dt=\left[\frac{t^3}3\right]_0^{\cos x}=\frac13\cos^3x$$ and using the chain rule $$f'(x)=\frac13\cdot3\cos^2x(-\sin x)-0=-\sin x\cos^2x$$ so you are correct!