When two functions are multiplied together, the product rule in reverse trades one integral for a hopefully simpler one.
10 min read4 worked examples
Deriving the formula
Substitution handles composite functions built from an "outer" and "inner" part. But many integrands — like $x\cos x$ or $x^2e^x$ — are instead a genuine product of two different functions, with no substitution that simplifies both factors at once. Integration by parts is built for exactly this case, and comes directly from reversing the product rule for differentiation.
ProofThe integration by parts formula
1
The product rule states $\dfrac{d}{dx}(uv) = u\dfrac{dv}{dx} + v\dfrac{du}{dx}$, for functions $u$ and $v$ of $x$.
Starting point: differentiate a product of two functions.
2
Integrate both sides with respect to $x$: $uv = \displaystyle\int u\dfrac{dv}{dx}\,dx + \int v\dfrac{du}{dx}\,dx$.
Integration reverses differentiation, so integrating the derivative of uv just returns uv.
The formula trades $\int u\,\dfrac{dv}{dx}\,dx$ for $\int v\,\dfrac{du}{dx}\,dx$ — worthwhile only if the new integral is simpler. Choose $u$ to be the part that simplifies when differentiated (commonly a polynomial, since its degree drops each time), and let $\dfrac{dv}{dx}$ be the part that's straightforward to integrate.
Applying the method more than once
If the "polynomial part" of $u$ has degree 2 or higher, one application of integration by parts leaves behind another product needing the same treatment. Applying the formula repeatedly — each time reducing the polynomial's degree by one — eventually leaves an integral simple enough to evaluate directly.
Worked example 1
A single application
Find $\displaystyle\int x\cos x\,dx$.
MethodLet u = x (simplifies to 1), dv/dx = cos x
1
Let $u=x$ and $\dfrac{dv}{dx}=\cos x$.
x simplifies to 1 when differentiated; cos x is easy to integrate.
2
Then $\dfrac{du}{dx}=1$ and $v=\sin x$.
Differentiate u, integrate dv/dx.
3
$\displaystyle\int x\cos x\,dx = x\sin x - \int \sin x \cdot 1\,dx$.
Apply the formula uv − ∫v (du/dx) dx.
4
$=x\sin x - (-\cos x) + c = x\sin x + \cos x + c$.
Integrate the remaining (simpler) integral.
▪ solved
Worked example 2
Applying the formula twice
Find $\displaystyle\int x^2e^x\,dx$.
MethodFirst pass reduces x² to x; a second pass finishes the job
1
Let $u=x^2$, $\dfrac{dv}{dx}=e^x$, so $\dfrac{du}{dx}=2x$ and $v=e^x$.
x² simplifies (in degree) when differentiated; eˣ integrates to itself.
For $\int 2xe^x\,dx$: let $u=2x$, $\dfrac{dv}{dx}=e^x$, so $\dfrac{du}{dx}=2$, $v=e^x$: $\int 2xe^x\,dx = 2xe^x - \int 2e^x\,dx = 2xe^x-2e^x+c$.
Second application, on the new (simpler) integral.
4
$\displaystyle\int x^2e^x\,dx = x^2e^x - (2xe^x-2e^x) + c = x^2e^x-2xe^x+2e^x+c$.
Combine both applications.
5
$=e^x(x^2-2x+2)+c$.
Factor for a tidier final form.
▪ solved
Pattern
Each application of the formula reduces the polynomial factor's degree by exactly one, while $e^x$ (or $\sin x$/$\cos x$) reproduces itself under integration — so the process is guaranteed to terminate after finitely many steps.
Worked example 3
Integrating ln x
Find $\displaystyle\int \ln x\,dx$.
MethodTreat ln x as ln x × 1, and integrate by parts
1
Write $\ln x = \ln x \times 1$, and let $u=\ln x$, $\dfrac{dv}{dx}=1$.
There is no product to split — but treating the integrand as ln x times 1 makes the formula applicable.
2
Then $\dfrac{du}{dx}=\dfrac1x$ and $v=x$.
Differentiate ln x; integrate the constant function 1.
3
$\displaystyle\int \ln x\,dx = x\ln x - \int x \cdot \dfrac1x\,dx = x\ln x - \int 1\,dx$.
The x's cancel, leaving a trivial integral.
4
$=x\ln x - x + c$.
Integrate the constant 1.
▪ solved
The key insight
Writing a single function as "itself times 1" is a standard trick for applying integration by parts to functions like $\ln x$ or $\arcsin x$, which have no elementary antiderivative found any other elementary way, but whose derivative is comparatively simple.
Worked example 4
A definite integral requiring by parts · Challenge
Find $\displaystyle\int_1^e x^2\ln x\,dx$, giving your answer in terms of $e$.
MethodLet u = ln x (simplifies under differentiation), dv/dx = x²
1
Let $u=\ln x$, $\dfrac{dv}{dx}=x^2$, so $\dfrac{du}{dx}=\dfrac1x$ and $v=\dfrac{x^3}{3}$.
ln x simplifies to 1/x when differentiated; x² integrates cleanly.
2
$\displaystyle\int x^2\ln x\,dx = \dfrac{x^3}{3}\ln x - \int \dfrac{x^3}{3}\cdot\dfrac1x\,dx = \dfrac{x^3}{3}\ln x - \dfrac13\int x^2\,dx$.
Apply the formula; the x³/x simplifies to x².
3
$=\dfrac{x^3}{3}\ln x - \dfrac{x^3}{9}+c$.
Integrate the remaining term.
4
Evaluate: $\Big[\dfrac{x^3}{3}\ln x - \dfrac{x^3}{9}\Big]_1^e = \Big(\dfrac{e^3}{3}\cdot1-\dfrac{e^3}{9}\Big) - \Big(0-\dfrac19\Big)$.
Use ln e = 1 and ln 1 = 0 at the two limits.
5
$=\dfrac{2e^3}{9}+\dfrac19 = \dfrac{2e^3+1}{9}$.
Simplify to a single fraction.
▪ solved
Look deeper — combining with substitution ideas
Some integrands need both techniques: a substitution to simplify the integrand first, followed by parts (or vice versa). Recognising which technique to reach for first — product ⇒ parts; composite function ⇒ substitution — is the real skill being tested here.
Common mistake
Choosing $u$ and $\dfrac{dv}{dx}$ the wrong way round — for instance, letting $u=e^x$ in $\int xe^x\,dx$. This produces a new integral, $\int \dfrac{x^2}{2}e^x\,dx$, that is more complicated than the original, not less. Always check that the resulting integral is genuinely simpler before committing to a choice.
Check yourself
Find $\displaystyle\int x\sin 2x\,dx$. (Hint: let u = x, since it simplifies to 1 under differentiation.)
Method
1
Let $u=x$, $\dfrac{dv}{dx}=\sin2x$, so $\dfrac{du}{dx}=1$, $v=-\dfrac12\cos2x$.