Math concepts

Integration by Parts Examples: Choose u and Check Each Answer

October 14, 20268 min read
Integration by Parts Examples: Choose u and Check Each Answer

Consider ∫xe2x dx\int x e^{2x}\,dx. The power rule cannot integrate the whole product, and integrating e2xe^{2x} alone leaves the xx behind. Integration by parts gives the product a useful direction: differentiate the part that becomes simpler, integrate the part that stays manageable, and then handle the smaller integral that remains.

This lesson works through integration by parts examples, from a single product to repeated use and definite bounds. If you want the meaning of an integral before the technique, start with our integral guide. The derivative guide also helps because differentiating your answer is the best check here.

Where the formula comes from

The product rule says ddx(uv)=udvdx+vdudx\frac{d}{dx}(uv)=u\frac{dv}{dx}+v\frac{du}{dx}. Integrate both sides and move one term across. This gives the integration by parts formula described in OpenStax Calculus, Volume 2:

∫u dv=uv−∫v du.\int u\,dv=uv-\int v\,du.

Here uu is the expression you choose to differentiate, and dvdv is what you choose to integrate. After finding dudu and vv, the new integral ∫v du\int v\,du should be easier than the original one. If it is worse, reconsider the split. The formula is an algebraic consequence of the product rule, not a recipe that guarantees every split will help.

For an indefinite integral, remember the constant CC at the end. The choice of an antiderivative for vv can absorb a constant, but it is simpler to pick one convenient vv and add CC to the final answer.

Choose u and dv with a purpose

The useful question is: “Which factor shrinks when differentiated?” A polynomial such as x2x^2 becomes 2x2x, then 22, then zero. A logarithm becomes 1/x1/x, which often combines well with the rest. Meanwhile, exponentials and sine or cosine remain easy to integrate repeatedly.

The familiar LIATE mnemonic orders logarithmic, inverse trigonometric, algebraic, trigonometric, and exponential factors as candidates for uu. OpenStax presents it as a heuristic, not a theorem. Check the resulting ∫v du\int v\,du instead of trusting the first letter you see. A different split may be shorter, and some products are better handled by substitution.

For example, ∫2xcos⁡(x2) dx\int 2x\cos(x^2)\,dx contains an inner function x2x^2 and its derivative 2x2x. Set t=x2t=x^2. Then dt=2x dxdt=2x\,dx and the integral is sin⁡(x2)+C\sin(x^2)+C. Using integration by parts would turn a simple composition into unnecessary work. In contrast, xe2xx e^{2x} has no such direct inner-derivative match, while differentiating xx removes it.

Write a small two-column table before calculating: uu, dudu on one side, dvdv, vv on the other. Then ask whether multiplying vv and dudu creates a simpler integral. This check prevents the common mistake of choosing the easy-to-integrate factor as uu merely because it looks familiar.

Example 1: a linear factor times an exponential

Find ∫xe2x dx\int x e^{2x}\,dx. Choose u=xu=x so du=dxdu=dx. Choose dv=e2x dxdv=e^{2x}\,dx, giving v=12e2xv=\frac12e^{2x}. The factor 12\frac12 matters: differentiating e2xe^{2x} produces an extra two.

∫xe2x dx=x(12e2x)−∫12e2x dx=xe2x2−e2x4+C=e2x4(2x−1)+C.\begin{aligned} \int x e^{2x}\,dx &=x\left(\frac12e^{2x}\right)-\int\frac12e^{2x}\,dx\\ &=\frac{x e^{2x}}2-\frac{e^{2x}}4+C\\ &=\frac{e^{2x}}4(2x-1)+C. \end{aligned}

Differentiate the factored answer. The product rule gives 14[2e2x(2x−1)+2e2x]\frac14[2e^{2x}(2x-1)+2e^{2x}], which simplifies to xe2xx e^{2x}. That restores the integrand exactly. If the check had produced 2xe2x2x e^{2x}, the likely error would be omitting the 12\frac12 when integrating e2xe^{2x}.

The choice also has a visible stopping point: differentiating xx leaves a constant, so the remaining integral contains only the exponential. That is what “simpler” means in this example.

Example 2: integrate a logarithm

Find ∫ln⁡x dx\int\ln x\,dx for x>0x>0. There is no written product, but you can supply a factor of one: ln⁡x=1⋅ln⁡x\ln x=1\cdot\ln x. Choose u=ln⁡xu=\ln x and dv=dxdv=dx. Then du=1x dxdu=\frac1x\,dx and v=xv=x.

∫ln⁡x dx=xln⁡x−∫x1x dx=xln⁡x−x+C.\begin{aligned} \int\ln x\,dx &=x\ln x-\int x\frac1x\,dx\\ &=x\ln x-x+C. \end{aligned}

The check is short: ddx(xln⁡x−x)=ln⁡x+1−1=ln⁡x\frac{d}{dx}(x\ln x-x)=\ln x+1-1=\ln x. The domain x>0x>0 lets us write ln⁡x\ln x and 1/x1/x without crossing zero. The more general antiderivative xln⁡∣x∣−x+Cx\ln|x|-x+C works on intervals that do not include zero, but the stated problem stays on the positive side.

If you chose u=1u=1 and dv=ln⁡x dxdv=\ln x\,dx, you would need to know the original integral just to find vv. That circular split explains why the logarithm belongs in uu here.

Example 3: repeat the method until the polynomial disappears

Find I=∫x2sin⁡x dxI=\int x^2\sin x\,dx. Differentiating x2x^2 reduces its degree, while integrating sine remains straightforward. First choose u=x2u=x^2 and dv=sin⁡x dxdv=\sin x\,dx, so du=2x dxdu=2x\,dx and v=−cos⁡xv=-\cos x:

I=−x2cos⁡x+2∫xcos⁡x dx.I=-x^2\cos x+2\int x\cos x\,dx.

The remaining integral still contains a product. Let J=∫xcos⁡x dxJ=\int x\cos x\,dx and apply parts again: u=xu=x, du=dxdu=dx, dv=cos⁡x dxdv=\cos x\,dx, v=sin⁡xv=\sin x. Then

J=xsin⁡x−∫sin⁡x dx=xsin⁡x+cos⁡x.J=x\sin x-\int\sin x\,dx=x\sin x+\cos x.

Substitute that result into II:

∫x2sin⁡x dx=−x2cos⁡x+2xsin⁡x+2cos⁡x+C.\int x^2\sin x\,dx=-x^2\cos x+2x\sin x+2\cos x+C.

Now differentiate term by term. The derivative of −x2cos⁡x-x^2\cos x is −2xcos⁡x+x2sin⁡x-2x\cos x+x^2\sin x. The derivative of 2xsin⁡x2x\sin x is 2sin⁡x+2xcos⁡x2\sin x+2x\cos x; that of 2cos⁡x2\cos x is −2sin⁡x-2\sin x. All extra terms cancel, leaving x2sin⁡xx^2\sin x. This cancellation is a strong check on both the sign from integrating sine and the factor of two from differentiating x2x^2.

Repeated integration by parts is useful when each application makes a factor smaller. If the new integral resembles the original instead, it may still be solvable by collecting the original integral on one side, but do not keep applying the formula without a clear end point.

Example 4: keep the bounds in a definite integral

Evaluate ∫01xln⁡(1+x) dx\int_0^1 x\ln(1+x)\,dx. The factor xx is easy to integrate, but differentiating ln⁡(1+x)\ln(1+x) produces 1/(1+x)1/(1+x). Choose u=ln⁡(1+x)u=\ln(1+x) and dv=x dxdv=x\,dx. Then du=11+x dxdu=\frac{1}{1+x}\,dx and v=x2/2v=x^2/2. The definite form of integration by parts is ∫abu dv=[uv]ab−∫abv du\int_a^b u\,dv=[uv]_a^b-\int_a^b v\,du.

∫01xln⁡(1+x) dx=[x22ln⁡(1+x)]01−12∫01x21+x dx=12ln⁡2−12∫01(x−1+1x+1)dx.\begin{aligned} \int_0^1 x\ln(1+x)\,dx &=\left[\frac{x^2}{2}\ln(1+x)\right]_0^1 -\frac12\int_0^1\frac{x^2}{1+x}\,dx\\ &=\frac12\ln2-\frac12\int_0^1\left(x-1+\frac1{x+1}\right)dx. \end{aligned}

Polynomial division gives x2/(x+1)=x−1+1/(x+1)x^2/(x+1)=x-1+1/(x+1). Its integral from zero to one is 1/2−1+ln⁡2=ln⁡2−1/21/2-1+\ln2=\ln2-1/2. Therefore

∫01xln⁡(1+x) dx=12ln⁡2−12(ln⁡2−12)=14.\int_0^1 x\ln(1+x)\,dx =\frac12\ln2-\frac12\left(\ln2-\frac12\right)=\frac14.

This positive result is plausible because xln⁡(1+x)x\ln(1+x) is nonnegative on [0,1][0,1]. As an independent algebra check, an antiderivative is x2−12ln⁡(1+x)−x24+x2\frac{x^2-1}{2}\ln(1+x)-\frac{x^2}{4}+\frac{x}{2}; evaluating at one and zero also gives 1/41/4. For definite integrals, carry the same endpoints through the new integral. There is no +C+C in the final number.

Three practice problems with solutions

1. A polynomial and an exponential. Find ∫3xex dx\int 3x e^x\,dx.

Take u=3xu=3x and dv=ex dxdv=e^x\,dx. Then du=3 dxdu=3\,dx and v=exv=e^x, so

∫3xex dx=3xex−3∫ex dx=3ex(x−1)+C.\int 3x e^x\,dx=3x e^x-3\int e^x\,dx=3e^x(x-1)+C.

Differentiate 3ex(x−1)3e^x(x-1): it gives 3ex(x−1)+3ex=3xex3e^x(x-1)+3e^x=3xe^x. The result matches the original integrand.

2. A logarithm with a coefficient. Find ∫xln⁡x dx\int x\ln x\,dx for x>0x>0.

Choose u=ln⁡xu=\ln x and dv=x dxdv=x\,dx. Then du=dx/xdu=dx/x and v=x2/2v=x^2/2:

∫xln⁡x dx=x22ln⁡x−12∫x dx=x22ln⁡x−x24+C.\int x\ln x\,dx=\frac{x^2}{2}\ln x-\frac12\int x\,dx =\frac{x^2}{2}\ln x-\frac{x^2}{4}+C.

Differentiation gives xln⁡x+x/2−x/2=xln⁡xx\ln x+x/2-x/2=x\ln x. Keeping the two x/2x/2 terms visible makes the check easier to follow.

3. A definite integral. Evaluate ∫0π/2xcos⁡x dx\int_0^{\pi/2}x\cos x\,dx.

Take u=xu=x and dv=cos⁡x dxdv=\cos x\,dx, giving du=dxdu=dx and v=sin⁡xv=\sin x. Apply the bounds after the parts step:

∫0π/2xcos⁡x dx=[xsin⁡x]0π/2−∫0π/2sin⁡x dx=π2−[−cos⁡x]0π/2=π2−1.\begin{aligned} \int_0^{\pi/2}x\cos x\,dx &=[x\sin x]_0^{\pi/2}-\int_0^{\pi/2}\sin x\,dx\\ &=\frac\pi2-[-\cos x]_0^{\pi/2}\\ &=\frac\pi2-1. \end{aligned}

Both xx and cos⁡x\cos x are nonnegative on this interval, and π/2−1\pi/2-1 is positive. Differentiating xsin⁡x+cos⁡xx\sin x+\cos x gives xcos⁡xx\cos x, which checks the antiderivative used to evaluate the bounds.

To practise the underlying antiderivative choices, use Math Zen's integrals topic. For a later application of repeated integration methods, see the Laplace transforms guide.

Common Questions

How do I decide between substitution and integration by parts?
Look first for an inner function accompanied by its derivative, as in 2x cos(x²). Substitution is direct there. If you have a product whose differentiated factor becomes simpler, as in x e^(2x), try parts. Some integrals need both techniques in sequence.
Must I follow LIATE exactly?
No. LIATE suggests a first choice for u. Judge that choice by the new integral of v du. If it is harder than the original or leads in a circle, choose again.
Can I check every answer by differentiating?
For an indefinite integral, differentiating the proposed antiderivative must recover the integrand on the stated domain. For a definite integral, check the antiderivative first and then evaluate its endpoint difference. A numerical estimate can also catch an implausible sign or size.
Why is there no +C on a definite integral answer?
A definite integral is a number. If you use an antiderivative F + C, the constants cancel in (F(b) + C) − (F(a) + C).

Put This Into Practice