Skip to content

Integration by Parts in Definite Integrals

In indefinite integration, integration by parts reverses the Product Rule of differentiation, allowing us to integrate products of functions such as \(x e^x\), \(x^2 \sin x\), \(\ln x\), \(\tan^{-1} x\), and \(e^x \sin x\).

When evaluating a definite integral by parts over \([a, b]\), we do not need to find the complete indefinite integral first and plug in the limits at the very end. Instead, we can evaluate the "already integrated" product term at the boundaries \(a\) and \(b\) immediately, while simplifying the remaining integral!


1. The Integration by Parts Formula

Form 1: Product of First and Second Functions

Suppose we want to integrate the product of two functions \(f(x)\) (chosen as the First Function, to be differentiated) and \(g(x)\) (chosen as the Second Function, to be integrated) over the interval \([a, b]\).

Let \(G(x) = \int g(x) \, dx\) denote an antiderivative of the second function \(g(x)\), so that \(G'(x) = g(x)\).

By the Product Rule of differentiation, the derivative of the product \(f(x) \, G(x)\) is:

\[\frac{d}{dx} \Big[ f(x) \, G(x) \Big] = f(x) \, G'(x) + f'(x) \, G(x) = f(x) \, g(x) + f'(x) \, G(x)\]

Assuming \(f'(x)\) and \(g(x)\) are continuous on \([a, b]\), we integrate both sides with respect to \(x\) from \(a\) to \(b\):

\[\int_a^b \frac{d}{dx} \Big[ f(x) \, G(x) \Big] dx = \int_a^b f(x) \, g(x) \, dx + \int_a^b f'(x) \, G(x) \, dx\]

By the First Fundamental Theorem of Calculus, the left-hand side is simply \(\Big[ f(x) \, G(x) \Big]_a^b\). Rearranging for \(\int_a^b f(x) \, g(x) \, dx\) gives our fundamental formula:

[!IMPORTANT] Integration by Parts for Definite Integrals: If \(f(x)\) has a continuous derivative \(f'(x)\) on \([a, b]\) and \(g(x)\) is continuous on \([a, b]\) with antiderivative \(\int g(x) \, dx\), then:

\[\int_a^b f(x) \, g(x) \, dx = \left[ f(x) \int g(x) \, dx \right]_a^b - \int_a^b \left( f'(x) \int g(x) \, dx \right) dx\]

Form 2: Compact Differential Notation

If we write \(u = f(x)\) and \(dv = g(x) \, dx\) (so that \(du = f'(x) \, dx\) and \(v = \int g(x) \, dx\)), the formula takes the compact form:

\[\int_a^b u \, dv = \Big[ u \, v \Big]_a^b - \int_a^b v \, du\]

or equivalently, writing \(v = G(x)\) and \(v'(x) = g(x)\):

\[\int_a^b u(x) \, v'(x) \, dx = \Big[ u(x) \, v(x) \Big]_a^b - \int_a^b u'(x) \, v(x) \, dx\]

Choosing the First Function: The ILATE Priority Rule

To make the new integral \(\int_a^b f'(x) \left(\int g(x)\,dx\right) dx\) simpler than the original integral, we choose the First Function \(f(x)\) (the one we differentiate) according to the ILATE priority order:

  1. I — Inverse Trigonometric functions (\(\sin^{-1} x, \tan^{-1} x, \dots\))
  2. L — Logarithmic functions (\(\ln x, \log_a x, \dots\))
  3. A — Algebraic functions (\(x, x^2, 3x + 1, \dots\))
  4. T — Trigonometric functions (\(\sin x, \cos x, \sec^2 x, \dots\))
  5. E — Exponential functions (\(e^x, a^x, \dots\))

[!TIP] Why Boundary Terms Often Vanish in Definite Integrals: In definite integration by parts, Always evaluate the boundary term \(\big[u(x) \, v(x)\big]_a^b = u(b)v(b) - u(a)v(a)\) right away! Very often, at \(x = 0\), \(x = 1\), or \(x = \frac{\pi}{2}\), one or both of \(u(b)v(b)\) and \(u(a)v(a)\) equal \(0\), simplifying the algebra dramatically.


2. Core Examples Across All Standard Patterns


Example 1: Product of Algebraic and Exponential Functions

Evaluate:

\[\int_0^1 x e^x \, dx\]

Solution:

Following ILATE, we choose the algebraic factor \(f(x) = x\) as the first function and the exponential factor \(g(x) = e^x\) as the second function:

  • \(f(x) = x \implies f'(x) = 1\)
  • \(g(x) = e^x \implies \int g(x) \, dx = e^x\)

Applying the integration by parts formula on \([0, 1]\):

\[\int_0^1 x e^x \, dx = \Big[ x e^x \Big]_0^1 - \int_0^1 (1) \cdot e^x \, dx\]

Evaluating the boundary term \(\big[x e^x\big]_0^1 = 1\cdot e^1 - 0\cdot e^0 = e\) and the remaining integral:

\[\int_0^1 x e^x \, dx = (e - 0) - \Big[ e^x \Big]_0^1 = e - (e^1 - e^0) = e - (e - 1) = 1\]

Example 2: Logarithmic Function Alone (Taking Unity as the Second Function)

Evaluate:

\[\int_1^e \ln x \, dx\]

Solution:

When integrating a single logarithmic or inverse trigonometric function, we write the integrand as \(\ln x \cdot 1\), choosing \(f(x) = \ln x\) as the first function and \(g(x) = 1\) as the second function:

  • \(f(x) = \ln x \implies f'(x) = \frac{1}{x}\)
  • \(g(x) = 1 \implies \int g(x) \, dx = x\)

Applying integration by parts on \([1, e]\):

\[\int_1^e \ln x \, dx = \Big[ x \ln x \Big]_1^e - \int_1^e \left(\frac{1}{x}\right) \cdot x \, dx\]

Evaluating the boundary term and simplifying \(\frac{1}{x} \cdot x = 1\):

\[\int_1^e \ln x \, dx = \big( e \ln e - 1 \ln 1 \big) - \int_1^e 1 \, dx = (e \cdot 1 - 0) - \Big[ x \Big]_1^e\]
\[= e - (e - 1) = 1\]

Example 3: Repeated Integration by Parts

Evaluate:

\[\int_0^{\pi/2} x^2 \sin x \, dx\]

Solution:

We choose \(f(x) = x^2\) (algebraic) as the first function and \(g(x) = \sin x\) (trigonometric) as the second function. Since \(\int \sin x \, dx = -\cos x\):

\[\int_0^{\pi/2} x^2 \sin x \, dx = \Big[ -x^2 \cos x \Big]_0^{\pi/2} - \int_0^{\pi/2} (2x)(-\cos x) \, dx\]

Look at the boundary term \(\big[-x^2 \cos x\big]_0^{\pi/2}\): at \(x = \frac{\pi}{2}\), \(\cos\frac{\pi}{2} = 0\), and at \(x = 0\), \(x^2 = 0\)! Thus, the first boundary term vanishes completely:

\[\int_0^{\pi/2} x^2 \sin x \, dx = (0 - 0) + 2 \int_0^{\pi/2} x \cos x \, dx\]

Now we apply integration by parts a second time to \(\int_0^{\pi/2} x \cos x \, dx\) with \(u = x\) and \(dv = \cos x \, dx\) (\(v = \sin x\)):

\[\int_0^{\pi/2} x \cos x \, dx = \Big[ x \sin x \Big]_0^{\pi/2} - \int_0^{\pi/2} (1) \cdot \sin x \, dx\]
\[= \left( \frac{\pi}{2} \cdot 1 - 0 \right) - \Big[ -\cos x \Big]_0^{\pi/2} = \frac{\pi}{2} - (0 - (-1)) = \frac{\pi}{2} - 1\]

Multiplying by \(2\) gives the final result:

\[\int_0^{\pi/2} x^2 \sin x \, dx = 2\left( \frac{\pi}{2} - 1 \right) = \pi - 2\]

Example 4: Inverse Trigonometric Function

Evaluate:

\[\int_0^1 \tan^{-1} x \, dx\]

Solution:

Writing the integrand as \(\tan^{-1} x \cdot 1\), we choose \(f(x) = \tan^{-1} x\) as the first function and \(g(x) = 1\) as the second function:

  • \(f(x) = \tan^{-1} x \implies f'(x) = \frac{1}{1 + x^2}\)
  • \(g(x) = 1 \implies \int g(x) \, dx = x\)

Applying integration by parts on \([0, 1]\):

\[\int_0^1 \tan^{-1} x \, dx = \Big[ x \tan^{-1} x \Big]_0^1 - \int_0^1 \frac{x}{1 + x^2} \, dx\]

Boundary Term:

\[\Big[ x \tan^{-1} x \Big]_0^1 = 1 \cdot \tan^{-1}(1) - 0 \cdot \tan^{-1}(0) = \frac{\pi}{4}\]

Remaining Integral: Notice that the numerator \(x\) is half the derivative of the denominator \(1 + x^2\):

\[\int_0^1 \frac{x}{1 + x^2} \, dx = \frac{1}{2} \int_0^1 \frac{2x}{1 + x^2} \, dx = \left[ \frac{1}{2} \ln(1 + x^2) \right]_0^1 = \frac{1}{2}\ln 2 - 0 = \frac{1}{2}\ln 2\]

Combining both parts gives:

\[\int_0^1 \tan^{-1} x \, dx = \frac{\pi}{4} - \frac{1}{2}\ln 2\]

Example 5: The Classic Exponential Cancellation Pattern

Recall from indefinite integration that when we apply integration by parts to \(\int e^x f(x) \, dx\) (keeping \(f(x)\) as the first function and \(e^x\) as the second function), we obtain:

\[\int_a^b e^x f(x) \, dx = \Big[ e^x f(x) \Big]_a^b - \int_a^b e^x f'(x) \, dx\]

Adding \(\int_a^b e^x f'(x) \, dx\) to both sides yields the famous identity:

\[\int_a^b e^x \big[ f(x) + f'(x) \big] \, dx = \Big[ e^x f(x) \Big]_a^b = e^b f(b) - e^a f(a)\]

Evaluate:

\[\int_0^{\pi/2} e^x \left( \frac{1 + \sin x}{1 + \cos x} \right) dx\]

Solution:

Using the half-angle identities \(1 + \cos x = 2\cos^2\left(\frac{x}{2}\right)\) and \(\sin x = 2\sin\left(\frac{x}{2}\right)\cos\left(\frac{x}{2}\right)\), we split the fraction inside the parentheses:

\[\frac{1 + \sin x}{1 + \cos x} = \frac{1 + 2\sin\left(\frac{x}{2}\right)\cos\left(\frac{x}{2}\right)}{2\cos^2\left(\frac{x}{2}\right)} = \frac{1}{2}\sec^2\left(\frac{x}{2}\right) + \tan\left(\frac{x}{2}\right)\]

Notice that if \(f(x) = \tan\left(\frac{x}{2}\right)\), its derivative is \(f'(x) = \frac{1}{2}\sec^2\left(\frac{x}{2}\right)\), which is continuous on \(\left[0, \frac{\pi}{2}\right]\)!

Let us verify the cancellation directly by integrating \(\int_0^{\pi/2} e^x \tan\left(\frac{x}{2}\right) dx\) by parts (with first function \(\tan\left(\frac{x}{2}\right)\) and second function \(e^x\)):

\[\int_0^{\pi/2} e^x \tan\left(\frac{x}{2}\right) dx = \left[ e^x \tan\left(\frac{x}{2}\right) \right]_0^{\pi/2} - \int_0^{\pi/2} e^x \cdot \frac{1}{2}\sec^2\left(\frac{x}{2}\right) dx\]

Substituting this into our original integral cancels the \(\frac{1}{2}\sec^2\left(\frac{x}{2}\right)\) integral completely:

\[\int_0^{\pi/2} e^x \left( \tan\left(\frac{x}{2}\right) + \frac{1}{2}\sec^2\left(\frac{x}{2}\right) \right) dx = \left[ e^x \tan\left(\frac{x}{2}\right) \right]_0^{\pi/2}\]
\[= e^{\pi/2} \tan\left(\frac{\pi}{4}\right) - e^0 \tan(0) = e^{\pi/2}(1) - 1(0) = e^{\pi/2}\]

Miscellaneous Examples


Example 1

Evaluate:

\[\int_0^1 x^2 e^{-x} \, dx\]

Solution:

Choosing \(f(x) = x^2\) as the first function and \(g(x) = e^{-x}\) as the second function (with \(\int e^{-x} \, dx = -e^{-x}\)):

\[\int_0^1 x^2 e^{-x} \, dx = \Big[ -x^2 e^{-x} \Big]_0^1 - \int_0^1 (2x)(-e^{-x}) \, dx = -e^{-1} + 2 \int_0^1 x e^{-x} \, dx\]

Applying integration by parts a second time to \(\int_0^1 x e^{-x} \, dx\):

\[\int_0^1 x e^{-x} \, dx = \Big[ -x e^{-x} \Big]_0^1 - \int_0^1 (1)(-e^{-x}) \, dx = -e^{-1} + \int_0^1 e^{-x} \, dx\]
\[= -e^{-1} + \Big[ -e^{-x} \Big]_0^1 = -e^{-1} + (-e^{-1} + 1) = 1 - \frac{2}{e}\]

Substituting this back into our first equation gives:

\[\int_0^1 x^2 e^{-x} \, dx = -\frac{1}{e} + 2\left( 1 - \frac{2}{e} \right) = 2 - \frac{5}{e}\]

Example 2

Evaluate:

\[\int_0^1 x \tan^{-1} x \, dx\]

Solution:

By the ILATE priority order, we choose the inverse trigonometric function \(f(x) = \tan^{-1} x\) as the first function and the algebraic function \(g(x) = x\) as the second function:

  • \(f(x) = \tan^{-1} x \implies f'(x) = \frac{1}{1 + x^2}\)
  • \(g(x) = x \implies \int g(x) \, dx = \frac{x^2}{2}\)

Applying integration by parts on \([0, 1]\):

\[\int_0^1 x \tan^{-1} x \, dx = \left[ \frac{x^2}{2} \tan^{-1} x \right]_0^1 - \int_0^1 \frac{x^2}{2(1 + x^2)} \, dx\]

Boundary Term:

\[\left[ \frac{x^2}{2} \tan^{-1} x \right]_0^1 = \frac{1}{2}\tan^{-1}(1) - 0 = \frac{\pi}{8}\]

Remaining Integral: We rewrite \(x^2 = (1 + x^2) - 1\):

\[\frac{1}{2} \int_0^1 \frac{(1 + x^2) - 1}{1 + x^2} \, dx = \frac{1}{2} \int_0^1 \left( 1 - \frac{1}{1 + x^2} \right) dx = \frac{1}{2} \Big[ x - \tan^{-1} x \Big]_0^1 = \frac{1}{2}\left( 1 - \frac{\pi}{4} \right) = \frac{1}{2} - \frac{\pi}{8}\]

Subtracting the second part from the boundary term:

\[\int_0^1 x \tan^{-1} x \, dx = \frac{\pi}{8} - \left( \frac{1}{2} - \frac{\pi}{8} \right) = \frac{\pi}{4} - \frac{1}{2}\]

Example 3

Evaluate:

\[\int_0^{1/2} \frac{x \sin^{-1} x}{\sqrt{1 - x^2}} \, dx\]

Solution:

Notice that \(\frac{x}{\sqrt{1 - x^2}}\) is easy to integrate directly because \(\frac{d}{dx}\left(-\sqrt{1 - x^2}\right) = \frac{x}{\sqrt{1 - x^2}}\)!

We therefore choose \(f(x) = \sin^{-1} x\) as the first function and \(g(x) = \frac{x}{\sqrt{1 - x^2}}\) as the second function:

  • \(f(x) = \sin^{-1} x \implies f'(x) = \frac{1}{\sqrt{1 - x^2}}\)
  • \(g(x) = \frac{x}{\sqrt{1 - x^2}} \implies \int g(x) \, dx = -\sqrt{1 - x^2}\)

Applying integration by parts on \(\left[0, \frac{1}{2}\right]\):

\[\int_0^{1/2} \frac{x \sin^{-1} x}{\sqrt{1 - x^2}} \, dx = \Big[ -\sqrt{1 - x^2} \sin^{-1} x \Big]_0^{1/2} - \int_0^{1/2} \left( \frac{1}{\sqrt{1 - x^2}} \right) \left( -\sqrt{1 - x^2} \right) dx\]

Look how cleanly \(\sqrt{1 - x^2}\) cancels in the remaining integral!

\[= \left( -\sqrt{1 - \frac{1}{4}} \sin^{-1}\left(\frac{1}{2}\right) - 0 \right) + \int_0^{1/2} 1 \, dx\]
\[= -\frac{\sqrt{3}}{2} \cdot \frac{\pi}{6} + \Big[ x \Big]_0^{1/2} = \frac{1}{2} - \frac{\sqrt{3}\pi}{12}\]

Example 4

Evaluate:

\[\int_0^{\pi/2} e^x \sin x \, dx\]

Solution:

Let \(I = \int_0^{\pi/2} e^x \sin x \, dx\). When an exponential function multiplies a sine or cosine function, two applications of integration by parts bring us back to the original integral \(I\).

First Integration by Parts: Choose \(f(x) = \sin x\) and \(g(x) = e^x\):

\[I = \Big[ e^x \sin x \Big]_0^{\pi/2} - \int_0^{\pi/2} e^x \cos x \, dx = \big( e^{\pi/2} \cdot 1 - e^0 \cdot 0 \big) - \int_0^{\pi/2} e^x \cos x \, dx\]
\[I = e^{\pi/2} - \int_0^{\pi/2} e^x \cos x \, dx\]

Second Integration by Parts: In \(\int_0^{\pi/2} e^x \cos x \, dx\), choose \(u = \cos x\) and \(dv = e^x \, dx\):

\[\int_0^{\pi/2} e^x \cos x \, dx = \Big[ e^x \cos x \Big]_0^{\pi/2} - \int_0^{\pi/2} e^x (-\sin x) \, dx = \big( e^{\pi/2} \cdot 0 - e^0 \cdot 1 \big) + \int_0^{\pi/2} e^x \sin x \, dx\]
\[= -1 + I\]

Substituting this back into our expression for \(I\):

\[I = e^{\pi/2} - (-1 + I) = e^{\pi/2} + 1 - I\]

Adding \(I\) to both sides gives \(2I = e^{\pi/2} + 1\), so:

\[\int_0^{\pi/2} e^x \sin x \, dx = \frac{e^{\pi/2} + 1}{2}\]

Example 5

Evaluate:

\[\int_1^e (\ln x)^2 \, dx\]

Solution:

Choosing \(f(x) = (\ln x)^2\) as the first function and \(g(x) = 1\) as the second function:

  • \(f(x) = (\ln x)^2 \implies f'(x) = 2\ln x \cdot \frac{1}{x}\)
  • \(g(x) = 1 \implies \int g(x) \, dx = x\)

Applying integration by parts on \([1, e]\):

\[\int_1^e (\ln x)^2 \, dx = \Big[ x (\ln x)^2 \Big]_1^e - \int_1^e \left( \frac{2\ln x}{x} \right) x \, dx\]
\[= \big( e \cdot 1^2 - 1 \cdot 0^2 \big) - 2 \int_1^e \ln x \, dx = e - 2 \int_1^e \ln x \, dx\]

From Example 2 earlier, we already found that \(\int_1^e \ln x \, dx = 1\). Therefore:

\[\int_1^e (\ln x)^2 \, dx = e - 2(1) = e - 2\]

Example 6

Evaluate:

\[\int_1^2 \frac{e^x (x - 1)}{x^2} \, dx\]

Solution:

Splitting the fraction \(\frac{x - 1}{x^2}\) into two terms reveals a familiar pattern:

\[\frac{x - 1}{x^2} = \frac{1}{x} - \frac{1}{x^2}\]

Notice that if \(f(x) = \frac{1}{x}\), then \(f'(x) = -\frac{1}{x^2}\), which is continuous on \([1, 2]\)! Thus, the integrand has the exact form \(e^x \big[ f(x) + f'(x) \big]\):

\[\int_1^2 e^x \left( \frac{1}{x} - \frac{1}{x^2} \right) dx = \left[ \frac{e^x}{x} \right]_1^2\]

Evaluating at \(x = 2\) and \(x = 1\):

\[= \frac{e^2}{2} - \frac{e^1}{1} = \frac{e^2 - 2e}{2}\]

Example 7

Evaluate:

\[\int_0^{\pi/4} x \sec^2 x \, dx\]

Solution:

Following ILATE, we choose \(f(x) = x\) (algebraic) as the first function and \(g(x) = \sec^2 x\) (trigonometric) as the second function, since \(\int \sec^2 x \, dx = \tan x\):

  • \(f(x) = x \implies f'(x) = 1\)
  • \(g(x) = \sec^2 x \implies \int g(x) \, dx = \tan x\)

Applying integration by parts on \(\left[0, \frac{\pi}{4}\right]\):

\[\int_0^{\pi/4} x \sec^2 x \, dx = \Big[ x \tan x \Big]_0^{\pi/4} - \int_0^{\pi/4} (1) \cdot \tan x \, dx\]

Evaluating the boundary term and using \(\int \tan x \, dx = \ln|\sec x|\):

\[= \left( \frac{\pi}{4} \tan\frac{\pi}{4} - 0 \right) - \Big[ \ln(\sec x) \Big]_0^{\pi/4} = \frac{\pi}{4} - \big( \ln\sqrt{2} - \ln 1 \big) = \frac{\pi}{4} - \frac{1}{2}\ln 2\]

Example 8

Evaluate:

\[\int_0^1 \frac{\ln(1 + x)}{(1 + x)^2} \, dx\]

Solution:

Here we have a product of \(\ln(1 + x)\) and \((1 + x)^{-2}\). By ILATE, we choose the logarithmic factor \(f(x) = \ln(1 + x)\) as the first function and \(g(x) = (1 + x)^{-2}\) as the second function:

  • \(f(x) = \ln(1 + x) \implies f'(x) = \frac{1}{1 + x}\)
  • \(g(x) = \frac{1}{(1 + x)^2} \implies \int g(x) \, dx = -\frac{1}{1 + x}\)

Applying integration by parts on \([0, 1]\):

\[\int_0^1 \frac{\ln(1 + x)}{(1 + x)^2} \, dx = \left[ -\frac{\ln(1 + x)}{1 + x} \right]_0^1 - \int_0^1 \left( \frac{1}{1 + x} \right) \left( -\frac{1}{1 + x} \right) dx\]
\[= \left( -\frac{\ln 2}{2} - 0 \right) + \int_0^1 \frac{1}{(1 + x)^2} \, dx\]

Evaluating the remaining integral \(\int_0^1 (1 + x)^{-2} \, dx = \left[ -\frac{1}{1 + x} \right]_0^1\):

\[= -\frac{1}{2}\ln 2 + \left( -\frac{1}{2} - (-1) \right) = \frac{1}{2} - \frac{1}{2}\ln 2\]

Summary

Concept Formula / Rule Key Insight
Definite Integration by Parts \(\int_a^b f(x) g(x) \, dx = \left[ f(x) \int g(x) \, dx \right]_a^b - \int_a^b \left( f'(x) \int g(x) \, dx \right) dx\) Evaluate the first product term at the limits \(a\) and \(b\) immediately instead of waiting until the end.
Compact Differential Form \(\int_a^b u \, dv = [u \, v]_a^b - \int_a^b v \, du\) Reverses the Product Rule \(d(uv) = u\,dv + v\,du\) over \([a, b]\).
ILATE Selection Order Inverse Trig \(\to\) Logarithmic \(\to\) Algebraic \(\to\) Trigonometric \(\to\) Exponential Choose \(f(x)\) earlier in ILATE so differentiating \(f(x)\) simplifies the remaining integral.
Exponential Cancellation \(\int_a^b e^x \big[ f(x) + f'(x) \big] \, dx = \big[ e^x f(x) \big]_a^b\) Holds whenever \(f(x)\) and \(f'(x)\) are continuous across the entire interval \([a, b]\).