Skip to main content

Section 6.4 Integration by Parts

Integration by parts (IBP) is another useful technique for evaluating integrals, especially when the integrand is a product of two different types of functions (i.e. 2 functions multiplied together).

Example 6.4.1. When to Use Integration by Parts.

For example, integration by parts is useful for:
\(\int x e^x \,dx\) \(x\) times exponential
\(\int x^2 \ln{x} \,dx\) \(x^2\) times logarithm
\(\int x^3 \sin{x} \,dx\) \(x^3\) times sine
\(\int e^x \sin{x} \,dx\) exponential times sine
IBP is essentially a formula, which says,
\begin{equation*} \underbrace{\int u(x) v'(x) \,dx}_{\text{integral of u times v prime}} = \underbrace{u(x) v(x)}_{\text{u times v}} - \underbrace{\int v(x) u'(x) \,dx}_{\text{integral of v times u prime}} \end{equation*}
It is typically written using differential notation as,
\begin{equation*} \boxed{\int u \,dv = uv - \int v \,du} \end{equation*}
So, \(dv\) is basically the derivative of \(v\text{,}\) and \(du\) is the derivative of \(u\text{.}\) This formula is used from left to right:
  • The original integral is of the form \(\int u \,dv\) (2 things multiplied together)
  • Then we rewrite it as \(uv - \int v \,du\)
And if we do it right, the remaining integral will be easier than the original integral.
\begin{align*} \underbrace{\int u \,dv }_{\text{difficult integral}} \amp= u v - \underbrace{\int v \,du}_{\text{easier integral}} \end{align*}
In this way, this step only solves part of the original integral. This is why it’s called integration by parts.

Example 6.4.2. Evaluating \(\int x e^x \,dx\).

Consider the integral,
\begin{equation*} \int x e^x \,dx \end{equation*}
Solution.
The idea is to break up the integral into two parts, \(u\) and \(dv\text{,}\) such that,
  • \(dv\) can be integrated easily, and doesn’t become more complicated
  • \(u\) can be differentiated easily, and its derivative is simpler than itself
In this case, it turns out we should choose \(u = x\) and \(dv = e^x \,dx\text{.}\) Then, we can compute \(du\) and \(v\text{,}\)
\(u = x\) \(v = e^x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = dx\) \(dv = e^x \,dx\)
Then, the integral can be rewritten as \(uv - \int v \,du\text{,}\)
\begin{align*} \int x e^x \,dx \amp= \underbrace{x}_{u} \cdot \underbrace{e^x}_{v} - \int \underbrace{e^x}_{v} \cdot \underbrace{dx}_{du}\\ \amp= x e^x - e^x + C \amp\amp \text{evaluate the remaining integral} \end{align*}
Therefore,
\begin{equation*} \int x e^x \,dx = x e^x - e^x + C \end{equation*}
In general, a good guideline is for choosing \(u\) and \(dv\) is,
  • Choose \(u\) such that its derivative is more simple than \(u\) itself.
  • Choose \(dv\) so it can be easily integrated, and when integrated, either becomes simpler or at least not more complicated.

Example 6.4.3. Evaluating \(\int x \ln{x} \,dx\).

Consider the integral,
\begin{equation*} \int x \ln{x} \,dx \end{equation*}
Solution.
We can choose \(u = \ln{x}\) and \(dv = x \,dx\text{,}\) because the derivative of \(\ln{x}\) is \(\frac{1}{x}\) which is simpler than itself (\(\frac{1}{x}\) has no weird function \(\ln\text{,}\) it just involves \(x\)), and because \(x\) can be easily integrated to \(\frac{1}{2} x^2\text{.}\) Then,
\(u = \ln{x}\) \(v = \frac{1}{2} x^2\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = \frac{1}{x} \,dx\) \(dv = x \,dx\)
Then,
\begin{align*} \int x \ln{x} \,dx \amp= \underbrace{\ln{x}}_{u} \cdot \underbrace{\frac{1}{2} x^2}_{v} - \int \underbrace{\frac{1}{2} x^2}_{v} \cdot \underbrace{\frac{1}{x} \,dx}_{du}\\ \amp= \frac{1}{2} x^2 \ln{x} - \frac{1}{2} \int x \,dx\\ \amp= \frac{1}{2} x^2 \ln{x} - \frac{1}{4} x^2 + C \end{align*}
Some integrals require using integration by parts multiple times.

Example 6.4.4. Evaluating \(\int x^2 \sin{x} \,dx\).

Consider the integral,
\begin{equation*} \int x^2 \sin{x} \,dx \end{equation*}
Solution.
We can choose \(u = x^2\) and \(dv = \sin{x} \,dx\text{,}\) because the derivative of \(x^2\) is \(2x\) which is simpler than itself, and because \(\sin{x}\) can be easily integrated to \(-\cos{x}\text{.}\) Then,
\(u = x^2\) \(v = -\cos{x}\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = 2x \,dx\) \(dv = \sin{x} \,dx\)
Then,
\begin{align*} \int x^2 \sin{x} \,dx \amp= \underbrace{x^2}_{u} \cdot \underbrace{-\cos{x}}_{v} - \int \underbrace{-\cos{x}}_{v} \cdot \underbrace{2x \,dx}_{du}\\ \amp= -x^2 \cos{x} + 2 \int x \cos{x} \,dx \end{align*}
The new integral is less complicated because the power of \(x\) decreased by one (from 2 to 1). Then, we can use IBP again for \(\int x \cos{x} \,dx\text{,}\)
\(u = x\) \(v = \sin{x}\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = dx\) \(dv = \cos{x} \,dx\)
Then,
\begin{align*} \int x^2 \sin{x} \,dx \amp= -x^2 \cos{x} + 2 \brac{\underbrace{x}_{u} \cdot \underbrace{\sin{x}}_{v} - \int \underbrace{\sin{x}}_{v} \cdot \underbrace{dx}_{du}}\\ \amp= -x^2 \cos{x} + 2 \brac{x \sin{x} + \cos{x}} + C\\ \amp= -x^2 \cos{x} + 2x \sin{x} + 2 \cos{x} + C \end{align*}

Example 6.4.5. Evaluating \(\int x^2 e^x \,dx\).

Consider the integral,
\begin{equation*} \int x^2 e^x \,dx \end{equation*}
Solution.
Choose \(u = x^2\) and \(dv = e^x \,dx\text{,}\) because the derivative of \(x^2\) is \(2x\) which is simpler than itself, and because \(e^x\) can be easily integrated to itself. Then,
\(u = x^2\) \(v = e^x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = 2x \,dx\) \(dv = e^x \,dx\)
Then,
\begin{align*} \amp= \underbrace{x^2}_{u} \cdot \underbrace{e^x}_{v} - \int \underbrace{e^x}_{v} \cdot \underbrace{2x \,dx}_{du}\\ \amp= x^2 e^x - 2 \int x e^x \,dx \end{align*}
The new integral is simpler because the power of \(x\) decreased by one. Using IBP again,
\(u = x\) \(v = e^x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = dx\) \(dv = e^x \,dx\)
\begin{align*} \amp= x^2 e^x - 2 \brac{\underbrace{x}_{u} \cdot \underbrace{e^x}_{v} - \int \underbrace{e^x}_{v} \cdot \underbrace{dx}_{du}}\\ \amp= x^2 e^x - 2 \brac{x e^x - e^x} + C\\ \amp= x^2 e^x - 2x e^x + 2e^x + C \end{align*}
Each time you use IBP, the power of the polynomial decreases by one, until it eventually reaches 0. This is what makes IBP a useful technique for integrating products of polynomials and other functions.
From the previous examples, we can see that IBP is often useful when the integral is a product of 2 different types of functions.

Checkpoint 6.4.6. Evaluating \(\int x^3 e^x \,dx\).

Evaluate the integral \(\int x^3 e^x \,dx\text{.}\)
Answer.
\(\int x^3 e^x \,dx = x^3 e^x - 3x^2 e^x + 6x e^x - 6e^x + C\)

Subsection 6.4.1 Integral of Natural Logarithm

Integration by parts can be used to find the antiderivative of the natural logarithm function \(\ln{x}\text{.}\)

Example 6.4.7. Evaluating \(\int \ln{x} \,dx\).

Consider the integral,
\begin{equation*} \int \ln{x} \,dx \end{equation*}
Solution.
At first, \(\ln{x}\) does not look like a product of functions, however, we can think of it as \(\ln{x} \cdot 1\text{,}\) and choose \(u = \ln{x}\) and \(dv = 1 \,dx\text{.}\) The derivative of \(\ln{x}\) is \(\frac{1}{x}\) which is simpler than itself, and 1 can be easily integrated to \(x\text{.}\) Then,
\(u = \ln{x}\) \(v = x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = \frac{1}{x} \,dx\) \(dv = dx\)
Then,
\begin{align*} \int \ln{x} \,dx \amp= \underbrace{\ln{x}}_{u} \cdot \underbrace{x}_{v} - \int \underbrace{x}_{v} \cdot \underbrace{\frac{1}{x} \,dx}_{du}\\ \amp= x \ln{x} - x + C \end{align*}
In summary,
\begin{equation*} \boxed{\int \ln{x} \,dx = x \ln{x} - x + C} \end{equation*}

Subsection 6.4.2 Cyclic Examples (Product of Exponential and Trig)

Example 6.4.8. Evaluating \(\int e^x \sin x \,dx\).

Consider the integral,
\begin{equation*} \int e^x \sin x \,dx \end{equation*}
Solution.
Here, it turns out that we could choose either \(u\) or \(dv\) to be \(e^x\) or \(\sin x\text{,}\) and both would work. This is because the derivative and integral of \(e^x\) is \(e^x\text{,}\) and the derivative and integral of \(\sin x\) is \(\cos{x}\) or \(-\cos x\text{,}\) so both of them are basically the same in terms of complexity. In this case, we will choose \(u = e^x\) and \(dv = \sin x \,dx\text{.}\) Then,
\(u = e^x\) \(v = -\cos x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = e^x \,dx\) \(dv = \sin x \,dx\)
Then,
\begin{align*} \int e^x \sin x \,dx \amp= -\underbrace{e^x}_{u} \underbrace{\cos x}_{v} - \int -\underbrace{e^x}_{u} \underbrace{\cos x}_{v} \,dx\\ \amp= -e^x \cos x + \int e^x \cos x \,dx \end{align*}
The second integral is similar to the first except that it has \(\cos x\) instead of \(\sin x\text{.}\) To evaluate it, we use IBP again,
\(u = e^x\) \(v = \sin x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = e^x \,dx\) \(dv = \cos x \,dx\)
\begin{align*} \int e^x \sin x \,dx \amp= -e^x \cos x + \brac{\underbrace{e^x}_{u} \underbrace{\sin x}_{v} - \int \underbrace{e^x}_{u} \underbrace{\sin x}_{v} \,dx}\\ \amp= e^x \sin x - e^x \cos x - \int e^x \sin x \,dx \end{align*}
The resulting integral is actually the same as the original integral we started with. This means that, like an equation, we can add the integral to both sides, and “collect” them together as like terms on the left-hand side,
\begin{align*} \int e^x \sin x \,dx \amp= e^x \sin x - e^x \cos x - \int e^x \sin x \,dx\\ 2 \int e^x \sin x \,dx \amp= e^x \sin x - e^x \cos x \end{align*}
Then, to solve for the desired integral, divide both sides by 2, and also finally add the constant of integration,
\begin{equation*} \int e^x \sin x \,dx = \frac{1}{2} e^x \sin x - \frac{1}{2} e^x \cos x + C \end{equation*}

Checkpoint 6.4.9. Evaluating \(\int e^x \cos x \,dx\).

Evaluate the integral \(\int e^x \cos x \,dx\text{.}\)
Answer.
\(\int e^x \cos x \,dx = \frac{1}{2} e^x \sin x + \frac{1}{2} e^x \cos x + C\)

Subsection 6.4.3 Integration by Parts for Definite Integrals

For definite integrals, you also have to evaluate the \(uv\) term at the limits of integration. Otherwise, it is very similar.
\begin{equation*} \boxed{\int_a^b u \,dv = \eval{uv}_a^b - \int_a^b v \,du} \end{equation*}

Example 6.4.10. Evaluating \(\int_0^2 3x e^x \,dx\).

Evaluate the integral,
\begin{equation*} \int_0^2 3x e^x \,dx \end{equation*}
Solution.
\(u = 3x\) \(v = e^x\)
\(\big\downarrow\) \(\big\uparrow\)
\(du = 3 \,dx\) \(dv = e^x \,dx\)
Then,
\begin{align*} \int_0^2 3x e^x \,dx \amp= \eval{3x e^x}_0^2 - \int_0^2 3 e^x \,dx\\ \amp= 6 e^2 - 0 - \brac{3 e^2 - 3 e^0}\\ \amp= 3 e^2 + 3 \end{align*}

Subsection 6.4.4 Summary of Integration by Parts

In summary,
\begin{equation*} \boxed{\int u \,dv = uv - \int v \,du} \end{equation*}
A mnemonic to remember the IBP formula is “ultra-violet voodoo”.

Remark 6.4.11.

Note that integration by parts is a place-holder formula, in that the variables \(u\) and \(v\) are just place-holders for the functions we choose, and they are not new variables that we are substituting into the integral.
In contrast, recall that with substitution, the integral is transformed from \(x\) to an integral in another variable \(u\text{.}\)
With integration by parts, we do not substitute \(u\) or \(v\text{,}\) but instead just use the formula as a pattern to replace the given integral with an equivalent integral, still in terms of \(x\text{.}\) In this way, you don’t have to worry about changing the limits of integration for definite integrals.

Remark 6.4.12.

With integration by parts, you don’t have to worry about the constant of integration \(+C\) until the final answer. That is, when integrating \(v'\) to get \(v\text{,}\) we do not need to include a constant of integration \(+C\text{,}\) because there will be a constant introduced by the remaining integral \(\int v \,du\text{.}\) So, it is easiest to just wait until the very end to include \(+C\text{.}\)

Subsection 6.4.5 Derivation of the Integration by Parts Formula

You may recall that integration by substitution comes from the chain rule for derivatives. In a similar way, integration by parts comes from the product rule for derivatives. Recall the product rule for derivatives, which says that, for two functions, \(f(x)\) and \(g(x)\text{,}\)
\begin{align*} \frac{d}{dx} (f(x) g(x)) \amp= f'(x) g(x) + f(x) g'(x) \qquad \text{or, more simply,} \qquad \frac{d}{dx} (fg) = f' g + f g' \end{align*}
Taking the antiderivative of both sides gives,
\begin{equation*} \int \frac{d}{dx} (f g) \,dx = \int f' g \,dx + \int f g' \,dx \end{equation*}
The left-hand side is the integral of the derivative of \(f g\text{,}\) so it is just \(f g\text{,}\) so we can write,
\begin{equation*} f g = \int f' g \,dx + \int f g' \,dx \end{equation*}
Then, rearranging this formula to isolate \(\int f g' \,dx\) gives,
\begin{equation*} \int f g' \,dx = f g - \int g f' \,dx \end{equation*}
This is the integration by parts formula, except the convention is to use \(u\) and \(v\) instead of \(f\) and \(g\text{,}\) and to write \(dv\) instead of \(v' dx\text{,}\) and \(du\) instead of \(u' dx\text{.}\) So, we write it as,
\begin{equation*} \int u \,dv = uv - \int v \,du \end{equation*}
as before.

Subsection 6.4.6 Guidelines for Choosing \(u\) and \(dv\) (LIATE)

An important part of using integration by parts is to choose the correct \(u\) and \(dv\text{.}\) Intuitively,
  • Choose \(u\) so its derivative is more simple than itself
  • Choose \(\,dv\) to be something that is easily integrated, and either becomes simpler or at least not more complicated.
There is a mnemonic for choosing \(u\) called the LIATE rule (typically pronounced “lie-ate”), which is an acronym that stands for:
  • L: logarithmic functions, e.g. \(\ln{x}, \log_2{x}, \log{x}\text{.}\)
  • I: inverse trigonometric functions, e.g. \(\arcsin{x}, \arccos{x}, \arctan{x}\text{.}\)
  • A: algebraic functions, of the form \(x^n\text{,}\) like polynomial functions (\(x^2, x^3, x^4\text{,}\) etc.) and radical functions (\(x^{1/2}, x^{1/3}, x^{2/3}\text{,}\) etc.).
  • T: trigonometric functions, e.g. \(\sin{x}, \cos{x}, \tan{x}\text{.}\)
  • E: exponential functions, e.g. \(e^x\text{,}\) \(b^x\text{.}\)
The rule is:
  • Choose \(u\) to be what is highest on the list
  • And then \(dv\) will be what is leftover.
Also, don’t forget that you can also just choose \(u\) to be the entire function and \(dv = 1\text{,}\) if nothing else seems to work.

Subsection 6.4.7 Examples

Exercise Group 6.4.1. One-Step IBP (\(\star\)).

Evaluate each integral.
(c)
\(\int x\sin(2x)\,dx\)
Answer.
\(-\frac{1}{2}x\cos(2x)+\frac{1}{4}\sin(2x)+C\)
(d)
\(\int x^2\ln x\,dx\)
Answer.
\(\frac{1}{3}x^3\ln x-\frac{1}{9}x^3+C\)
(e)
\(\int xe^{2x}\,dx\)
Answer.
\(\frac{1}{2}xe^{2x}-\frac{1}{4}e^{2x}+C\)
(f)
\(\int x\cos(5x)\,dx\)
Answer.
\(\frac{1}{5}x\sin(5x)+\frac{1}{25}\cos(5x)+C\)
(g)
\(\int xe^{3x}\,dx\)
Answer.
\(\frac{1}{3}xe^{3x}-\frac{1}{9}e^{3x}+C\)
(h)
\(\int xe^{-2x}\,dx\)
Answer.
\(-\frac{1}{2}xe^{-2x}-\frac{1}{4}e^{-2x}+C\)
(i)
\(\int \sqrt{x}\ln x\,dx\)
Answer.
\(\frac{2}{3}x^{3/2}\ln x-\frac{4}{9}x^{3/2}+C\)
(j)
\(\int x^4\ln x\,dx\)
Answer.
\(\frac{1}{5}x^5\ln x-\frac{1}{25}x^5+C\)
(k)
\(\int x\sin\brac{\frac{x}{2}}\,dx\)
Answer.
\(-2x\cos\brac{\frac{x}{2}}+4\sin\brac{\frac{x}{2}}+C\)
(l)
\(\int xe^{-3x}\,dx\)
Answer.
\(-\frac{1}{3}xe^{-3x}-\frac{1}{9}e^{-3x}+C\)
(m)
\(\int x\ln(10x)\,dx\)
Answer.
\(\frac{1}{2}x^2\ln(10x)-\frac{1}{4}x^2+C\)
(n)
\(\int xe^{5x}\,dx\)
Answer.
\(\frac{1}{5}xe^{5x}-\frac{1}{25}e^{5x}+C\)
(o)
\(\int x^9\ln x\,dx\)
Answer.
\(\frac{1}{10}x^{10}\ln x-\frac{1}{100}x^{10}+C\)
(p)
\(\int xe^{6x}\,dx\)
Answer.
\(\frac{1}{6}xe^{6x}-\frac{1}{36}e^{6x}+C\)

Exercise Group 6.4.2. Definite Integrals, One Step (\(\star\)).

Evaluate each definite integral.
(f)
\(\int_1^2 x^2\ln x\,dx\)
Answer.
\(\frac{8}{3}\ln{2} - \frac{7}{9}\)
(g)
\(\int_{-\pi/4}^{\pi/6} (2x+1)\sin(6x)\,dx\)
Answer.
\(\frac{\pi}{18} + \frac{1}{9}\)
(h)
\(\int_0^{1/2} x\cos(\pi x)\,dx\)
Answer.
\(\frac{1}{2\pi} - \frac{1}{\pi^2}\)

Exercise Group 6.4.3. One-Step Variants (\(\star\)).

Evaluate each integral.
(a)
\(\int x\cos(\pi x)\,dx\)
Answer.
\(\frac{1}{\pi}x\sin(\pi x)+\frac{1}{\pi^2}\cos(\pi x)+C\)
(b)
\(\int \ln\sqrt{x}\,dx\)
Answer.
\(\frac{1}{2}x\ln x-\frac{1}{2}x+C\)
(c)
\(\int 3x\ln(4x)\,dx\)
Answer.
\(\frac{3}{2}x^2\ln(4x)-\frac{3}{4}x^2+C\)
(d)
\(\int \frac{\ln x}{x^2}\,dx\)
Hint.
\(\frac{\ln{x}}{x^2}= \ln{x} \cdot x^{-2}\)
Answer.
\(-\frac{\ln x}{x}-\frac{1}{x}+C\)
(e)
\(\int (x-2)\ln x\,dx\)
Answer.
\(\frac{1}{2}x^2\ln x-2x\ln x-\frac{1}{4}x^2+2x+C\)
(f)
\(\int x\ln(x^2)\,dx\)
Answer.
\(\frac{1}{2}x^2\ln(x^2)-\frac{1}{2}x^2+C\)
(g)
\(\int \ln(7x-6)\,dx\)
Answer.
\(\brac{x-\frac{6}{7}}\ln|7x-6|-x+C\)
(h)
\(\int \frac{\ln x}{x^{10}}\,dx\)
Hint.
\(\frac{\ln{x}}{x^{10}}= \ln{x} \cdot x^{-10}\)
Answer.
\(-\frac{\ln x}{9x^9}-\frac{1}{81x^9}+C\)
(i)
\(\int x\cdot 3^x\,dx\)
Answer.
\(\frac{1}{\ln 3}x\cdot 3^x-\frac{1}{(\ln 3)^2}\cdot 3^x+C\)
(j)
\(\int \frac{x}{10^x}\,dx\)
Hint.
\(\frac{x}{10^x} = x \cdot 10^{-x}\)
Answer.
\(-\frac{x}{10^x\ln 10}-\frac{1}{10^x(\ln 10)^2}+C\)
(k)
\(\int (x-1)\sin(\pi x)\,dx\)
Answer.
\(\frac{1}{\pi}(1-x)\cos(\pi x)+\frac{1}{\pi^2}\sin(\pi x)+C\)
(l)
\(\int (2x+4)\cos(2x)\,dx\)
Answer.
\(x\sin(2x)+2\sin(2x)+\frac{1}{2}\cos(2x)+C\)

Exercise Group 6.4.4. Cyclic Examples with Exponential and Trigonometric Functions (\(\star\star\)).

Evaluate each integral.
(a)
\(\int e^{-x}\cos x\,dx\)
Answer.
\(\frac{1}{2}e^{-x}\sin x-\frac{1}{2}e^{-x}\cos x+C\)
(b)
\(\int e^{2x}\sin(3x)\,dx\)
Answer.
\(\frac{2}{13}e^{2x}\sin(3x)-\frac{3}{13}e^{2x}\cos(3x)+C\)
(c)
\(\int e^{3x}\cos(2x)\,dx\)
Answer.
\(\frac{2}{13}e^{3x}\sin(2x)+\frac{3}{13}e^{3x}\cos(2x)+C\)
(d)
\(\int e^{-x}\cos(2x)\,dx\)
Answer.
\(\frac{2}{5}e^{-x}\sin(2x)-\frac{1}{5}e^{-x}\cos(2x)+C\)
(e)
\(\int e^{-x}\sin(4x)\,dx\)
Answer.
\(-\frac{1}{17}e^{-x}\sin(4x)-\frac{4}{17}e^{-x}\cos(4x)+C\)
(f)
\(\int e^{2x}\cos x\,dx\)
Answer.
\(\frac{2}{5}e^{2x}\cos x+\frac{1}{5}e^{2x}\sin x+C\)
(g)
\(\int e^{2x}\cos(3x)\,dx\)
Answer.
\(\frac{2}{13}e^{2x}\cos(3x)+\frac{3}{13}e^{2x}\sin(3x)+C\)
(h)
\(\int e^{-2x}\sin(2x)\,dx\)
Answer.
\(-\frac{1}{4}e^{-2x}\sin(2x)-\frac{1}{4}e^{-2x}\cos(2x)+C\)
(i)
\(\int e^{-2x}\sin(6x)\,dx\)
Answer.
\(-\frac{1}{20}e^{-2x}\sin(6x)-\frac{3}{20}e^{-2x}\cos(6x)+C\)
(j)
\(\int e^{6x}\sin(4x)\,dx\)
Answer.
\(\frac{3}{26}e^{6x}\sin(4x)-\frac{1}{13}e^{6x}\cos(4x)+C\)
(k)
\(\int e^{5x}\cos(5x)\,dx\)
Answer.
\(\frac{1}{10}e^{5x}\cos(5x)+\frac{1}{10}e^{5x}\sin(5x)+C\)

Exercise Group 6.4.5. Two-Step IBP (\(\star\star\)).

Evaluate each integral.
(a)
\(\int x^2\cos x\,dx\)
Answer.
\(x^2\sin x+2x\cos x-2\sin x+C\)
(b)
\(\int x^2e^{-x}\,dx\)
Answer.
\(-x^2e^{-x}-2xe^{-x}-2e^{-x}+C\)
(c)
\(\int x^2\sin(2x)\,dx\)
Answer.
\(-\frac{1}{2}x^2\cos(2x)+\frac{1}{2}x\sin(2x)+\frac{1}{4}\cos(2x)+C\)
(d)
\(\int x^2e^{4x}\,dx\)
Answer.
\(\frac{1}{4}x^2e^{4x}-\frac{1}{8}xe^{4x}+\frac{1}{32}e^{4x}+C\)
(f)
\(\int (x^2+2x)\cos x\,dx\)
Answer.
\(x^2\sin x+2x\sin x-2\sin x+2x\cos x+2\cos x+C\)
(g)
\(\int (x^2-2x+1)e^{2x}\,dx\)
Answer.
\(\frac{1}{2}x^2e^{2x}-\frac{3}{2}xe^{2x}+\frac{5}{4}e^{2x}+C\)
(i)
\(\int x^2\sin(\beta x)\,dx\)
Answer.
\(-\frac{1}{\beta}x^2\cos(\beta x)+\frac{2}{\beta^2}x\sin(\beta x)+\frac{2}{\beta^3}\cos(\beta x)+C\)

Exercise Group 6.4.6. Definite Integrals, One Step (\(\star\)).

Evaluate each definite integral.
(b)
\(\int_1^5 \frac{\ln x}{x^2}\,dx\)
Answer.
\(\frac{4-\ln 5}{5}\)
(c)
\(\int_1^5 \frac{x}{e^x}\,dx\)
Answer.
\(\frac{2}{e}-\frac{6}{e^5}\)

Exercise Group 6.4.7. Definite Integrals, Two Steps (\(\star\star\)).

Evaluate each definite integral.
(a)
\(\int_0^{\pi/2} x^2\sin(2x)\,dx\)
Answer.
\(\frac{\pi^2}{8}-\frac{1}{2}\)
(d)
\(\int_0^\pi e^x\sin x\,dx\)
Answer.
\(\frac{1}{2}e^{\pi} + \frac{1}{2}\)

Exercise Group 6.4.8. Special Techniques (\(\star\star\)).

Evaluate each integral.
(a)
\(\int x\sec^2 x\,dx\)
Hint.
we can integrate \(\sec^2{x}\)
Answer.
\(x\tan x+\ln|\cos x|+C\)
(b)
\(\int x\csc^2 x\,dx\)
Hint.
we can integrate \(\csc^2{x}\)
Answer.
\(-x\cot x+\ln|\sin x|+C\)
(c)
\(\int x\sin x\cos x\,dx\)
Hint.
\(\sin x\cos x = \frac{\sin(2x)}{2}\)
Answer.
\(-\frac{1}{4}x\cos(2x)+\frac{1}{8}\sin(2x)+C\)
(d)
\(\int x\sec x\tan x\,dx\)
Hint.
we can integrate \(\sec x\tan x\)
Answer.
\(x\sec x-\ln|\sec x+\tan x|+C\)
(e)
\(\int x\csc x\cot x\,dx\)
Hint.
we can integrate \(\csc x\cot x\)
Answer.
\(-x\csc x+\ln|\csc x-\cot x|+C\)
(f)
\(\int (\ln x)^2\,dx\)
Hint.
similar to \(\int \ln{x} \,dx\)
Answer.
\(x(\ln x)^2-2x\ln x+2x+C\)
(g)
\(\int (\ln(x+1))^2\,dx\)
Hint.
similar to \(\int (\ln x)^2 \,dx\)
Answer.
\(x(\ln(x+1))^2+(\ln(x+1))^2-2x\ln(x+1)-2\ln(x+1)+2x+2+C\)
(h)
\(\int x\ln(x-1)\,dx\)
Hint.
similar to \(\int x\ln x \,dx\)
Answer.
\(\frac{x^2-1}{2}\ln|x-1|-\frac{x^2}{4}-\frac{x}{2}+C\)
(i)
\(\int 4x\sec^2(2x)\,dx\)
Answer.
\(2x\tan(2x)+\ln|\cos(2x)|+C\)

Exercise Group 6.4.9. Inverse Trigonometric Functions (\(\star\)).

Evaluate each integral.
(a)
\(\int (\arcsin x)^2\,dx\)
Answer.
\(x(\arcsin x)^2-2x+2\sqrt{1-x^2}\arcsin x+C\)
(b)
\(\int \arctan(2x)\,dx\)
Answer.
\(x\arctan(2x)-\frac{1}{4}\ln(4x^2+1)+C\)
(c)
\(\int x\arctan x\,dx\)
Answer.
\(\frac{1}{2}(x^2+1)\arctan x-\frac{1}{2}x+C\)
(d)
\(\int x\sec^{-1}x\,dx\)
Hint.
we can differentiate \(\sec^{-1}x\text{,}\) as \(\frac{d}{dx} \sec^{-1}{x} = \frac{1}{x\sqrt{x^2-1}}\)
Answer.
\(\frac{1}{2}x^2\sec^{-1}x-\frac{1}{2}\sqrt{x^2-1}+C\)
(e)
\(\int x\arctan(7x)\,dx\)
Answer.
\(\frac{1}{98}(49x^2+1)\arctan(7x)-\frac{1}{14}x+C\)
(f)
\(\int x^2\tan^{-1}\brac{\frac{x}{2}}\,dx\)
Answer.
\(\frac{1}{3}x^3 \tan^{-1}\brac{\frac{x}{2}}-\frac{1}{3}x^2+\frac{4}{3}\ln(x^2+4)+C\)

Exercise Group 6.4.10. Three or More Steps (\(\star\star\star\)).

Evaluate each integral.
(a)
\(\int x^3\sin x\,dx\)
Answer.
\(-x^3\cos x+3x^2\sin x+6x\cos x-6\sin x+C\)
(b)
\(\int x^3\cos x\,dx\)
Answer.
\(x^3\sin x+3x^2\cos x-6x\sin x-6\cos x+C\)
(c)
\(\int x^4e^{-x}\,dx\)
Answer.
\(-x^4e^{-x}-4x^3e^{-x}-12x^2e^{-x}-24xe^{-x}-24e^{-x}+C\)
(d)
\(\int 4x^3e^{2x}\,dx\)
Answer.
\(2x^3e^{2x}-3x^2e^{2x}+3xe^{2x}-\frac{3}{2}e^{2x}+C\)
(e)
\(\int x^5e^x\,dx\)
Answer.
\(x^5e^x-5x^4e^x+20x^3e^x-60x^2e^x+120xe^x-120e^x+C\)
(f)
\(\int x(\ln x)^2\,dx\)
Answer.
\(\frac{1}{2}x^2(\ln x)^2-\frac{1}{2}x^2\ln x+\frac{1}{4}x^2+C\)
(g)
\(\int x^2(\ln x)^2\,dx\)
Answer.
\(\frac{1}{3}x^3(\ln x)^2-\frac{2}{9}x^3\ln x+\frac{2}{27}x^3+C\)
(h)
\(\int x^3e^{8x}\,dx\)
Answer.
\(\frac{1}{8}x^3e^{8x}-\frac{3}{64}x^2e^{8x}+\frac{3}{256}xe^{8x}-\frac{3}{2048}e^{8x}+C\)
(i)
\(\int \ln(x+x^2)\,dx\)
Answer.
\(x\ln x+x\ln(x+1)+\ln(x+1)-2x+C\)

Exercise Group 6.4.11. Definite Integrals (\(\star\star\)).

Evaluate each definite integral.
(b)
\(\int_0^\pi x\sin x\cos x\,dx\)
Hint.
Use \(\sin x\cos x=\frac{1}{2}\sin(2x)\) first.
Answer.
\(-\frac{\pi}{4}\)
(c)
\(\int_1^2 \frac{(\ln x)^2}{x^3}\,dx\)
Answer.
\(\frac{3}{16}-\frac{\ln 2}{8}-\frac{(\ln 2)^2}{8}\)
(d)
\(\int_1^2 x^4(\ln x)^2\,dx\)
Answer.
\(\frac{32(\ln 2)^2}{5}-\frac{64\ln 2}{25}+\frac{62}{125}\)
(e)
\(\int_0^1 x^2\cdot 2^x\,dx\)
Answer.
\(\frac{2(\ln 2-1)^2}{(\ln 2)^3}\)

Exercise Group 6.4.12. More Definite Integrals (\(\star\star\)).

Evaluate each definite integral.
(b)
\(\int_{-\pi/4}^{\pi/4} x^2\sin x\,dx\)
Answer.
\(0\) (you might notice a shortcut: it is an odd function on a symmetric interval, so the integral is equal to 0)
(c)
\(\int_1^{e^2} x^2\ln x\,dx\)
Answer.
\(\frac{5e^6+1}{9}\)
(f)
\(\int_0^t e^x\sin(t-x)\,dx\) (\(t\) is a constant.)
Answer.
\(\frac{e^t-\sin t-\cos t}{2}\)
(g)
\(\int_{-\pi/2}^{\pi/2} e^{2x}\cos x\,dx\)
Answer.
\(\frac{e^\pi+e^{-\pi}}{5}\)

Subsection 6.4.8 Advanced Examples

Sometimes, a \(u\)-substitution or trigonometric identity can be used to simplify the integral, which leads to an integral where you can use integration by parts.

Exercise Group 6.4.13. Substitution then IBP (\(\star\star\star\star\)).

Evaluate each integral.
(a)
\(\int x\tan^2 x\,dx\)
Hint.
\(\tan^2 x = \sec^2 x-1\)
Answer.
\(x\tan x-\ln|\sec x|-\frac{x^2}{2}+C\)
(b)
\(\int x\sin^2 x\,dx\)
Hint.
\(\sin^2 x = \frac{1-\cos(2x)}{2}\)
Answer.
\(\frac{1}{4}x^2-\frac{1}{4}x\sin(2x)-\frac{1}{8}\cos(2x)+C\)
(c)
\(\int e^{\sqrt{x}}\,dx\)
Hint.
let \(u=\sqrt{x}\text{,}\) leads to \(\int 2ue^u\,du\)
Answer.
\(2\sqrt{x}\,e^{\sqrt{x}}-2e^{\sqrt{x}}+C\)
(d)
\(\int \sin\brac{\sqrt{x}}\,dx\)
Hint.
let \(u=\sqrt{x}\text{,}\) leads to \(\int 2u\sin u\,du\)
Answer.
\(-2\sqrt{x}\cos\brac{\sqrt{x}}+2\sin\brac{\sqrt{x}}+C\)
(e)
\(\int \cos\brac{\sqrt{x}}\,dx\)
Hint.
let \(u=\sqrt{x}\text{,}\) leads to \(\int 2u\cos u\,du\)
Answer.
\(2\sqrt{x}\sin\brac{\sqrt{x}}+2\cos\brac{\sqrt{x}}+C\)
(f)
\(\int \sqrt{x}\,e^{\sqrt{x}}\,dx\)
Hint.
let \(u=\sqrt{x}\text{,}\) leads to \(\int 2u^2e^u\,du\)
Answer.
\(2xe^{\sqrt{x}}-4\sqrt{x}\,e^{\sqrt{x}}+4e^{\sqrt{x}}+C\)
(g)
\(\int \sin(\ln x)\,dx\)
Hint.
let \(u=\ln x\text{,}\) leads to \(\int e^u\sin u\,du\text{;}\) cyclic IBP
Answer.
\(\frac{1}{2}x\sin(\ln x)-\frac{1}{2}x\cos(\ln x)+C\)
(h)
\(\int e^{2x}\sin(e^x)\,dx\)
Hint.
let \(u=e^x\text{,}\) leads to \(\int u\sin u\,du\)
Answer.
\(\sin(e^x)-e^x\cos(e^x)+C\)
(i)
\(\int \arctan\brac{\sqrt{x}}\,dx\)
Hint.
let \(u=\sqrt{x}\text{,}\) leads to \(\int 2u\arctan u\,du\)
Answer.
\(x\arctan\brac{\sqrt{x}}+\arctan\brac{\sqrt{x}}-\sqrt{x}+C\)
(j)
\(\int x^5e^{x^3}\,dx\)
Hint.
let \(u=x^3\text{,}\) leads to \(\int \frac{1}{3}ue^u\,du\)
Answer.
\(\frac{1}{3}x^3e^{x^3}-\frac{1}{3}e^{x^3}+C\)
(k)
\(\int e^{\sqrt{3x+9}}\,dx\)
Hint.
let \(u=\sqrt{3x+9}\text{,}\) leads to \(\int \frac{2}{3}ue^u\,du\)
Answer.
\(\frac{2}{3}\sqrt{3x+9}\,e^{\sqrt{3x+9}}-\frac{2}{3}e^{\sqrt{3x+9}}+C\)
(l)
\(\int \sin(\ln(5x))\,dx\)
Hint.
let \(u=\ln(5x)\text{,}\) leads to \(\int \frac{1}{5}e^u\sin u\,du\text{;}\) cyclic IBP
Answer.
\(\frac{1}{2}x\sin(\ln(5x))-\frac{1}{2}x\cos(\ln(5x))+C\)
(m)
\(\int e^{3x}\sin(e^x)\,dx\)
Hint.
let \(u=e^x\text{,}\) leads to \(\int u^2\sin u\,du\text{;}\) cyclic IBP
Answer.
\(-e^{2x}\cos(e^x)+2e^x\sin(e^x)+2\cos(e^x)+C\)
(n)
\(\int \sqrt{x}\sin^{-1}\brac{\sqrt{x}}\,dx\)
Hint.
let \(u=\sqrt{x}\text{,}\) leads to \(\int 2u^2\arcsin u\,du\)
Answer.
\(\frac{2}{3}x\sqrt{x}\sin^{-1}\brac{\sqrt{x}}+\frac{2}{9}x\sqrt{1-x}+\frac{4}{9}\sqrt{1-x}+C\)

Checkpoint 6.4.13. Evaluating \(\int x^3\cos(nx)\,dx\).

Evaluate \(\int x^3\cos(nx)\,dx\text{,}\) where \(n\) is a constant, \(n \neq 0\text{.}\)
Answer.
\(\frac{1}{n} x^3\sin(nx)+\frac{3}{n^2}x^2\cos(nx)-\frac{6}{n^3}x\sin(nx)-\frac{6}{n^4}\cos(nx)+C\)

Checkpoint 6.4.14. Particle Velocity.

A particle has velocity \(v(t)=t^2e^{-4t}\) m/s. Find the distance traveled from time 0 to time \(t\text{.}\)
Answer.
\(\frac{1}{32}-\frac{1}{4}t^2e^{-4t}-\frac{1}{8}te^{-4t}-\frac{1}{32}e^{-4t}\) m

Exercise Group 6.4.14. Definite Integrals.

Evaluate each definite integral.
(a)
\(\int_{-\pi/2}^{\pi/2} x^3\sin x\,dx\)
Answer.
\(\frac{3\pi^2}{2}-12\)
(b)
\(\int_0^{\pi/3} \sin x\ln(\cos x)\,dx\)
Answer.
\(\frac{\ln 2-1}{2}\)
(c)
\(\int_0^{\pi/2} x^3\cos(2x)\,dx\)
Answer.
\(\frac{3}{4}-\frac{3\pi^2}{16}\)
(d)
\(\int_{2/\sqrt{3}}^2 x\sec^{-1}x\,dx\)
Answer.
\(\frac{5\pi}{9}-\frac{\sqrt{3}}{3}\)
(e)
\(\int_1^2 \frac{\ln x}{x^7}\,dx\)
Answer.
\(\frac{21-2\ln 2}{768}\)
(f)
\(\int_0^{1/\sqrt{2}} 2x\sin^{-1}(x^2)\,dx\)
Answer.
\(\frac{\pi}{12}+\frac{\sqrt{3}}{2}-1\)
(g)
\(\int_0^{\pi/3} x\tan^2 x\,dx\)
Answer.
\(\frac{\pi\sqrt{3}}{3}-\ln 2-\frac{\pi^2}{18}\)
(h)
\(\int_1^{\sqrt{3}} \arctan\brac{\frac{1}{x}} \,dx\)
Answer.
\(\frac{\pi(2\sqrt{3}-3)}{12}+\frac{\ln 2}{2}\)

Exercise Group 6.4.15. Special Tricks.

Evaluate each integral.
(a)
\(\int (1+2x^2)e^{x^2}\,dx\)
Hint.
split the integral as \(\int e^{x^2} \,dx + \int 2x^2 e^{x^2} \,dx\text{,}\) then use integration by parts on the 2nd integral
Answer.
\(xe^{x^2}+C\)
(b)
\(\int \frac{xe^x}{(x+1)^2}\,dx\)
Hint.
let \(u=xe^x\) and \(dv=\frac{1}{(x+1)^2}\,dx\)
Answer.
\(\frac{e^x}{x+1}+C\)
(c)
\(\int \frac{xe^{2x}}{(1+2x)^2}\,dx\)
Hint.
let \(u=xe^{2x}\) and \(dv=\frac{1}{(1+2x)^2}\,dx\)
Answer.
\(\frac{e^{2x}}{4}-\frac{xe^{2x}}{2(2x+1)}+C\) or \(\frac{e^{2x}}{4(2x+1)}+C\)