Integration

Integration may be seen as the inverse process of differentiation. If we differentiate $y=4x^3+5$ we get $dy/dx=12x^2$, so if we integrate $12x^2$ we should get something like $4x^3+5$.

When we differentiate $4x^3$ we multiply the coefficient, $4$, by the exponent, $3$, then reduce the exponent by $1$: $\dfrac{d}{dx}(4x^3) = 3 \times 4x^2 = 12x^2$.

To integrate $12x^2$ we increase the exponent by $1$ then divide by the new exponent: $\int 12x^2\,dx = 12x^3 / 3 = 4x^3$.

But what happened to the $5$? When we differentiate a constant like $5$ we get zero, and when we integrate zero we don't know what we get — so we call it $C$, the constant of integration. We won't know the value of $C$ until we know the boundary conditions.

Integrating Polynomial Expressions

The process of differentiation multiplies each coefficient by the exponent of the $x$ term and then reduces the exponent by $1$. The process of integration is the reverse: increase the exponent of each $x$ term by $1$, then divide the coefficient by the new exponent (and add $C$).

Example 1: Integrate $y=12x^3+6x^2+4x+5$ with respect to $x$.

$\int y\,dx$$=$$\dfrac{12x^4}{4}+\dfrac{6x^3}{3}+\dfrac{4x^2}{2}+5x+C$
 $=$$3x^4+2x^3+2x^2+5x+C$

Sanity check: differentiating $3x^4+2x^3+2x^2+5x+C$ gives $12x^3+6x^2+4x+5$ ✓

This is called an indefinite integral because we do not know the value of $C$. We keep $C$ until we can evaluate it using the boundary conditions.

Table of Common Standard Integrals

$y=f(x)$$\int f(x)\,dx = F(x)$
$x^n$$\dfrac{x^{n+1}}{n+1}+C$  ($n \ne -1$)
$x^{-1}$$\ln|x|+C$
$\sin(ax)$$-\cos(ax)/a+C$
$\cos(ax)$$\sin(ax)/a+C$
$\tan(ax)$$\ln(\sec(ax))/a+C$
$e^{ax}$$e^{ax}/a+C$
$\ln(ax)$$x(\ln(ax)-1)+C$

Example 2: $\int \cos(2x)\,dx = \dfrac{\sin(2x)}{2}+C$.

Sanity check: $\dfrac{d}{dx}\left(\dfrac{\sin(2x)}{2}\right) = 2 \times \dfrac{\cos(2x)}{2} = \cos(2x)$ ✓

Example 3: $\int \sin(3x)\,dx = \dfrac{-\cos(3x)}{3}+C$.

Sanity check: $\dfrac{d}{dx}\left(\dfrac{-\cos(3x)}{3}\right) = 3 \times \dfrac{\sin(3x)}{3} = \sin(3x)$ ✓

Example 4: $\int e^{3x}\,dx = e^{3x}/3+C$.

Sanity check: $\dfrac{d}{dx}\left(e^{3x}/3\right) = 3e^{3x}/3 = e^{3x}$ ✓

Integration by Substitution (Reverse Chain Rule)

Expressions that include a function of a linear factor may be integrated using a substitution. To integrate $(3x+4)^5$ we let $3x+4=u$. Differentiating, $du/dx=3$ so $dx=du/3$:

$I$$=$$\int (3x+4)^5\,dx = \dfrac{1}{3}\int u^5\,du$
 $=$$\dfrac{1}{3}\dfrac{u^6}{6}+C = \dfrac{(3x+4)^6}{18}+C$

Example 5: $I=\int (4x-3)^3\,dx$. Let $u = 4x-3$ so $dx = du/4$.

$I$$=$$\dfrac{1}{4}\int u^3\,du = \dfrac{1}{4}\dfrac{u^4}{4}+C = \dfrac{(4x-3)^4}{16}+C$

Sanity check: $\dfrac{d}{dx}\left(\dfrac{(4x-3)^4}{16}\right) = \dfrac{4(4x-3)^3}{16} \times 4 = (4x-3)^3$ ✓

Example 6: $I=\int \dfrac{4}{2x-3}\,dx$. Let $u = 2x-3$ so $dx = \tfrac{1}{2}du$.

$I$$=$$4\int \dfrac{1}{2u}\,du = 2\int \dfrac{1}{u}\,du = 2\ln|2x-3|+C$

Sanity check: $\dfrac{d}{dx}\left(2\ln(2x-3)\right) = 2 \times \dfrac{1}{2x-3} \times 2 = \dfrac{4}{2x-3}$ ✓

Definite Integration

Definite integration is where we integrate between two limits, giving the area between the curve and the axis. Consider $y=x^2+2$ integrated between $x=1$ and $x=2$ (the shaded area in Fig 1).

Graph of x^2+2
Fig 1 Graph of $x^2+2$

There is no constant of integration — the limits remove any uncertainty. We find the value at the upper limit and subtract the value at the lower limit:

$I$$=$$\int^2_1 (x^2+2)\,dx = \dfrac{x^3}{3}+2x\ \Biggr|_{1}^{2}$
 $=$$\left(\dfrac{8}{3}+4\right)-\left(\dfrac{1}{3}+2\right) = \dfrac{20-7}{3} = \dfrac{13}{3}$

Example 9: $\int^{\pi/2}_0 \cos(\theta)\,d\theta = \sin(\theta)\ \Biggr|_{0}^{\pi/2} = 1 - 0 = 1$.

What if we integrated $\cos(\theta)$ from $\pi/4$ to $3\pi/4$ (Fig 2)?

Graph of sin(theta)
Fig 2 Graph of $\sin(\theta)$
$I$$=$$\sin(\theta)\ \Biggr|_{\pi/4}^{3\pi/4} = 0.7071 - 0.7071 = 0$

which is clearly not right — the shaded area is not zero. The curve is symmetrical about $\pi/2$, so we calculate the area between $\pi/4$ and $\pi/2$ and double it:

$I$$=$$\sin(\theta)\ \Biggr|_{\pi/4}^{\pi/2} = 1 - 0.7071$
area$=$$2 \times 0.2929 = 0.59$

When a curve crosses the axis within the limits, integrate each piece separately so positive and negative areas don't cancel.