Topic 12 Integration

12.1 Introduction

Integration is the reverse of differentiation. If you recognise what you have as the derivative of something, you’re pretty much done. Unfortunately life is not normally that simple, so there are various techniques which can be used.

12.2 Indefinite integration

Integration of a function \(\mathrm{f}(x)\) with respect to x is written

\[\int \mathrm{f}(x)\, dx\]

E.g.

\[\int \cos(x)\,dx\]

means “the integral of \(\cos(x)\) with respect to x.”

Just as with differentiation, we can produce a table of standard integrals:

\(\mathrm{f}(x)\) \(\int \mathrm{f}(x)\, dx\)
\(x^n\) \(\frac{x^{n+1}}{n+1}\qquad n \ne -1\)
\(\frac{1}{x}\) \(\ln|x|\)
\(e^x\) \(e^x\)
\(\sin(x)\) \(-\cos(x)\)
\(\cos(x)\) \(\sin(x)\)
\(\sec^2(x)\) \(\tan(x)\)
\(\tan(x)\) \(\ln|\sec(x)|\)
\(\cot(x)\) \(\ln|\sin(x)|\)

E.g.

\[\int x^3 dx = \frac{x^4}{4} + c\]

where c is a constant — the derivative of a constant is 0, so we always have to add a constant when we integrate; the value of the constant would need to be determined from other information.

E.g. if \(\frac{dy}{dx} = x^4\)

\[\begin{align} y &= \int x^4 dx\\ &= \frac{x^5}{5} + c \end{align}\]

Multiplying by a constant just multiplies the answer by the same constant:

E.g. if \(\frac{dy}{dx} = 3x^4\)

\[\begin{align} y &= \int 3 x^4 dx\\ &= 3 \int x^4 dx\\ &= 3 \frac{x^5}{5} + c\\ &= \frac{3}{5}x^5 + c \end{align}\]

The integral of the sum of two functions is the sum of their integrals:

E.g. if \(\frac{dy}{dx} = 3x^4 + \cos(x)\)

\[\begin{align} y &= \int 3x^4 + \cos(x) dx\\ &= \frac{3}{5}x^5 + \sin(x) + c \end{align}\]

Note that the integral of the product of two functions is not the product of their integrals — see integration by parts later.

12.3 Finding the equation of a curve

In the last section we looked at indefinite integration, and were left with an unknown constant, normally written as c. In practice we would like to know that constant. If we know one point the curve goes through, we can determine it.

E.g. if \(\frac{dy}{dx} = 3x^4\), and \(y=4\) when \(x=1\) we get

\[\begin{align} y &= \int 3 x^4 dx\\ &= \frac{3}{5}x^5 + c \end{align}\]

and the putting \(y=4\) when \(x=1\) in gives

\[\begin{align} 4 &= \frac{3}{5}(1)^5 + c\\ &= \frac{3}{5} + c\\ c &= \frac{17}{5} \end{align}\]

which gives us the equation of the curve as

\[y= \frac{3}{5}x^5 + \frac{17}{5}\]

12.4 Definite Integration

Apart from giving us the equations of curves, integration gives us the area under a curve.

E.g. The area under the curve of \(y=x^2\) between \(x=2\) and \(x=4\) is done by:

  1. Find the integral of \(x^2\).
  2. Evaluate the integral at \(x=4\) and subtract the integral evaluated at \(x=2\)

\[\begin{align} A &= \int_{0}^{2} x^2 dx\\ &= \left[\frac{x}{2}\right]_0^2\\ &= \left(\frac{4^2}{2}\right) - \left(\frac{2^2}{2}\right)\\ &= \left(\frac{16}{2}\right) - \left(\frac{4}{2}\right)\\ &= 8 - 2\\ &= 6 \end{align}\]

This is called the definite integral. Note that as you are subtracting the integral evaluated at two points, there’s no need for \(+c\) as this would just cancel out.

12.5 Integration by substitution

Suppose I want to do \(\int \sin(2x) dx\). If I were differentiating I would use the chain rule, with substitution \(u=2x\), and then differentiate with respect to u. We can do a similar thing with integration.

  • Set \(u=2x\) and differentiate to give

\[\frac{du}{dx} = 2\]

  • Rearrange to get dx in terms of du

\[dx = \frac{1}{2} du\] * Substitute this into the the integral, and rewrite the integral in terms of u

\[\begin{align} \int \sin(2x) dx &= \int \sin(u) \frac{1}{2} du\\ &= \frac{1}{2}\int \sin(u) du \end{align}\]

  • Do the integration

\[\frac{1}{2}\int \sin(u) du = -\frac{1}{2}\cos(u) + c\]

  • Rewrite in terms of x

\[-\frac{1}{2}\cos(u)+c = -\frac{1}{2}\cos(2x)+c\]

So our solution is

\[\int \sin(2x) dx = -\frac{1}{2}\cos(2x)+c\]

This is known as substitution or change of variable, and is one of the most common integration techniques. It is not guaranteed to transform the integral into one you can do, but is generally a good place to start unless another technique jumps out.

The method is:

  1. Identify a suitable substitution, which may make the integral easier, and write it as \(u = ...\) or \(x = ...\).
  2. Differentiate the equation from part 1 and, treating dx and du as if they are variables, rearrange to get dx in terms of du.
  3. Rewrite the integral in terms of u and du.
  4. Do the integration.
  5. Rewrite the result in terms of x.

E.g. \(\int (3x+2)^5 dx\)

  1. Let \(u=3x+2\)
  2. \(\frac{du}{dx} = 3\) gives \(dx = \frac{1}{3} du\)
  3. The integral now becomes \(\int u^5 \frac{1}{3} du\)
  4. Which becomes, on integration \(\frac{1}{18}u^6+c\)
  5. Giving \(\int (3x+2)^5 dx = \frac{1}{18}(3x+2)^6 + c\)

The hardest part of the method is deciding which substitution to make, and that is best learnt by looking at lots of examples, and trying lots of problems. Here are some more examples:

E.g. \(\int x\cos(x^2)dx\)

  1. Let \(u=x^2\)
  2. \(dx = \frac{1}{2x} du\)
  3. \[\begin{align} \int x\cos(x^2)dx &= \int x\cos(u) \frac{1}{2x} du\\ &= \int \cos(u) \frac{x}{2x} du\\ &= \frac{1}{2} \int \cos u du \end{align}\]
  4. Which integrates to \(\frac{1}{2}\sin(u) + c\)
  5. Giving \(\int x\cos(x^2)dx = \frac{1}{2}\sin(x^2) + c\)

E.g. \(\int \frac{x}{x+1} dx\)

  1. Let \(u=x+1\)
  2. \(dx = du\)
  3. \[\begin{align} \int \frac{x}{x+1} dx &= \int \frac{u-1}{u} dx\\ &= \int 1 - \frac{1}{u} du \end{align}\]
  4. Which integrates to \(u - \ln|u| + c\)
  5. Giving \[\begin{align} \int \frac{x}{x+1} dx &= (x+1) - \ln|x+1| + c\\ &= x - \ln|x+1| + 1 +c\\ &= x - \ln|x+1| + d \end{align}\] where \(d=1+c\) as c is a constant to be determined, and 1 is another constant, so they might as well be combined into another constant to be determined.

E.g. \(\int \frac{\cos x}{\sin x} dx\)

  1. Let \(u = \sin x\)
  2. \(dx = \frac{1}{\cos x} du\)
  3. \[\begin{align} \int \frac{\cos x}{\sin x} dx &= \int \frac{\cos x}{u} \frac{1}{\cos x} du\\ &= \int \frac{1}{u} \frac{\cos x}{\cos x} du\\ &= \int \frac{1}{u} du \end{align}\]
  4. Which integrates to \(\ln|u| +c\)
  5. Giving \(\int \frac{\cos x}{\sin x} dx = \ln|\sin(x)| + c\)

E.g. \(\int \cos(x)\sin^2(x) dx\)

  1. Let \(u = \sin(x)\)
  2. \(dx = \frac{1}{\cos(x)}du\)
  3. \(\int \cos(x)\sin^2(x) dx = \int u^2 du\)
  4. The integration gives \(\frac{u^3}{3} + c\)
  5. Giving \(\int \cos(x)\sin^2(x) dx = \frac{\sin^3(x)}{3} + c\)

12.6 Shortcut: Integration of \(\frac{\mathrm{f(x)}'}{\mathrm{f(x)}}\)

In the last section one of the examples was

\[\int \frac{\cos x}{\sin x} dx = \ln|\sin(x)| + c\] This is an example of a more general case: if you are integrating a fraction, and the numerator is the derivative of the denominator, the result will be the logarithm of the denominator. I.e.

\[ \int \frac{\mathrm{f(x)}'}{\mathrm{f(x)}} dx = \ln|\mathrm{f(x)}| + c\] E.g.

\[\int \frac{2x}{x^2+1} dx = \ln|x^2+1| + c\]

\[ \int \frac{\cos(x)}{\sin(x) + 1} dx = \ln|sin(x)+1| + c\]

Sometimes you may need to do a bit of manipulation to get the numerator to be the derivative of the denominator.

E.g.

\[\begin{align} \int \frac{x}{x^2+1} dx &= \frac{1}{2} \int \frac{2x}{x^2+1}\\ &= \frac{1}{2} \ln|x^2+1| + c \end{align}\]

12.7 Using trigonometric identities

Many integrals are made easier by using trigonometric substitutions. As a recap, here are a few useful ones:

\[\begin{align} \cos^2(x) + \sin^2(x) &= 1\\ 1 + \tan^2(x) &= \sec^2(x)\\ \cot^2(x) + 1 &= \mathrm{cosec}^2(x)\\ \sin^2(x) &= \frac{1}{2}{1-\cos(2x)}\\ \cos^2(x) &= \frac{1}{2}{1+\cos(2x)} \end{align}\]

E.g. \[\begin{align} \int \cos^2(x) dx &= \frac{1}{2} \int 1+\cos(2x) dx\\ &= \frac{1}{2} (x + \frac{1}{2}\sin(2x)) + c \end{align}\]

E.g. \[\begin{align} \int \tan^2(x) dx &= \int \sec^2(x) - 1 dx\\ &= \tan(x) - x + c \end{align}\]

12.8 Partial fractions

When presented with an integral consisting of a polynomial divided by a polynomial, and the numerator isn’t easily made into the derivative of the bottom, c.f. Shortcut 1, the method of partial fractions (dealt with elsewhere) can be used to split the fraction into simpler fractions which are generally easier to integrate.

12.9 Integration by parts

If your integrand is the product of two functions, and none of the other approaches seems likely to work, you can use integration by parts. This allows you to rewrite your integral in a, hopefully, simpler form, by making use of the equation:

\[ \int u \frac{dv}{dx} dx = uv - \int v \frac{du}{dx} dx \]

E.g. \(\int x\cos x dx\) is the product of \(x\) and \(\sin x\).

  • Let \(u=x\) and \(\frac{dv}{dx} = \cos x\)
  • This gives \(\frac{du}{dx} = 1\) and \(v=\sin x\)
  • So we now have:

\[\int x \cos x dx = x\sin x - \int \sin x \times 1 dx \] * Doing the integral the gives us:

\[\int x \cos x dx = x\sin x + \cos x + c \]

E.g \(\int x\ln x dx\) is the product of x and \(\ln x\).

  • Let \(u=\ln x\) as we don’t know how to integrate \(\ln x\) and \(\frac{dv}{dx} = x\)
  • This gives \(\frac{du}{dx} = \frac{1}{x}\) and \(v = x^2\). So we now have

\[\int x\ln x dx = x^2\ln x - \int x^2 \times \frac{1}{x} dx\]

  • This simplifies to

\[\int x\ln x dx = x^2\ln x - \int x dx\]

  • Doing the integral gives:

\[\int x\ln x dx = x^2\ln x - \frac{x^2}{2} + c\]

In general the procedure is:

  1. Choose u and \(\frac{dv}{dx}\).
  • u gets differentiated, so, as differentiation is easier than integration, either of the two terms in the product could be chosen.
  • \(\frac{dv}{dx}\) gets integrated, so it has to be something you know how to integrate.
  • If you can integrate both factors, chosse u as the one which becomes simpler when differentiated.
  1. Calculate \(\frac{du}{dx}\) and v.
  2. Plug them into the general formula.
  3. Do the final integral on the right hand side.

E.g. \(\int x e^x dx\)

  1. Both x and \(e^x\) can be integrated, but x becomes simpler when differentiated, so choose \(u=x\), \(\frac{dv}{dx}= e^x\).
  2. \(\frac{du}{dx} = 1\), \(v = e^x\).
  3. This gives \[\int x e^x dx = xe^x - \int e^x dx\]
  4. So, finally, giving \[\int x e^x dx = xe^x - e^x + c\]

Remember that 1 is always a factor, so if there isn’t an obvious choice for \(\frac{dv}{dx}\), you could use 1.

E.g. \(\int \ln x dx\)

  1. If we could integrate \(\ln x\) we wouldn’t need to use integration by parts. It doesn’t look like a product, but could be written as \(1 \times \ln x dx\), so choose \(u=\ln x\), \(\frac{dv}{dx} = 1\).
  2. This gives \(\frac{du}{dx} = \frac{1}{x}\), \(v = x\).
  3. Which converts the integral to \[\int \ln x dx = x\ln x - \int x \frac{1}{x} dx\]
  4. Giving \[\int \ln x dx = x\ln x - x + c\]