Integration By Parts

Integration by parts is the product rule of differentiation read backwards. It converts an integral u d v into u v v d u , and the whole art of the method lies in splitting the integrand so that the new integral is easier than the old one.

Item Statement
The formula u d v = u v v d u
Goal v d u should be easier than u d v
Choose u The factor that gets simpler when differentiated
Choose d v The factor you can integrate (always include d x )
LIATE priority for u Logarithmic, Inverse trigonometric, Algebraic, Trigonometric, Exponential
ln x d x x ln x x + C
arctan x d x x arctan x ln 1 + x 2 + C
arcsin x d x x arcsin x + 1 x 2 + C
sec 3 x d x 1 2 sec x tan x + 1 2 ln | sec x + tan x | + C
e x sin x d x 1 2 e x ( sin x cos x ) + C
Repeated parts Use a tabular layout when one factor differentiates down to zero

Deriving the Formula

A powerful technique of integration is integration by parts, which hangs on the formula for the differential of a product. Let u and v be two functions of x . Then

d ( u v ) = u d v + v d u .

Taking v d u to the other side, we get

u d v = d ( u v ) v d u .

Integrating both sides, we have

u d v = d ( u v ) v d u .

Since d ( u v ) = u v + C , we get

\bbox[8px, #E6F0FA, border: 3px solid #0066CC]{\int u\,dv=uv-\int v\,du.}\tag{a}

Because we have to add a constant when we integrate v d u , we can ignore the constant of integration C when we integrate d ( u v ) .

In words, formula (a) says: to integrate a product, integrate one factor and differentiate the other, then subtract the integral of the result. You have not solved the problem; you have traded it for a different one. The method pays off only when the trade is favorable.

When we choose expressions for u and d v , we usually want:

d v to be an expression that can be easily integrated, u to be a function that has a simpler derivative, and v d u to be easier than u d v .

Example 1.

Evaluate ln x d x .

Solution

Obviously we cannot put u = 1 and d v = ln x d x because we do not know how to find v in this case. So we are left with one option:

u = ln x and d v = d x .

Then

u = ln x d u = 1 x d x d v = d x v = d x = x + C 1 .

Integration by parts gives

\begin{aligned} \int\overbrace{\ln x}^{u}\overbrace{dx}^{dv} &= \overbrace{(x+C_{1})\ln x}^{uv}-\int\overbrace{(x+C_{1})}^{v}\overbrace{\frac{1}{x}\,dx}^{du}\\ &= x\ln x+C_{1}\ln x-\int dx-\int\frac{C_{1}}{x}\,dx\\ &= x\ln x+C_{1}\ln x-x-C_{1}\ln|x|+C_{2}\\ &= x\ln x-x+C_{2}. \end{aligned}

Because the integrand, ln x , makes sense only if x > 0 , on the right-hand side we have ln | x | = ln x , and the two C 1 terms cancel.

  • In the above example, we see that the constant of integration C 1 used when determining v as d v does not appear in the final result. This is, in general, true, for if we write v + C 1 in place of v in formula (a), then we have \begin{aligned} \int u\,dv &= u(v+C_{1})-\int(v+C_{1})\,du\\ &= uv+C_{1}u-C_{1}u-\int v\,du\\ &= uv-\int v\,du. \end{aligned}

    So we do not need the most general v , and some v suffices. However, occasionally taking C 1 equal to some specific constant can simplify the calculations, as we shall see below.

How to Choose u and dv

  1. Identify u and d v . It is often successful if we choose for u the function in the integrand whose type appears earlier in the LIATE list. LIATE is an acronym that stands for
    1. Logarithmic functions (like ln x )
    2. Inverse trigonometric functions (like arcsin x )
    3. Algebraic functions (like 3 x 2 + 7 )
    4. Trigonometric functions (like sin x )
    5. Exponential functions (like e a x )
    After choosing u , whatever is left is d v .
  2. Compute d u and v .
  3. Apply formula (a) to evaluate the integral.

The LIATE rule is due to H. E. Kasube, "A technique for integration by parts," The American Mathematical Monthly 90.3 (1983): 210-211.

  • Note that d x is always part of d v .
Why the LIATE strategy for u works

Recall that, generally speaking, we choose u and d v so that u becomes simpler when differentiated and d v can be easily integrated. The derivatives of logarithmic and inverse trigonometric functions are algebraic functions, which are much simpler to work with. Also, we do not know how to integrate them directly, so they cannot be chosen as part of d v . Therefore, logarithmic and inverse trigonometric functions are natural choices for u . For example, the derivative of ln x is simply 1 / x and the derivative of arctan x is 1 / ( 1 + x 2 ) , but integrating ln x or arctan x directly is not straightforward.

Next in the LIATE list are algebraic functions. On one hand, the derivative of an algebraic function is another algebraic function, and it is often simpler. For example, the derivative of x is simply 1 . On the other hand, the integral of an algebraic function is sometimes non-algebraic. For example, 1 1 + x 2 d x = arctan x + C . So we generally prefer to differentiate algebraic functions rather than integrate them. The last choices for u are trigonometric and exponential functions, because the derivative of a trigonometric function is another trigonometric function, and the derivative of an exponential function remains exponential.

Basic Worked Examples

Example 2.

Evaluate x sin x d x .

Solution

In LIATE, Algebraic comes before Trigonometric, so the strategy suggests that we should let

u = x , and d v = sin x d x .

Then

d u = d x , and v = cos x .

Integration by parts yields

\begin{aligned} \int x\sin x\,dx &= \underbrace{-x\cos x}_{uv}-\int\underbrace{(-\cos x)\,dx}_{v\,du}\\ &= -x\cos x+\sin x+C. \end{aligned}

The trade was favorable: the new integral cos x d x has no x in front of it at all.

Example 3.

Evaluate x ln x d x .

Solution

Method 1. According to the LIATE strategy, the priority for choosing u is logarithmic functions. So we let

u = ln x , d v = x d x .

Then

d u = 1 x d x , v = 1 2 x 2 .

Integration by parts gives

\begin{aligned} \int x\ln x\,dx &= \overbrace{\frac{1}{2}x^{2}\ln x}^{uv}-\int\overbrace{\frac{1}{2}x^{2}}^{v}\overbrace{\frac{dx}{x}}^{du}\\ &= \frac{1}{2}x^{2}\ln x-\frac{1}{4}x^{2}+C. \end{aligned}

Method 2. Let

u = x and d v = ln x d x .

Then

u = x d u = d x d v = ln x d x v = x ln x x (from the first example of this section) .

Integrating by parts, we obtain

\begin{aligned} \int x\ln x\,dx &= x(x\ln x-x)-\int(x\ln x-x)\,dx\\ &= x^{2}\ln x-x^{2}-\int x\ln x\,dx+\underbrace{\int x\,dx}_{\frac{x^{2}}{2}+C}. \end{aligned}

Here x ln x d x appears both on the right and left hand sides. Thus

2 x ln x d x = x 2 ln x x 2 + 1 2 x 2 + C

Finally

x ln x d x = 1 2 x 2 ln x 1 4 x 2 + C 1 ,

where C 1 = C / 2 . Obviously the first method is easier, as in the second method we need to use integration by parts twice.

Example 4.

Evaluate arctan x d x .

Solution

Obviously we cannot put u = 1 and d v = arctan x d x because we do not know how to find v in this case. So we have to let

u = arctan x , d v = d x .

Then

d u = 1 1 + x 2 d x , v = x .

Therefore,

arctan x d x = x arctan x u v x 1 + x 2 d x .

To evaluate the last integral, we put t = 1 + x 2 . Then d t = 2 x d x , and

\begin{aligned} \int\frac{x}{1+x^{2}}\,dx &= \int\frac{1}{t}\frac{dt}{2}\\ &= \frac{1}{2}\ln|t|+C\\ &= \frac{1}{2}\ln(1+x^{2})+C &&{\small(t=1+x^{2}>0)}\\ &= \ln\sqrt{1+x^{2}}+C. \end{aligned}

Finally

arctan x d x = x arctan x ln 1 + x 2 + C 1 ,

where C 1 = C .

Example 5.

Evaluate arcsin x d x .

Solution

Similar to the previous example, we let

u = arcsin x , d v = d x .

Then

d u = 1 1 x 2 d x , v = x .

Therefore,

arcsin x d x = arcsin x   x u v x v 1 1 x 2 d x d u .

To evaluate x 1 x 2 d x , because 1 2 d d x ( 1 x 2 ) = x appears in the numerator, we let t = 1 x 2 . Then d t = 2 x d x and

\begin{aligned} \int\frac{x}{\sqrt{1-x^{2}}}\,dx &= \int\frac{\overbrace{-\frac{1}{2}\,dt}^{x\,dx}}{\sqrt{t}}\\ &= \int-\frac{1}{2}t^{-1/2}\,dt\\ &= \frac{-1}{2}\left(2t^{1/2}\right)+C\\ &= -\sqrt{1-x^{2}}+C. &&{\small(t=1-x^{2})} \end{aligned}

Finally

\begin{aligned} \int\arcsin x\,dx &= x\arcsin x-\left(-\sqrt{1-x^{2}}+C\right)\\ &= x\arcsin x+\sqrt{1-x^{2}}+C_{1}, \end{aligned}

where C 1 = C .

Choosing the Constant in v Wisely

We showed above that any antiderivative v works. The next two examples show that a clever choice of that constant can simplify the second integral dramatically.

Example 6.

Evaluate x tan 1 x d x . (Notice that tan 1 x is the same as arctan x .)

Solution

The LIATE strategy suggests that we let

u = tan 1 x , d v = x d x .

Notice that because it is easy to differentiate tan 1 x but hard to integrate it, and also because its derivative is algebraic, it is the best choice for u . So

d u = 1 1 + x 2 d x , v = 1 2 x 2

and

\begin{aligned} \int x\tan^{-1}x\,dx &= \overbrace{\frac{1}{2}x^{2}\tan^{-1}x}^{uv}-\int\overbrace{\frac{x^{2}}{2(1+x^{2})}\,dx}^{v\,du}\\ &= \frac{1}{2}x^{2}\tan^{-1}x-\frac{1}{2}\int\frac{(1+x^{2})-1}{1+x^{2}}\,dx\\ &= \frac{1}{2}x^{2}\tan^{-1}x-\frac{1}{2}\int dx+\frac{1}{2}\int\frac{dx}{1+x^{2}}\\ &= \frac{1}{2}x^{2}\tan^{-1}x-\frac{1}{2}x+\frac{1}{2}\tan^{-1}x+C\\ &= \frac{1}{2}(x^{2}+1)\tan^{-1}x-\frac{1}{2}x+C. \end{aligned}

The same result is obtained more quickly if we take

v = 1 2 x 2 + C 1 .

Then integration by parts gives

x tan 1 x d x = ( 1 2 x 2 + C 1 ) tan 1 x 1 2 x 2 + C 1 1 + x 2 d x .

Now taking C 1 = 1 / 2 makes the numerator of the last integrand equal to 1 2 ( x 2 + 1 ) , which cancels the denominator entirely:

\begin{aligned} \int x\tan^{-1}x\,dx &= \frac{1}{2}\left(x^{2}+1\right)\tan^{-1}x-\frac{1}{2}\int\frac{x^{2}+1}{1+x^{2}}\,dx\\ &= \frac{1}{2}\left(x^{2}+1\right)\tan^{-1}x-\frac{1}{2}\int dx\\ &= \frac{1}{2}\left(x^{2}+1\right)\tan^{-1}x-\frac{1}{2}x+C. \end{aligned}
Example 7.

Evaluate tan 1 x d x .

Solution

Let

u = tan 1 x , and d v = d x .

Then

d u = 1 1 + ( x ) 2 1 2 x d x , and v = x + C 1

and

tan 1 x d x = ( x + C 1 ) tan 1 x ( x + C 1 ) 1 1 + x 1 2 x d x .

Taking C 1 = 1 makes x + C 1 = 1 + x cancel the factor 1 1 + x , which simplifies the second integral. So

\begin{aligned} \int\tan^{-1}\sqrt{x}\,dx &= (x+1)\tan^{-1}\sqrt{x}-\int\frac{1}{2\sqrt{x}}\,dx\\ &= (x+1)\tan^{-1}\sqrt{x}-\sqrt{x}+C. \end{aligned}

Further Examples

Example 8.

Evaluate x cos 2 x d x .

Solution

Because we can easily integrate 1 cos 2 x = sec 2 x , we let

u = x , d v = 1 cos 2 x d x = sec 2 x   d x .

Notice that this choice for u agrees with the LIATE strategy. So

u = x d u = d x d v = sec 2 x   d x v = tan x ,

and

x cos 2 x d x = x tan x u v tan x v d x d u .

We know

\begin{aligned} \int\tan x\,dx &= \int\frac{\sin x}{\cos x}\,dx\\ &= -\int\frac{d(\cos x)}{\cos x}\\ &= -\ln|\cos x|+C, \end{aligned}

so

\begin{aligned} \int\frac{x}{\cos^{2}x}\,dx &= x\tan x-\left(-\ln|\cos x|+C\right)\\ &= x\tan x+\ln|\cos x|+C_{1}, \end{aligned}

with C 1 = C .

Example 9.

Apply integration by parts to evaluate a 2 x 2 d x .

Solution

Let

u = a 2 x 2 , d v = d x .

Then

d u = 1 2 a 2 x 2 d d x ( a 2 x 2 ) d x = x a 2 x 2 d x , v = x .

Integration by parts gives

a 2 x 2 u d x d v = x a 2 x 2 u v x 2 a 2 x 2 d x v d u .

We may write

\begin{aligned} \frac{x^{2}}{\sqrt{a^{2}-x^{2}}} &= -\frac{a^{2}-x^{2}}{\sqrt{a^{2}-x^{2}}}+\frac{a^{2}}{\sqrt{a^{2}-x^{2}}}\\ &= -\sqrt{a^{2}-x^{2}}+\frac{a^{2}}{\sqrt{a^{2}-x^{2}}}. \end{aligned}

We have therefore

\begin{aligned} \int\sqrt{a^{2}-x^{2}}\,dx &= x\sqrt{a^{2}-x^{2}}+\int\left(-\sqrt{a^{2}-x^{2}}+\frac{a^{2}}{\sqrt{a^{2}-x^{2}}}\right)\,dx\\ &= x\sqrt{a^{2}-x^{2}}-\int\sqrt{a^{2}-x^{2}}\,dx+a^{2}\int\frac{d\left(\frac{x}{a}\right)}{\sqrt{1-\left(\frac{x}{a}\right)^{2}}}. \end{aligned}

The last integral is arcsin x a , by the inverse substitution x / a = sin t from the previous chapter. The original integral now appears on both sides, so we solve for it:

2 a 2 x 2 d x = x a 2 x 2 + a 2 arcsin ( x a )

and

a 2 x 2 d x = 1 2 x a 2 x 2 + a 2 2 arcsin ( x a ) + C .
Example 10.

Evaluate x ln x d x .

Solution

The LIATE strategy suggests that we let

u = ln x and d v = x d x .

So

d u = 1 x d x v = x d x = 2 3 x 3 / 2

and

\begin{aligned} \int\overbrace{\ln x}^{u}\overbrace{\sqrt{x}\,dx}^{dv} &= \overbrace{\frac{2}{3}x^{3/2}\ln x}^{uv}-\int\overbrace{\frac{2}{3}x^{3/2}}^{v}\overbrace{x^{-1}\,dx}^{du}\\ &= \frac{2}{3}x^{3/2}\ln x-\frac{2}{3}\int x^{1/2}\,dx\\ &= \frac{2}{3}x^{3/2}\ln x-\frac{4}{9}x^{3/2}+C. \end{aligned}

Substitution First, Then Parts

  • Sometimes we need to use integration by substitution first, and then apply integration by parts.
Example 11.

Evaluate sin x d x .

Solution

Let θ = x . Then

d θ = 1 2 x d x or 2 x θ d θ = d x .

Therefore,

\begin{aligned} \int\sin\sqrt{x}\:dx &= \int\sin\theta\underbrace{2\theta\,d\theta}_{dx}\\ &= 2\int\theta\sin\theta\,d\theta. \end{aligned}

In an earlier example, we learned that x sin x d x = x cos x + sin x + C . Therefore,

\begin{aligned} \int\sin\sqrt{x}\,dx &= 2\left(-\theta\cos\theta+\sin\theta\right)+C_{1}\\ &= -2\sqrt{x}\cos\sqrt{x}+2\sin\sqrt{x}+C_{1}. &&{\small(\theta=\sqrt{x})} \end{aligned}
Example 12.

Evaluate arctan x d x .

Solution

Let t = x . Then

d t = 1 2 x d x ,

or

d x = 2 x d t = 2 t d t .

Therefore,

arctan x d x = 2 t arctan t d t .

We had already obtained the second integral above. So

\begin{aligned} \int\arctan\sqrt{x}\,dx &= 2\int t\arctan t\,dt\\ &= 2\left[\frac{1}{2}\left(t^{2}+1\right)\arctan t-\frac{1}{2}t\right]+C\\ &= (x+1)\arctan\sqrt{x}-\sqrt{x}+C. \end{aligned}

This agrees with the result obtained earlier by choosing the constant in v cleverly.

When the Integrand Is Purely Algebraic

To evaluate f ( x ) d x using integration by parts, the LIATE strategy fails when f ( x ) is an algebraic function (because all we have is algebraic). However, if we can decompose f ( x ) d x into two factors P ( x ) and Q ( x ) d x such that we can integrate Q ( x ) d x , we may set u = P ( x ) and d v = Q ( x ) d x and try integration by parts.

The following shows two examples of such situations.

Example 13.

Evaluate x 3 a 2 + x 2 d x .

Solution

This may be divided into two factors

u = x 2 d v = x a 2 + x 2 d x ,

of which the second can be integrated, because the extra factor of x is what the substitution needs:

\begin{aligned} \int x\sqrt{a^{2}+x^{2}}\,dx &= \int\sqrt{z}\overbrace{\frac{1}{2}\,dz}^{x\,dx} &&{\small(z=a^{2}+x^{2})}\\ &= \frac{1}{2}\cdot\frac{2}{3}z^{3/2}+C_{1}\\ &= \frac{1}{3}(a^{2}+x^{2})^{3/2}+C_{1}. \end{aligned}

So

u = x 2 d u = 2 x d x d v = x a 2 + x 2 d x v = 1 3 ( a 2 + x 2 ) 3 2

and

x 3 a 2 + x 2 d x = 1 3 x 2 ( a 2 + x 2 ) 3 2 u v 2 3 x ( a 2 + x 2 ) 3 2 d x v d u .

We can integrate the last one by substitution. Let t = a 2 + x 2 . Then d t = 2 x d x and

\begin{aligned} \frac{2}{3}\int x(a^{2}+x^{2})^{\frac{3}{2}}\,dx &= \frac{2}{3}\int t^{\frac{3}{2}}\cdot\overbrace{\frac{1}{2}\,dt}^{x\,dx}\\ &= \frac{1}{3}\cdot\frac{2}{5}t^{5/2}+K\\ &= \frac{2}{15}(a^{2}+x^{2})^{\frac{5}{2}}+K. \end{aligned}

Finally

x 3 a 2 + x 2 d x = 1 3 x 2 ( a 2 + x 2 ) 3 2 2 15 ( a 2 + x 2 ) 5 2 + C .
Example 14.

Evaluate x 2 ( a 2 x 2 ) 3 2 d x ( a > 0 ).

Solution

We may try

u = x , d v = x ( a 2 x 2 ) 3 2 d x ,

because we can integrate d v by making the substitution z = a 2 x 2 and d z = 2 x d x :

\begin{aligned} \int\frac{x}{(a^{2}-x^{2})^{\frac{3}{2}}}\,dx &= \int\frac{-dz}{2z^{\frac{3}{2}}}=-\frac{1}{2}\int z^{-\frac{3}{2}}\,dz\\ &= -\frac{1}{2}(-2)z^{-\frac{1}{2}}+C_{1}\\ &= \frac{1}{\sqrt{z}}+C_{1}\\ &= \frac{1}{\sqrt{a^{2}-x^{2}}}+C_{1}. \end{aligned}

So

u = x d u = d x d v = x ( a 2 x 2 ) 3 2 d x v = 1 a 2 x 2 ,

and

x 2 ( a 2 x 2 ) 3 2 d x = x a 2 x 2 u v 1 a 2 x 2 v d x d u .

Because

\begin{aligned} \int\frac{1}{\sqrt{a^{2}-x^{2}}}\,dx &= \frac{1}{a}\int\frac{1}{\sqrt{1-\left(\dfrac{x}{a}\right)^{2}}}\,dx\\ &= \frac{1}{a}\int\frac{\overbrace{a\,dt}^{dx}}{\sqrt{1-t^{2}}} &&{\small\left(t=\frac{x}{a},\ dt=\frac{1}{a}\,dx\right)}\\ &= \arcsin t+K\\ &= \arcsin\frac{x}{a}+K, \end{aligned}

we get

x 2 ( a 2 x 2 ) 3 2 d x = x a 2 x 2 arcsin x a + C ,

where C = K .

Tabular Integration by Parts

Consider an integral of the form

f ( x ) g ( x ) d x ,

where f ( x ) can be differentiated repeatedly until its derivative becomes zero and g ( x ) is a function that can be integrated repeatedly without difficulty. Such an integral can be evaluated by integration by parts. However, we may need to repeat integration by parts several times, which can be cumbersome. To organize the calculations and to expedite this process, we make a two-column table. In one column we write f ( x ) and its derivatives, and in one column we write g ( x ) and its integrals, then we multiply these and add them together in a fashion that is illustrated in the following examples.

The Tabular Method. List f and its successive derivatives in the left column, and g and its successive integrals in the right column. Then multiply each entry of the left column by the entry one row below it in the right column, and attach alternating signs + , , + , , starting with + . Stop when the left column reaches 0 . In the diagrams below, each diagonal arrow marks one such product and carries its sign.

Example 15.

Evaluate x 2 sin x   d x .

Solution

Let f ( x ) = x 2 and g ( x ) = sin x .

TikZ figure

Each arrow gives one product: multiply the entry at its tail by the entry at its head, and attach the sign written on the arrow. Adding these products,

\begin{aligned} \int x^{2}\sin x\,dx &= (+)\,x^{2}(-\cos x)+(-)\,2x(-\sin x)+(+)\,2(\cos x)+C\\ &= -x^{2}\cos x+2x\sin x+2\cos x+C. \end{aligned}

In the end, don't forget to add C as the constant of integration.

Example 16.

Evaluate x 3 e x d x .

Solution

Let f ( x ) = x 3 and g ( x ) = e x . Since e x is its own integral, the right column never changes.

TikZ figure

Reading off the four arrows in order,

x 3 e x d x = x 3 e x 3 x 2 e x + 6 x e x 6 e x + C .
Example 17.

Evaluate x 3 1 + x d x .

Solution

Let f ( x ) = x 3 and g ( x ) = 1 + x , because the higher derivatives of f ( x ) become zero and we can easily integrate g ( x ) as many times as we wish.

TikZ figure

Therefore,

\begin{aligned} \int x^{3}\sqrt{1+x}\,dx &= \frac{2}{3}x^{3}(1+x)^{3/2}-\frac{4}{5}x^{2}(1+x)^{5/2}\\ &\qquad+\frac{16}{35}x(1+x)^{7/2}-\frac{32}{315}(1+x)^{9/2}+C. \end{aligned}

For instance, the second term comes from 3 x 2 2 3 ( 1 + x ) 5 / 2 2 5 = 4 5 x 2 ( 1 + x ) 5 / 2 , since 3 4 15 = 4 5 .

Solving for an Unknown Integral

Sometimes to evaluate an integral, we need to integrate by parts twice and then solve for the unknown integral.

Example 18.

Evaluate e x sin x d x .

Solution

Let

u = sin x , d v = e x d x ;

then

d u = cos x d x , v = e x .

Integration by parts produces

\int\overbrace{\sin x}^{u}\overbrace{e^{x}\,dx}^{dv}=\overbrace{\sin x\,e^{x}}^{uv}-\int\overbrace{e^{x}}^{v}\overbrace{\cos x\:dx}^{du}.\tag{i}

The last integral is similar to the original integral, except it has cos x instead of sin x . To find this integral, we need to integrate by parts with

U = cos x , d V = e x d x .

So

d U = sin x d x , V = e x

and

\int\overbrace{\cos x}^{U}\overbrace{e^{x}\,dx}^{dV}=\overbrace{\cos x\:e^{x}}^{UV}-\int\overbrace{e^{x}}^{V}\overbrace{(-\sin x)\,dx}^{dU}.\tag{ii}

Substituting (ii) in (i) yields

sin x e x d x = e x sin x e x cos x sin x e x d x .

Here the original integral appears on the left and the right hand sides.

2 e x sin x d x = e x cos x + e x sin x + C 1 .

Here we add the constant of integration to cover all the possible integral functions (or antiderivatives). Finally

e x sin x d x = 1 2 e x ( sin x cos x ) + C 2 ,

with C 2 = C 1 / 2 .

Notice that we could start with u = e x and d v = sin x d x :

u = e x , d v = sin x d x ;

then

d u = e x d x , v = cos x

so that

\int e^{x}\sin x\,dx=-e^{x}\cos x-\int(-\cos x)e^{x}\,dx.\tag{i}

The last integral is like the original integral, except it has cos x instead of sin x . To find this integral, we need to integrate by parts with

U = e x , d V = cos x d x .

Therefore,

d U = e x d x , V = sin x

and

\int\cos x\,e^{x}\,dx=e^{x}\sin x-\int\sin x\,e^{x}\,dx.\tag{ii}

Substituting (ii) in (i), we get

e x sin x d x = e x cos x + e x sin x e x sin x d x .

Here the original integral appears on the left and the right hand sides.

2 e x sin x d x = e x cos x + e x sin x + C 1 .

Finally

e x sin x d x = 1 2 e x cos x + 1 2 e x sin x + C 2 ,

with C 2 = C 1 / 2 . The important point is that both choices work, provided you stay consistent: if you differentiate sin x on the first pass, you must differentiate cos x on the second. Switching roles halfway returns you to the trivial identity I = I .

  • Sometimes, we need to combine integration by parts and integration by substitution, and then solve for the unknown function.
Example 19.

Evaluate sec 3 x d x .

Solution

This may be divided into two factors

u = sec x , d v = sec 2 x d x .

Here u can be easily differentiated, and d v can be easily integrated. So

d u = sec x tan x d x , v = tan x ,

and

sec 3 x d x = sec x   tan x u v tan 2 x sec x d x v d u .

Because 1 + tan 2 x = sec 2 x , we have

\begin{aligned} \int\sec^{3}x\,dx &= \sec x\,\tan x-\int(\sec^{2}x-1)\sec x\,dx\\ &= \sec x\,\tan x-\int\sec^{3}x\,dx+\int\sec x\,dx, \end{aligned}

or

2 sec 3 x d x = sec x tan x + sec x d x .

We previously showed that

sec x d x = ln | sec x + tan x | + K .

Therefore,

sec 3 x d x = 1 2 sec x tan x + 1 2 ln | sec x + tan x | + C .
Example 20.

Find sin x ln ( tan x ) d x .

Solution

We can evaluate this integral using the method of integration by parts:

u d v = u v v d u \begin{aligned} u &= \ln(\tan x) &&dv= \sin x \, dx \\ du &= \frac{\sec^2 x}{\tan x} \, dx = \frac{1}{\sin x \cos x} \, dx && v= -\cos x \end{aligned}
Finding d u in more detail

To derive d u from u = ln ( tan x ) , we apply the chain rule followed by basic trigonometric simplification:

d u = 1 tan x d d x ( tan x ) d x d u = cos x sin x sec 2 x d x d u = cos x sin x 1 cos 2 x d x

Canceling one cos x from the numerator and denominator gives

d u = 1 sin x cos x d x .

Applying the integration by parts formula yields

\begin{aligned} \int \sin x \ln(\tan x) \, dx &= -\cos x \ln(\tan x) - \int (-\cos x) \left( \frac{1}{\sin x \cos x} \right) \, dx \\ &= -\cos x \ln(\tan x) + \int \frac{1}{\sin x} \, dx \\ &= -\cos x \ln(\tan x) + \int \csc x \, dx. \end{aligned}

Using the integral of csc x evaluated in the previous section, csc x d x = ln | csc x + cot x | + C , we obtain

sin x ln ( tan x ) d x = cos x ln ( tan x ) ln | csc x + cot x | + C .

Exercises

Each of the following can be done with the basic formulas, the substitution rule, the trigonometric integrals of the previous section, and integration by parts. No other technique is needed.

Exercise 1.

Evaluate x e x d x .

Solution

By LIATE, Algebraic precedes Exponential, so let u = x and d v = e x d x . Then d u = d x and v = e x , so

\begin{aligned} \int x e^{x}\,dx &= xe^{x}-\int e^{x}\,dx\\ &= xe^{x}-e^{x}+C\\ &= e^{x}(x-1)+C. \end{aligned}
Exercise 2.

Evaluate x cos x d x .

Solution

Let u = x and d v = cos x d x . Then d u = d x and v = sin x :

\begin{aligned} \int x\cos x\,dx &= x\sin x-\int\sin x\,dx\\ &= x\sin x+\cos x+C. \end{aligned}
Exercise 3.

Evaluate x 2 e x d x using the tabular method.

Solution

Let f ( x ) = x 2 and g ( x ) = e x . Each integration of e x brings out a factor of 1 .

TikZ figure

Therefore

\begin{aligned} \int x^{2}e^{-x}\,dx &= x^{2}(-e^{-x})-2x\left(e^{-x}\right)+2\left(-e^{-x}\right)+C\\ &= -e^{-x}\left(x^{2}+2x+2\right)+C. \end{aligned}
Exercise 4.

Evaluate x 2 ln x d x .

Solution

By LIATE, let u = ln x and d v = x 2 d x . Then d u = d x x and v = x 3 3 :

\begin{aligned} \int x^{2}\ln x\,dx &= \frac{x^{3}}{3}\ln x-\int\frac{x^{3}}{3}\cdot\frac{dx}{x}\\ &= \frac{x^{3}}{3}\ln x-\frac{1}{3}\int x^{2}\,dx\\ &= \frac{x^{3}}{3}\ln x-\frac{x^{3}}{9}+C. \end{aligned}
Exercise 5.

Evaluate ( ln x ) 2 d x .

Solution

Let u = ( ln x ) 2 and d v = d x . Then d u = 2 ln x x d x and v = x :

\begin{aligned} \int(\ln x)^{2}\,dx &= x(\ln x)^{2}-\int x\cdot\frac{2\ln x}{x}\,dx\\ &= x(\ln x)^{2}-2\int\ln x\,dx. \end{aligned}

We already know ln x d x = x ln x x + C , so

( ln x ) 2 d x = x ( ln x ) 2 2 x ln x + 2 x + C .
Exercise 6.

Evaluate ln x x 2 d x .

Solution

Let u = ln x and d v = x 2 d x . Then d u = d x x and v = 1 x :

\begin{aligned} \int\frac{\ln x}{x^{2}}\,dx &= -\frac{\ln x}{x}+\int\frac{1}{x}\cdot\frac{dx}{x}\\ &= -\frac{\ln x}{x}+\int x^{-2}\,dx\\ &= -\frac{\ln x}{x}-\frac{1}{x}+C. \end{aligned}
Exercise 7.

Evaluate ln ( x 2 + 1 ) d x .

Solution

Let u = ln ( x 2 + 1 ) and d v = d x . Then d u = 2 x x 2 + 1 d x and v = x :

ln ( x 2 + 1 ) d x = x ln ( x 2 + 1 ) 2 x 2 x 2 + 1 d x .

Write x 2 x 2 + 1 = ( x 2 + 1 ) 1 x 2 + 1 = 1 1 x 2 + 1 , so

\begin{aligned} \int\frac{x^{2}}{x^{2}+1}\,dx &= \int dx-\int\frac{dx}{x^{2}+1}\\ &= x-\arctan x+C. \end{aligned}

Therefore

ln ( x 2 + 1 ) d x = x ln ( x 2 + 1 ) 2 x + 2 arctan x + C .
Exercise 8.

Evaluate arccos x d x .

Solution

Let u = arccos x and d v = d x . Then d u = 1 1 x 2 d x and v = x :

arccos x d x = x arccos x + x 1 x 2 d x .

With t = 1 x 2 and d t = 2 x d x , the last integral is

x 1 x 2 d x = 1 2 t 1 / 2 d t = 1 x 2 + C .

Therefore

arccos x d x = x arccos x 1 x 2 + C .
Exercise 9.

Evaluate x csc 2 x d x .

Solution

Let u = x and d v = csc 2 x d x . Then d u = d x and v = cot x :

\begin{aligned} \int x\csc^{2}x\,dx &= -x\cot x+\int\cot x\,dx\\ &= -x\cot x+\ln|\sin x|+C, \end{aligned}

using the formula cot x d x = ln | sin x | + C from the previous section.

Exercise 10.

Evaluate e x cos x d x .

Solution

Let u = cos x and d v = e x d x , so d u = sin x d x and v = e x :

e x cos x d x = e x cos x + e x sin x d x .

Integrate by parts again, this time with U = sin x and d V = e x d x :

e x sin x d x = e x sin x e x cos x d x .

Substituting,

e x cos x d x = e x cos x + e x sin x e x cos x d x ,

so

2 e x cos x d x = e x ( cos x + sin x ) + C 1 e x cos x d x = 1 2 e x ( cos x + sin x ) + C .
Exercise 11.

Evaluate e 2 x sin 3 x d x .

Solution

Let u = sin 3 x and d v = e 2 x d x , so d u = 3 cos 3 x d x and v = 1 2 e 2 x . Write I = e 2 x sin 3 x d x . Then

I = 1 2 e 2 x sin 3 x 3 2 e 2 x cos 3 x d x .

Apply parts again to the new integral with U = cos 3 x and d V = e 2 x d x , so d U = 3 sin 3 x d x and V = 1 2 e 2 x :

e 2 x cos 3 x d x = 1 2 e 2 x cos 3 x + 3 2 I .

Substituting back,

\begin{aligned} I &= \frac{1}{2}e^{2x}\sin 3x-\frac{3}{2}\left(\frac{1}{2}e^{2x}\cos 3x+\frac{3}{2}I\right)\\ &= \frac{1}{2}e^{2x}\sin 3x-\frac{3}{4}e^{2x}\cos 3x-\frac{9}{4}I. \end{aligned}

Collecting the I terms gives 13 4 I = 1 2 e 2 x sin 3 x 3 4 e 2 x cos 3 x , so

e 2 x sin 3 x d x = e 2 x 13 ( 2 sin 3 x 3 cos 3 x ) + C .
Exercise 12.

Evaluate x 2 cos 2 x d x using the tabular method.

Solution

Let f ( x ) = x 2 and g ( x ) = cos 2 x . Each integration of cos 2 x brings out a factor of 1 2 from the chain rule.

TikZ figure

Therefore

\begin{aligned} \int x^{2}\cos 2x\,dx &= \frac{x^{2}}{2}\sin 2x-2x\left(-\frac{1}{4}\cos 2x\right)+2\left(-\frac{1}{8}\sin 2x\right)+C\\ &= \frac{x^{2}}{2}\sin 2x+\frac{x}{2}\cos 2x-\frac{1}{4}\sin 2x+C. \end{aligned}
Exercise 13.

Evaluate x 2 1 + x d x using the tabular method.

Solution

Let f ( x ) = x 2 and g ( x ) = ( 1 + x ) 1 / 2 .

TikZ figure

Therefore

\begin{aligned} \int x^{2}\sqrt{1+x}\,dx &= \frac{2}{3}x^{2}(1+x)^{3/2}-2x\cdot\frac{4}{15}(1+x)^{5/2}\\ &\qquad+2\cdot\frac{8}{105}(1+x)^{7/2}+C\\ &= \frac{2}{3}x^{2}(1+x)^{3/2}-\frac{8}{15}x(1+x)^{5/2}\\ &\qquad+\frac{16}{105}(1+x)^{7/2}+C. \end{aligned}
Exercise 14.

Evaluate e x d x .

Solution

First substitute, then integrate by parts. Let t = x , so x = t 2 and d x = 2 t d t :

e x d x = 2 t e t d t .

From the first exercise of this set, t e t d t = e t ( t 1 ) + C . Therefore

\begin{aligned} \int e^{\sqrt{x}}\,dx &= 2e^{t}(t-1)+C\\ &= 2e^{\sqrt{x}}\left(\sqrt{x}-1\right)+C. \end{aligned}
Exercise 15.

Evaluate cos ( ln x ) d x .

Solution

Write I = cos ( ln x ) d x . Let u = cos ( ln x ) and d v = d x , so d u = sin ( ln x ) x d x and v = x :

I = x cos ( ln x ) + sin ( ln x ) d x .

Apply parts again with U = sin ( ln x ) , d V = d x , so d U = cos ( ln x ) x d x and V = x :

sin ( ln x ) d x = x sin ( ln x ) I .

Substituting,

I = x cos ( ln x ) + x sin ( ln x ) I ,

so

cos ( ln x ) d x = x 2 [ cos ( ln x ) + sin ( ln x ) ] + C .

The same computation, read from the second line, gives

sin ( ln x ) d x = x 2 [ sin ( ln x ) cos ( ln x ) ] + C .
Exercise 16.

Evaluate x arcsin x d x .

Solution

By LIATE, let u = arcsin x and d v = x d x . Rather than taking v = 1 2 x 2 , we exploit the freedom in the constant and take

v = x 2 1 2 ,

which makes the numerator of v d u divisible by 1 x 2 . With d u = d x 1 x 2 ,

x arcsin x d x = x 2 1 2 arcsin x x 2 1 2 1 x 2 d x .

Since x 2 1 = ( 1 x 2 ) , we have x 2 1 1 x 2 = 1 x 2 , so

x arcsin x d x = x 2 1 2 arcsin x + 1 2 1 x 2 d x .

We evaluated a 2 x 2 d x by parts earlier in this section. With a = 1 ,

1 x 2 d x = 1 2 x 1 x 2 + 1 2 arcsin x + C .

Therefore

\begin{aligned} \int x\arcsin x\,dx &= \frac{x^{2}-1}{2}\arcsin x+\frac{x\sqrt{1-x^{2}}}{4}+\frac{\arcsin x}{4}+C\\ &= \left(\frac{x^{2}}{2}-\frac{1}{4}\right)\arcsin x+\frac{x\sqrt{1-x^{2}}}{4}+C. \end{aligned}
Exercise 17.

Evaluate x sinh x d x .

Solution

Let u = x and d v = sinh x d x . Then d u = d x and v = cosh x , since d d x cosh x = sinh x :

\begin{aligned} \int x\sinh x\,dx &= x\cosh x-\int\cosh x\,dx\\ &= x\cosh x-\sinh x+C. \end{aligned}
Exercise 18.

Evaluate x 5 e x 2 d x .

Solution

Substitute first. Let t = x 2 , so d t = 2 x d x and x 5 d x = x 4 x d x = t 2 2 d t . Then

x 5 e x 2 d x = 1 2 t 2 e t d t .

Now use the tabular method with f ( t ) = t 2 and g ( t ) = e t :

TikZ figure

So t 2 e t d t = e t ( t 2 2 t + 2 ) + C , and therefore

x 5 e x 2 d x = 1 2 e x 2 ( x 4 2 x 2 + 2 ) + C .
Exercise 19.

Evaluate x 3 ln x d x .

Solution

Let u = ln x and d v = x 3 d x , so d u = d x x and v = x 4 4 :

\begin{aligned} \int x^{3}\ln x\,dx &= \frac{x^{4}}{4}\ln x-\frac{1}{4}\int x^{3}\,dx\\ &= \frac{x^{4}}{4}\ln x-\frac{x^{4}}{16}+C. \end{aligned}
Exercise 20.

Evaluate sin ( ln x ) d x directly, and check your answer by differentiation.

Solution

Write J = sin ( ln x ) d x . Take u = sin ( ln x ) and d v = d x , so d u = cos ( ln x ) x d x and v = x :

J = x sin ( ln x ) cos ( ln x ) d x .

Applying parts once more to cos ( ln x ) d x with U = cos ( ln x ) , d V = d x gives x cos ( ln x ) + J . Therefore

J = x sin ( ln x ) x cos ( ln x ) J , sin ( ln x ) d x = x 2 [ sin ( ln x ) cos ( ln x ) ] + C .

Check. Differentiating the result by the product rule,

\begin{aligned} \frac{d}{dx}&\left\{\frac{x}{2}\left[\sin(\ln x)-\cos(\ln x)\right]\right\}\\ &= \frac{1}{2}\left[\sin(\ln x)-\cos(\ln x)\right]+\frac{x}{2}\left[\frac{\cos(\ln x)}{x}+\frac{\sin(\ln x)}{x}\right]\\ &= \frac{\sin(\ln x)-\cos(\ln x)+\cos(\ln x)+\sin(\ln x)}{2}\\ &= \sin(\ln x), \end{aligned}

which is the original integrand.

Exercise 21.

Evaluate x sec 2 x d x and compare it with the example x cos 2 x d x solved above.

Solution

Since sec 2 x = 1 cos 2 x , this is the same integral written differently. Taking u = x and d v = sec 2 x d x gives d u = d x and v = tan x , so

\begin{aligned} \int x\sec^{2}x\,dx &= x\tan x-\int\tan x\,dx\\ &= x\tan x-\ln|\sec x|+C\\ &= x\tan x+\ln|\cos x|+C, \end{aligned}

which matches the earlier result, since ln | sec x | = ln | cos x | .