Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 39 · Integrals

Antiderivatives and Indefinite Integrals

Learn what an antiderivative is, why the constant of integration matters, and the basic integration rules, with worked examples and code checks.

Differentiation takes a function and gives its rate of change. Integration runs the process backwards. Given a rate of change, it recovers the original quantity. If you know a car's speed at every moment, integration tells you how far it has traveled. This lesson introduces the reverse of differentiation.

Antiderivatives

A function F is an antiderivative of f if F'(x) = f(x). For example, x² is an antiderivative of 2x because the derivative of x² is 2x.

But so is x² + 5, and x² - 100. Constants vanish when you differentiate, so every antiderivative can be shifted by a constant. All antiderivatives of f together are written with the indefinite integral:

Text
∫ f(x) dx = F(x) + C

The symbol ∫ is an elongated "S" (for sum), f(x) is the integrand, dx shows the variable, and C is the constant of integration. Always include + C: without it, you describe only one member of an infinite family of curves.

Graphically, the antiderivatives of f form a family of curves that are vertical shifts of each other. They all have the same slope at each x, namely f(x).

Basic rules

Each differentiation rule has a mirror image:

Integral Result
∫ xⁿ dx (for n ≠ -1) xⁿ⁺¹/(n + 1) + C
∫ 1/x dx (for x ≠ 0) ln(abs(x)) + C
∫ eˣ dx eˣ + C
∫ sin x dx -cos x + C
∫ cos x dx sin x + C
∫ k dx (constant k) kx + C

Two linearity rules also hold: constants come out front, and sums split.

Text
∫ k·f(x) dx = k ∫ f(x) dx
∫ [f(x) + g(x)] dx = ∫ f(x) dx + ∫ g(x) dx

The power rule says: add one to the exponent, then divide by the new exponent. That works for any n except -1, where it would mean dividing by zero; that case is handled by the logarithm.

Worked examples

Example 1. ∫ (3x² + 4x - 5) dx. Integrate term by term:

Text
3x³/3 + 4x²/2 - 5x + C = x³ + 2x² - 5x + C

Example 2. ∫ (√x) dx. Rewrite √x = x^(1/2), then x^(3/2) / (3/2) + C = (2/3) x^(3/2) + C.

Example 3. ∫ (1/x²) dx. Rewrite as x⁻², giving x⁻¹ / (-1) + C = -1/x + C.

Example 4. ∫ (2eˣ - 3 cos x) dx = 2eˣ - 3 sin x + C.

How to check any answer: differentiate it. If you get the integrand back, the answer is right. The code below does this with sympy, which can also compute antiderivatives itself (it leaves off the + C).

Python Compute and verify antiderivatives

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Finding C: initial conditions

Sometimes a problem gives you extra information that picks out one curve from the family. This is an initial value problem.

Suppose a ball's velocity is v(t) = 20 - 9.8t meters per second (upward is positive) and its height at t = 0 is s(0) = 2 m. Position is an antiderivative of velocity:

Text
s(t) = ∫ (20 - 9.8t) dt = 20t - 4.9t² + C

Use s(0) = 2: 0 - 0 + C = 2, so C = 2. The height formula is s(t) = 20t - 4.9t² + 2. The ball is highest when v = 0, at t = 20/9.8 ≈ 2.04 s.

Python Plot a family of antiderivatives and pick one

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Common mistakes

  • Forgetting + C. Always include it for indefinite integrals.
  • Using the power rule on 1/x. The answer is ln(abs(x)), not x⁰/0.
  • Forgetting to rewrite roots and fractions as powers before integrating.
  • Believing the integral of a product is the product of integrals. It is not: ∫ x · x dx is x³/3, but (∫ x dx)(∫ x dx) = (x²/2)².

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is ∫ 6x² dx?

    6 · x³/3 = 2x³. Differentiate 2x³ + C to confirm you get 6x².
  2. 2. Why is + C needed in an indefinite integral?

    x², x² + 5 and x² - 100 all have derivative 2x, so every antiderivative is only defined up to a constant.
  3. 3. Which is ∫ 1/x dx?

    The power rule fails for n = -1. The derivative of ln(abs(x)) is 1/x.
  4. 4. f'(x) = 4x and f(0) = 3. What is f(x)?

    ∫ 4x dx = 2x² + C; f(0) = C = 3.

Summary

  • An antiderivative F of f satisfies F' = f; all antiderivatives differ by a constant.
  • ∫ f(x) dx = F(x) + C is the indefinite integral.
  • Power rule for integrals: ∫ xⁿ dx = xⁿ⁺¹/(n + 1) + C for n ≠ -1; ∫ 1/x dx = ln(abs(x)) + C.
  • Check answers by differentiating, and use initial conditions to find C.

Next: Riemann Sums and the Definite Integral