TExcelTAD
Home › Calculus Essentials › Properties of the Indefinite Integral

Properties of the Indefinite Integral

A few simple rules let you break a complicated integral into pieces you already know. This lesson covers those rules, the ones that look natural but are false, and how integration and differentiation undo each other.

Linearity: the two rules you use all the time

The indefinite integral is linear. Constants come out, and sums split:

∫k⋅f(x) dx=k⋅∫f(x) dx(constant multiple rule)∫(f(x)±g(x)) dx=∫f(x) dx±∫g(x) dx(sum and difference rule)\begin{aligned} \int k \cdot f(x)\,dx &= k \cdot \int f(x)\,dx && \text{(constant multiple rule)} \\ \int (f(x) \pm g(x))\,dx &= \int f(x)\,dx \pm \int g(x)\,dx && \text{(sum and difference rule)} \end{aligned}

Both follow from the matching derivative rules: (kF)′=kF′(kF)' = kF' and (F+G)′=F′+G′(F + G)' = F' + G'. Together they mean any polynomial can be integrated term by term:

∫(5x4−2x2+7) dx=5⋅x55−2⋅x33+7x+C=x5−23x3+7x+C\int (5x^4 - 2x^2 + 7)\,dx = 5 \cdot \frac{x^5}{5} - 2 \cdot \frac{x^3}{3} + 7x + C = x^5 - \frac{2}{3}x^3 + 7x + C

Only one + C+\,C is needed at the end: the constants of all the pieces add up to a single unknown constant.

Integration and differentiation undo each other

Rule In words
ddx∫f(x) dx=f(x)\frac{d}{dx} \int f(x)\,dx = f(x) differentiate an antiderivative and you get the function back exactly
∫f′(x) dx=f(x)+C\int f'(x)\,dx = f(x) + C integrate a derivative and you get the function back, up to a constant

The asymmetry is the + C+\,C: differentiating throws a constant away, so integrating cannot know which one to restore.

python · try it yourself
import sympy as sp

x = sp.symbols("x")
f = 5 * x**4 - 2 * x**2 + 7

F = sp.integrate(f, x)
print("∫ f dx       =", F)
print("d/dx ∫ f dx  =", sp.diff(F, x))

g = sp.exp(2 * x) + x**3
print("∫ g' dx      =", sp.integrate(sp.diff(g, x), x), "  (g =", g, ")")
∫ f dx       = x**5 - 2*x**3/3 + 7*x
d/dx ∫ f dx  = 5*x**4 - 2*x**2 + 7
∫ g' dx      = x**3 + exp(2*x)   (g = x**3 + exp(2*x) )

SymPy prints x**5 for x5x^5 and exp(2*x) for e2xe^{2x}; that is just its text format.

What does NOT work

The derivative has a product rule and a quotient rule. The integral has no simple product or quotient rule:

∫f⋅g dx≠(∫f dx)⋅(∫g dx)∫f/g dx≠(∫f dx)/(∫g dx)\begin{aligned} \int f \cdot g\,dx &\ne \left(\int f\,dx\right) \cdot \left(\int g\,dx\right) \\ \int f / g\,dx &\ne \left(\int f\,dx\right) / \left(\int g\,dx\right) \end{aligned}

A quick counterexample: ∫x⋅x dx=x3/3\int x \cdot x\,dx = x^3/3, but (∫x dx)⋅(∫x dx)=(x2/2)2=x4/4(\int x\,dx) \cdot (\int x\,dx) = (x^2/2)^2 = x^4/4. Products need other tools, like substitution and integration by parts.

python · try it yourself
import sympy as sp

x = sp.symbols("x")
f, g = x, sp.cos(x)
right = sp.integrate(f * g, x)
wrong = sp.integrate(f, x) * sp.integrate(g, x)
print("∫ x·cos x dx         =", right)
print("(∫ x dx)(∫ cos x dx) =", wrong)
print("difference is zero?   ", sp.simplify(right - wrong) == 0)
∫ x·cos x dx         = x*sin(x) + cos(x)
(∫ x dx)(∫ cos x dx) = x**2*sin(x)/2
difference is zero?    False

Tip: When you are unsure whether a manipulation is legal, differentiate your answer. If you do not get the integrand back, the step was wrong.

In software

Linearity is what makes integration easy for computers when a function is stored as a list of coefficients. NumPy's polynomial tools integrate term by term: coefficient cc of xnx^n becomes c/(n+1)c/(n+1) of xn+1x^{n+1}, and you pass the constant of integration explicitly.

python · try it yourself
import numpy as np

# 5x^4 - 2x^2 + 7, highest power first
coeffs = np.array([5, 0, -2, 0, 7])
anti = np.polyint(coeffs, k=3)       # k is the constant C
print("antiderivative coefficients:", np.round(anti, 4))
print("derivative of it again     :", np.polyder(anti))

# the same thing by hand, lowest power first
c = [7, 0, -2, 0, 5]
by_hand = [3] + [ci / (n + 1) for n, ci in enumerate(c)]
print("by hand (lowest power first):", [round(v, 4) for v in by_hand])
antiderivative coefficients: [ 1.      0.     -0.6667  0.      7.      3.    ]
derivative of it again     : [ 5.  0. -2.  0.  7.]
by hand (lowest power first): [3, 7.0, 0.0, -0.6667, 0.0, 1.0]

Linearity also explains why an expected value in statistics splits, E[aX+bY]=aE[X]+bE[Y]E[aX + bY] = aE[X] + bE[Y]: an expected value is an integral, so it inherits the same two rules. In code that processes signals, it is why you can integrate (sum) each component of a mixed signal separately and add the results.

Exercises

Exercise 1: Term by term

Find ∫(8x3−3x+4/x) dx\int (8x^3 - 3\sqrt{x} + 4/x)\,dx for x>0x > 0.

Answer

2x4−2x3/2+4ln⁡x+C2x^4 - 2x^{3/2} + 4 \ln x + C

Solution
∫8x3 dx=8⋅x44=2x4∫3x1/2 dx=3⋅x3/23/2=2x3/2→with the minus sign: −2x3/2∫4x dx=4ln⁡x\begin{aligned} \int 8x^3\,dx &= 8 \cdot \frac{x^4}{4} = 2x^4 \\ \int 3x^{1/2}\,dx &= 3 \cdot \frac{x^{3/2}}{3/2} = 2x^{3/2} && \to \text{with the minus sign: } -2x^{3/2} \\ \int \frac{4}{x}\,dx &= 4 \ln x \end{aligned}

Exercise 2: Expand first

Find ∫(x+2)2 dx\int (x + 2)^2\,dx by expanding, then compare it with (x+2)3/3(x + 2)^3/3. Do they differ?

Answer

x3/3+2x2+4x+Cx^3/3 + 2x^2 + 4x + C. It differs from (x+2)3/3(x + 2)^3/3 only by the constant 8/38/3, so both are correct.

Solution
(x+2)2=x2+4x+4→∫=x33+2x2+4x+C(x+2)33=x3+6x2+12x+83=x33+2x2+4x+83the two differ by 83, which C absorbs\begin{aligned} (x + 2)^2 &= x^2 + 4x + 4 \quad\to\quad \int = \frac{x^3}{3} + 2x^2 + 4x + C \\ \frac{(x + 2)^3}{3} &= \frac{x^3 + 6x^2 + 12x + 8}{3} = \frac{x^3}{3} + 2x^2 + 4x + \frac{8}{3} \\ &\text{the two differ by } \tfrac{8}{3}, \text{ which } C \text{ absorbs} \end{aligned}

Exercise 3: Spot the false step

A student writes ∫x2ex dx=(x3/3) ex+C\int x^2 e^x\,dx = (x^3/3)\,e^x + C. Show by differentiating that this is wrong.

Answer

The derivative is x2ex+(x3/3)exx^2e^x + (x^3/3)e^x, not x2exx^2e^x, so the answer is wrong (there is no product rule for integrals).

Solution
ddx[x33ex]=x2⋅ex+x33⋅ex(product rule)the extra term x33ex shows the “answer” is not an antiderivative of x2ex\begin{aligned} &\frac{d}{dx}\left[\frac{x^3}{3}e^x\right] = x^2 \cdot e^x + \frac{x^3}{3} \cdot e^x && \text{(product rule)} \\ &\text{the extra term } \tfrac{x^3}{3}e^x \text{ shows the ``answer'' is not an antiderivative of } x^2e^x \end{aligned}

The correct result, found later with integration by parts, is (x2−2x+2)ex+C(x^2 - 2x + 2)e^x + C.

Exercise 4: Polynomial antiderivative in code

Write a function polyint(c, C) that takes coefficients lowest power first and returns the antiderivative's coefficients. Test it on 3+2x+6x23 + 2x + 6x^2 with C=1C = 1.

Answer

[1, 3.0, 1.0, 2.0], i.e. 1+3x+x2+2x31 + 3x + x^2 + 2x^3.

Solution
python · try it yourself
def polyint(c, C=0):
    return [C] + [ci / (n + 1) for n, ci in enumerate(c)]

print(polyint([3, 2, 6], C=1))
[1, 3.0, 1.0, 2.0]

Test yourself

Which equation is always true?

  1. ∫f⋅g dx=(∫f dx)(∫g dx)\int f \cdot g\,dx = (\int f\,dx)(\int g\,dx)
  2. ∫(f+g) dx=∫f dx+∫g dx\int (f + g)\,dx = \int f\,dx + \int g\,dx
  3. ∫f/g dx=(∫f dx)/(∫g dx)\int f/g\,dx = (\int f\,dx)/(\int g\,dx)
  4. ∫f2 dx=(∫f dx)2\int f^2\,dx = (\int f\,dx)^2

What is ∫f′(x) dx\int f'(x)\,dx?

  1. f′(x)f'(x)
  2. f′′(x)f''(x)
  3. f(x)f(x)
  4. f(x)+Cf(x) + C

What is ∫(6x2−4) dx\int (6x^2 - 4)\,dx?

  1. 2x3−4x+C2x^3 - 4x + C
  2. 12x+C12x + C
  3. 6x3−4x+C6x^3 - 4x + C
  4. 2x3+C2x^3 + C