## Differentiation Under the Integral Sign

1. Sometimes we work with tricky integrals. For example, consider the integral
(1)$\displaystyle f(x)=\int^{x^{2}}_{-x}\sin(t)\,\mathrm{d}t$.
What is $f'(x) =$ ???

We can evaluate (1) directly as
(2)$\displaystyle f(x)=-\cos(x^{2})+\cos(-x)$.
Thus its derivative is
(3)$\displaystyle f'(x)=2x\sin(x^{2})+\sin(-x)$.
But what about the general case?

2. The general scheme is quite simple. We write
(4)$\displaystyle I(x)=\int^{h(x)}_{g(x)}f(t)\,\mathrm{d}t$.
Then it follows that
(5)$\displaystyle I'(x)=f\bigl(h(x)\bigr)\cdot h'(x)-f\bigl(g(x)\bigr)\cdot g'(x)$.
How can we see this?

Let $F(x)$ be the antiderivative for $f(x)$, so $F'(x)=f(x)$. Then we see (4) becomes
(6)$\displaystyle I(x)=F\bigl(h(x)\bigr)-F\bigl(g(x)\bigr)$.
Take the derivative of both sides (using the chain rule on the right hand side) gives us
(7)\displaystyle \begin{aligned} \displaystyle I(x)&=F'\bigl(h(x)\bigr)\cdot h'(x)-F'\bigl(g(x)\bigr)\cdot g'(x)\\ \displaystyle&=f\bigl(h(x)\bigr)\cdot h'(x)-f\bigl(g(x)\bigr)\cdot g'(x)\end{aligned}
precisely as desired!

Example 1 [Math.SE]. Consider the function
(8)$\displaystyle g(x)=\int_{x^{3}}^{\sin(x^{2})}\sin(t^{2})\,\mathrm{d}t$
What is its derivative?

Solution. We see that
(9)$\displaystyle g'(x)=\sin\bigl(\sin^{2}(x^{2})\bigr)\cdot2x\cos(x^{2})- \sin(x^{6})\cdot3x^{2}$
This is probably done too quick, but we only need to differentiate the “boundary functions” $\sin(x^{2})$ and $x^{3}$. These are trivial calculations.

Remark. Observe by the fundamental theorem of calculus we have
(10a)$\displaystyle g(x) = g(0)+\int^{x}_{0} g'(u)\,\mathrm{d}u$
which is unexciting, until you substitute Equation (9) in and obtain
(10b)$\displaystyle g(x) = g(0)+\int^{x}_{0} \left[\sin\bigl(\sin^{2}(u^{2})\bigr)\cdot2u\cos(u^{2})- \sin(u^{6})\cdot3u^{2}\right]\,\mathrm{d}u$
So what? Well, we should see that $g(0)=0$, so we have another definition for $g(x)$, namely
(10c)$\displaystyle g(x) = \int^{x}_{0} \left[\sin\bigl(\sin^{2}(u^{2})\bigr)\cdot2u\cos(u^{2})- \sin(u^{6})\cdot3u^{2}\right]\,\mathrm{d}u$.
We found a way to relate two integrals together!

3. Usefulness. Usually we have to calculate a hard integral but cannot do it directly. So it helps to differentiate under the integral sign, then integrate the result using the fundamental theorem of calculus. This trick is sometimes called “Integration under the Integral Sign” and solves a lot of problems!

Example 2. Consider the integral
(11)$\displaystyle \int_{0}^{1} x^\alpha\,\mathrm{d}x = \frac{1}{\alpha + 1}$
for $\alpha>-1$.

We can integrate $\alpha$ over $[a,b]$ which gives us
(12)$\displaystyle \int_{a}^{b} \int_{0}^{1} x^\alpha \,\mathrm{d}x\,\mathrm{d}\alpha = \int_{a}^{b} \frac{\mathrm{d}\alpha}{\alpha + 1} = \ln{\left|{\frac{b + 1}{a + 1}}\right|}$
Switching the order of integration gives us
(13)$\displaystyle \int_{0}^{1} \int_{a}^{b} x^\alpha \,\mathrm{d}\alpha\,\mathrm{d}x = \int_{0}^{1} \frac{x^b - x^a}{\ln x}\,\mathrm{d}x$
Thus we deduce, setting (13) equal to (14), that
(14)$\displaystyle \int_{0}^{1} \frac{x^b - x^a}{\ln x}\,\mathrm{d}x = \ln{\left|{\frac{b + 1}{a + 1}}\right|}$.
This is, quite literally, the textbook example (see Woods’ Advanced Calculus text, section 61).