Home / Articles / Calculus
Calculus · 3 min read

Integration by Substitution Step by Step

Learn integration by substitution (u-substitution) step by step, with worked examples, definite integrals, how to choose u and common mistakes to avoid.

Integration by substitution, often called u-substitution, is the integration version of the chain rule. It turns a complicated-looking integral into a simple one by changing the variable. Once you learn to spot the pattern, you will use it in nearly every calculus paper, from FSc to university level.

The Idea Behind Substitution

The chain rule says:

$$ \frac{d}{dx}F\big(g(x)\big) = F'\big(g(x)\big)\,g'(x) $$

Reading this backwards gives:

$$ \int f\big(g(x)\big)\,g'(x)\,dx = \int f(u)\,du, \qquad u = g(x) $$

So whenever an integrand contains a function and its derivative (up to a constant), substitution will usually work.

The Five-Step Method

  1. Choose \( u \), usually the "inside" function.
  2. Differentiate: find \( \frac{du}{dx} \) and rewrite it as \( du = g'(x)\,dx \).
  3. Substitute so the integral contains only \( u \) and \( du \). No \( x \) should remain.
  4. Integrate with respect to \( u \).
  5. Substitute back \( u = g(x) \) and add \( C \).

How to Choose \( u \)

Good choices for \( u \) are usually:

  • The expression inside brackets raised to a power, e.g. \( (x^2 + 1)^5 \).
  • The expression inside a root, e.g. \( \sqrt{3x + 2} \).
  • The argument of a trig, exponential or log function, e.g. \( \cos(x^2) \) or \( e^{x^2} \).
  • A denominator whose derivative appears in the numerator, e.g. \( \frac{2x}{x^2 + 4} \).

Worked Example 1: A Power of a Bracket

Find \( \displaystyle\int 2x(x^2 + 1)^5\,dx \).

Step 1: Let \( u = x^2 + 1 \).

Step 2: \( \frac{du}{dx} = 2x \), so \( du = 2x\,dx \).

Step 3: The integral contains exactly \( 2x\,dx \), so:

$$ \int 2x(x^2 + 1)^5\,dx = \int u^5\,du $$

Step 4: Integrate.

$$ \int u^5\,du = \frac{u^6}{6} + C $$

Step 5: Substitute back.

$$ \int 2x(x^2 + 1)^5\,dx = \frac{(x^2 + 1)^6}{6} + C $$

Check: differentiating gives \( \frac{6(x^2 + 1)^5 \cdot 2x}{6} = 2x(x^2 + 1)^5 \). Correct.

Worked Example 2: Adjusting a Constant

Find \( \displaystyle\int x\cos(x^2)\,dx \).

Step 1: Let \( u = x^2 \).

Step 2: \( du = 2x\,dx \), so \( x\,dx = \frac{1}{2}\,du \).

Step 3: Substitute.

$$ \int x\cos(x^2)\,dx = \int \cos u \cdot \frac{1}{2}\,du = \frac{1}{2}\int \cos u\,du $$

Step 4: Integrate.

$$ \frac{1}{2}\sin u + C $$

Step 5: Substitute back.

$$ \int x\cos(x^2)\,dx = \frac{1}{2}\sin(x^2) + C $$

The integrand only needs the derivative of \( u \) up to a constant factor. You can always fix a missing constant, but you cannot fix a missing \( x \).

Worked Example 3: The Integral of \( \tan x \)

Find \( \displaystyle\int \tan x\,dx \).

Step 1: Rewrite as \( \displaystyle\int \frac{\sin x}{\cos x}\,dx \) and let \( u = \cos x \).

Step 2: \( du = -\sin x\,dx \), so \( \sin x\,dx = -du \).

Step 3: Substitute.

$$ \int \frac{\sin x}{\cos x}\,dx = \int \frac{-du}{u} = -\int \frac{1}{u}\,du $$

Step 4 and 5:

$$ -\ln|u| + C = -\ln|\cos x| + C = \ln|\sec x| + C $$

This is a standard result you should remember.

Worked Example 4: Expressing \( x \) in Terms of \( u \)

Find \( \displaystyle\int x\sqrt{x + 1}\,dx \).

Step 1: Let \( u = x + 1 \). Then \( du = dx \) and \( x = u - 1 \).

Step 2: Substitute everything, including the leftover \( x \).

$$ \int (u - 1)\,u^{1/2}\,du = \int \left(u^{3/2} - u^{1/2}\right)du $$

Step 3: Integrate.

$$ \frac{u^{5/2}}{5/2} - \frac{u^{3/2}}{3/2} + C = \frac{2}{5}u^{5/2} - \frac{2}{3}u^{3/2} + C $$

Step 4: Substitute back.

$$ \int x\sqrt{x + 1}\,dx = \frac{2}{5}(x + 1)^{5/2} - \frac{2}{3}(x + 1)^{3/2} + C $$

Substitution in Definite Integrals

With a definite integral, you can change the limits to \( u \)-values and avoid substituting back.

Worked Example 5

Evaluate \( \displaystyle\int_0^1 x e^{x^2}\,dx \).

Step 1: Let \( u = x^2 \), so \( du = 2x\,dx \) and \( x\,dx = \frac{1}{2}\,du \).

Step 2: Change the limits. When \( x = 0 \), \( u = 0 \). When \( x = 1 \), \( u = 1 \).

Step 3: Substitute and evaluate.

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

So the answer is \( \frac{e - 1}{2} \approx 0.859 \).

Common Mistakes

  • Leaving \( x \) in the integral after substituting. Every \( x \), including \( dx \), must be replaced.
  • Forgetting the constant factor, such as the \( \frac{1}{2} \) in Example 2.
  • Using the old limits with the new variable in a definite integral.
  • Forgetting to substitute back in an indefinite integral. The final answer must be in terms of \( x \).
  • Choosing \( u \) badly. If the substitution makes things worse, try the inner function instead.

Key Takeaways

  • Substitution reverses the chain rule: look for a function and its derivative together.
  • Let \( u \) be the inner function, replace \( dx \) using \( du \), and make sure no \( x \) remains.
  • Missing constants can be adjusted; when an extra \( x \) is left, express it in terms of \( u \).
  • For definite integrals, change the limits to \( u \)-values and skip the back-substitution.

Need help with a stubborn integral or a complete calculus assignment? Amathify's experts and PhD scholars provide clear, step-by-step solutions. Reach us on WhatsApp or through the "Ask a Question" form.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles