Compute $\int \limits_{\cos x}^{\sin x} \sqrt{1 - t^2}\mathrm dt$ Problem: $\displaystyle \frac{d}{dx}\int \limits_{\cos x}^{\sin x} \sqrt{1 - t^2} \mathrm dt$ when $ 0<x<\pi$.
My attempt, see images.
Two questions: 


*

*Do I have to break it up into two cases?

*I'm wrong. Correct answer is $1$. (Probably it is $\sin^2x+\cos^2x$). Why am I wrong?

 A: Using the Fundamental Theorem of Calculus, and the Chain Rule,  differentiate the function with respect to $x$. 
Before simplifying, we get $\cos x\sqrt{1-\sin^2 x}-(-\sin x)\sqrt{1-\cos^2 x}$. 
Two cases are useful, since for $\pi/2\lt x\lt \pi$ we have $\sqrt{1-\sin^2 x}=|\cos x|$. 
A: You don't need to compute the integral. Let's try a more general approach. Suppose $h$ is a function defined on some interval $[a,b]$ and that $f$ is another function taking its values in the interval $[a,b]$. Under these hypotheses, for any $c\in[a,b]$ and any $x$ in the domain of $f$, the integral
$$
I(x)=\int_{c}^{f(x)} h(t)\,dt
$$
is well defined. I'll assume also that $h$ is continuous and $f$ is differentiable; then, if $H$ is an antiderivative of $h$ (it exists because $h$ is continuous), we can write, by the fundamental theorem of calculus,
$$
I(x)=H(f(x))-H(c)
$$
and so
$$
I'(x)=H'(f(x))f'(x)=h(f(x))f'(x)
$$
again by the fundamental theorem of calculus ($H'=h$) and the chain rule. The choice of $c$ has effect on the value of $I(x)$, but not on the value of $I'(x)$.
Your integral can be written as
$$
F(x)=\int_{\cos x}^{\sin x}\sqrt{1-t^2}\,dt=
\int_{0}^{\sin x}\sqrt{1-t^2}\,dt-
\int_{0}^{\cos x}\sqrt{1-t^2}\,dt
$$
and so
$$
F'(x)=\sqrt{1-\sin^2x}\sin' x-\sqrt{1-\cos^2x}\cos'x=
|\cos x|\cos x+|\sin x|\sin x
$$
