Integration Technique #2: Integration By Parts

1. Try performing the following integral
(1)$\displaystyle\int\ln(x)\,\mathrm{d}x =\$ ???
You cannot do this (easily) with the techniques we’ve discussed so far. So lets introduce a new one: integration by parts.

2. We should recall the product rule for differentiation:
(2)$\displaystyle\frac{\mathrm{d}}{\mathrm{d}x}\bigl(f(x)g(x)\bigr)=f'(x)g(x)+f(x)g'(x)$
Now we apply the Fundamental Theorem of Calculus to both sides, obtaining
(3)$\displaystyle\int\frac{\mathrm{d}}{\mathrm{d}x}\bigl(f(x)g(x)\bigr)\,\mathrm{d}x=\int f'(x)g(x)\,\mathrm{d}x+\int f(x)g'(x)\,\mathrm{d}x$
So the left hand side simplifies, and the equation (3) becomes
(3′)$\displaystyle f(x)g(x)=\int f'(x)g(x)\,\mathrm{d}x+\int f(x)g'(x)\,\mathrm{d}x$
and simple algebraic manipulation gives us the final result
(4)$\displaystyle \int f(x)g'(x)\,\mathrm{d}x=f(x)g(x)-\int f'(x)g(x)\,\mathrm{d}x$.
What happened to the constant of integration? Well, it is “absorbed” into the integrals we’ve yet to perform (i.e., don’t worry about it the other integrals will produce the constants of integration which we’ll keep track of).

Example 1. Returning to Equation (1), i.e., considering the problem
(1)$\displaystyle\int\ln(x)\,\mathrm{d}x =\$ ???
What to do? Well, let
(5)$\displaystyle f(x)=\ln(x)$ and $\displaystyle g(x)=x$.
This produces the correct expression for the integrand, namely
(6)$\displaystyle f(x)g'(x)=\ln(x)\cdot1=\ln(x)$.
Thus we use the formula for integration by parts writing
(7)$\displaystyle\int\ln(x)\,\mathrm{d}x = x\ln(x) - \int\left(\frac{1}{x}\right)x\,\mathrm{d}x$
Observe that the right hand side simplifies to
(8)$\displaystyle x\ln(x) - \int\left(\frac{1}{x}\right)x\,\mathrm{d}x = x\ln(x)-\int\mathrm{d}x = x\ln(x)-x$
where we suppress the constant of integration (i.e., we throw it away).

Thus integration by parts solves Equation (1) quite simply as $x\ln(x)-x$.

Exercise 1. Calculate $\displaystyle\int_0^\infty x^{n} \mathrm{e}^{-x}\,\mathrm{d}x=$ ???

Exercise 2. Compute $\displaystyle \int\sin(x)\cos(x)\,\mathrm{d}x =$ ???

Exercise 3. Evaluate $\displaystyle \int\mathrm{e}^{x}\sin(x)\,\mathrm{d} x$.

Exercise 4. Consider $\displaystyle \int \frac{\ln^{k}(x)}{x}\,\mathrm{d}x$ where we abuse notation writing $\displaystyle\bigl(\ln(x)\bigr)^{k}=\ln^{k}(x)$.

Exercise 5. Repeatedly use integration by parts several times and evaluate $\displaystyle \int y^{4}(1-y)^{3}\,\mathrm{d}y$.

Exercise 6 [Math.SE]. Consider
$\displaystyle I=\int \frac{1}{\cos^3(x)}\,\mathrm{d}x$.
What is $I$?

Exercise 7 [Math.SE]. Calculate $\displaystyle \int^{a}_{-a} \sqrt{a^{2}-x^{2}}\ln(\sqrt{a^{2}-x^{2}})\,\mathrm{d}x$

Exercise 8 [Math.SE]. Denote $\lfloor x\rfloor$ to be the function which returns the greatest integer smaller than or equal to $x$. For example, $\lfloor -2.1\rfloor = -3$ and $\lfloor 3.76\rfloor=3$. Calculate
$\displaystyle{\int^{n}_{1}\ln(x) - \ln\lfloor x \rfloor \,\mathrm{d}x}$
for an arbitrary positive integer $n>0$.