12. Integration#
12.1. Integration as the Opposite to Differentiation#
An informal way to introduce integration is to say that it a process which is the opposite to differentiation. That is, if a function is taken and differentiated then integration gives a way to get back to where we started.
Example 12.1
Suppose we have a function \(f(x)\) such that \(f'(x) = 3x^2 + 7x +5\). What could \(f(x)\) be?
Solution.
By looking at \(f'(x)\) term-by-term we see that one possible answer is
(since differentiating \(x^3 + \frac 72 x^2 + 5x\) gives \(3x^2+7x+5\)).
However, if we take any constant \(c\in \mathbb{R}\) then differentiating \(x^3 + \frac 72 x^2 + 5x + c\) also gives \(3x^2 + 7x + 5\) (since constant terms differentiate to give zero). Hence we find that we could have \(f(x)=x^3 + \frac 72 x^2 + 5x + c\) for any \(c\in\mathbb{R}\).
Questions like these occur frequently. We develop some useful notation.
Definition 12.1
Given a function \(g(x)\) we write \(\displaystyle \int g(x)~dx\) for the function[1] which differentiates to give \(g(x)\). In other words,
If \(f'(x)=g(x)\) then \(\displaystyle f(x)=\int g(x)~dx\).
We call \(\displaystyle \int g(x)~dx\) the indefinite integral of \(g(x)\) with respect to \(x\).
Example 12.2
Find \(\displaystyle \int (5x^3 +3x + x^{-\frac 12})~dx\).
(That is, find \(f(x)\) such that \(f(x)\) differentiates to give \(5x^3 +3x + x^{-\frac 12}\).)
Solution.
We have
Remark 12.1
Every time we calculate an indefinite integral we will get such a constant \(c\). It is very important to remember this constant, and the solution is incorrect without it. It even has a name: \(c\) is referred to as the constant of integration. It is so common that we don’t even have to write ‘for all \(c \in \mathbb{R}\)’ to indicate that this is the constant of integration.
Here’s an example that wouldn’t work if the constant of integration were forgotten.
Example 12.3
A curve \(y = f(x)\) has \(f'(x) = 3x^2 +2x +1\) and passes through the point \((2,15)\). Find the equation of the curve.
Solution.
We have
for some constant \(c\in\mathbb{R}\). As the curve goes through \((2,15)\), we substitute \(x=2, y=15\) to get \(15 = 2^3 +2^2+2+c\) so that \(c = 15-8-4-2 = 1\). Thus the curve has the equation
Here are some results we get straightaway from the fact that differentiation and integration are (nearly) ‘inverse’ to each other.
Theorem 12.1 (Rules of Integration)
We have:
\(\displaystyle \int x^n~dx = \frac{1}{n+1}x^{n+1} + c\) whenever \(n \neq -1\).
\(\displaystyle \int k f(x) dx = k \int f(x)dx\).
\(\displaystyle \int (f(x) + g(x)) dx = \int f(x) dx + \int g(x) dx\).
So, for example,
and
Note that \(n=-1\) is not included in this theorem; this will be dealt with later on.
12.2. Table of Standard Integrals#
Since we already know the derivatives of many functions, we can immediately write down an almost complete table of integrals. See Section 10.8 for comparison.
\(f(x)\) |
\(\displaystyle\int f(x) dx\) |
|---|---|
\(x^r\), \(r\neq 1\) |
\(\displaystyle\frac{1}{r+1}x^{r+1} +C\) |
\(\displaystyle\frac{1}{x}\) |
\(\ln\vert x\vert+C\) |
\(e^x\) |
\(e^x + C\) |
\(\sin x\) |
\(-\cos x + C\) |
\(\cos x\) |
\(\sin x + C\) |
\(\sec^2 x\) |
\(\tan x + C\) |
\(\displaystyle\sec x\tan x\) |
\(\sec x+C\) |
\(\text{cosec} x\cot x\) |
\(-\text{cosec} x+C\) |
\(\text{cosec}^2 x\) |
\(-\cot x+C\) |
\(\displaystyle\frac{1}{\sqrt{1-x^2}}\) |
\(\sin^{-1}x+C\) |
\(\displaystyle\frac{1}{x^2+1}\) |
\(\tan^{-1}x+C\) |
Remark 12.2
The second entry of the table, \(\displaystyle\int\frac{1}{x} = \ln|x|+C\), perhaps could do with some explanation.
Go back and review Example 9.5, as well as the remark directly following it.
There, we found that if \(x>0\), then \(\displaystyle\frac{1}{x}\) has antiderivative \(\ln(x)\), while if \(x<0\), the antiderivative of \(\displaystyle\frac{1}{x}\) is \(\ln(-x)\).
This is best captured using the modulus function. Recall that this was defined
This means that \(\ln|x|\) is the function that returns \(\ln(x)\) when \(x>0\), and \(\ln(-x)\) when \(x<0\). At \(x=0\), it is not defined.
Fig. 12.1 Graph of \(y=\ln|x|\)#
We want the function \(\displaystyle\int\frac{1}{x}dx\) to be defined on as large a set of \(x\) values as possible.
So while \(\displaystyle\int \frac{1}{x}dx = \ln(x)+C\) may be true when \(x>0\),
is the most widely applicable statement. So remember you modulus signs!
Warning
Forgetting to write the modulus signs around the \(x\) makes the integration incorrect and you will lose marks for it!
Example 12.4
Calculate
(i) \(\displaystyle\int\left(3e^x-\sin(x)+4\sqrt{x}-\frac{5}{x}\right)dx\),
(ii) \(\displaystyle\int\left(\frac{5}{1+x^2}-\frac{4}{\sqrt{1-x^2}}+9\right)dx\),
(iii) \(\displaystyle\int\sec(x)\big(\sec(x)-\tan(x)\big)dx\).
**Solution.*
(i) We use the linearity rule for integrals (Theorem 12.1) and integrate term by term. We get:
(ii) \(\displaystyle\int\left(\frac{5}{1+x^2}-\frac{4}{\sqrt{1-x^2}}+9\right)dx = 5\tan^{-1}(x)-4\sin^{-1}(x)+9x+C\).
(iii) Sometimes, it helps to expand brackets first.
12.3. Relating Integration to Area#
Consider the function \(y = x^2\) and let \(x \geq 0\) be a typical \(x\)-coordinate. Let \(A(x)\) be the area under the curve from \(0\) up to \(x\).
Fig. 12.2 The area function for the standard quadratic \(y=x^2\).#
Note that we should really be more precise here: by “the area under the curve” we will always mean the area between the \(x\)-axis and the curve. The question is, how can we find the function \(A(x)\)?
We will attempt to find \(A(x)\) by first finding its derivative, \(A'(x)\). From earlier in the course we know that
when \(h\) is small.
Now, \(A(x+h)\) is the area \(A(x)\) plus the area under the curve which lies between \(x\) and \(x+h\). Hence \(A(x+h) - A(x)\) is just this extra area. If \(h\) is small, then this area will nearly be a rectangle of width \(h\) and height \(x^2\).
Fig. 12.3 Comparing \(A(x)\) and \(A(x+h)\)#
Hence we have \(A(x+h)-A(x)\approx x^2h\) so that
As \(h \rightarrow 0\) the approximations become negligible, so that
So, we have \(A'(x)=x^2\) and hence, from the above theorems,
for some constant \(c\). Further, when \(x=0\) we must have \(A(x)=0\) (because the area under the curve between \(x=0\) and \(x=0\) is zero!) so that \(0=\frac{1}{3}.0 + c\) and so \(c=0\). Hence we have our result:
Example 12.5
Find the area \(S\) under the curve \(y = x^2\) which lies between \(x=2\) and \(x=5\).
Solution.
Let \(A(x)\) be as before. Then \(S = A(5) - A(2)\). But we know that \(A(x) = \frac{x^3}{3}\) so that
(We can check this result on a picture of \(y=x^2\): the area \(S\) consists of a rectangle of length \(3\) and height \(4\) with a “triangle” on top of it of base \(3\) and height \(5^2-2^2=21\).
Fig. 12.4 Approximating \(S\) by a rectangle and triangle#
So we can approximate that
That we are a bit over the real result is not a surprise when you look at the picture.)
12.4. Fundamental Theorem of Calculus#
Suppose that we replaced the curve \(y=x^2\) in the above working with any general curve \(y=f(x)\). Then, as long as \(f(x)\) is “smooth enough” (every function in this course will be) we would get out a similar result: if \(A(x)\) is the area under the curve \(y=f(x)\) from \(0\) up to \(x\) then the derivative of \(A(x)\) is just \(f(x)\). Or, to rephrase this, the rate of change of the area under the curve \(y=f(x)\) with respect to \(x\) is \(f(x)\). This result is very important, and we state it as the following theorem.
Theorem 12.2 (Fundamental Theorem of Calculus)
Let \(y = f(x)\) and let \(A(x)\) be the area under the curve from \(0\) up to \(x\). Then \(A'(x) = f(x)\).
The main application of this theorem is to allow us to calculate the area under curves.
Example 12.6
Find the area \(S\) under the curve \(y = x^3 + 7x +5\) between \(x=1\) and \(x=3\).
Solution.
Let \(A(x)\) be the area under the curve from \(0\) up to \(x\). Then \(A'(x) = x^3 +7x +5\) by the Fundamental Theorem of Calculus. Hence,
for some constant \(c\). Now,
Remark 12.3
In the above example, we had to find an integral then evaluate it at two \(x\)-coordinates (in our case it was \(x=1\) and \(x=3\)). This is a common procedure, especially when trying to find areas under curves. We develop some notation for this process.
Definition 12.2
An integral which is evaluated between two values for \(x\) is called a definite integral. We use the notation
to mean the value of the integral at \(x=b\) minus the value of the integral at \(x=a\) and call it “the integral from \(a\) to \(b\)”. The numbers \(a\) and \(b\) are called the limits of the definite integral.
Example 12.6 Revisited.
We use the above notation plus some further notation — square brackets. Somehow it would be nice to be able to combine our working out of the integral and putting values in in such a way that it is easy to do. (My brain is not up to remembering the integral and the values to put in at the same time!) So in order to find the area under the curve \(y=x^3 + 7x + 5\) between \(x=1\) and \(x=3\), we write
Note that what appears in the square brackets is result of doing the integration, but the constant of integration is omitted. The reason for this is that the constant will always cancel itself out so we choose to make things simpler by leaving it out.
Remark 12.4
The constant of integration can only be left out when working with a definite integral (that is, one with limits).
For indefinite integrals (i.e.~ones without limits) it must always be included.
In an indefinite integral our limits may be negative. Normally we have that the top limit is greater than the bottom limit.
Example 12.7
Find the area enclosed by the \(x\)-axis, the curve \(y=4x^3\) and the straight lines \(x = 1\) and \(x = 2\).
Solution.
This is the same as asking for the area \(S\) under the curve \(y=4x^3\) between \(x=1\) and \(x=2\). Hence we get
12.5. Areas below the \(x\)-axis: Negative areas#
Example 12.8
Find \(I = \displaystyle \int_1^2 (3x^2 - 8x)dx\).
Solution.
We have
How can an area be negative? Let’s look at the curve in question.
Fig. 12.5 Graph of \(y=3x^2-8x\) with shaded area between \(x=1\) and \(x=2\).#
We see that the area we are interested in lies under the \(x\)-axis. This is an example of a general fact: if an area lies under the \(x\)-axis, it has a negative sign.
Warning
Areas and Integrals don’t always agree.
Suppose we are interested in an area which lies part over and part under the \(x\)-axis. Then, to calculate the area using integration, we must split it into sections: one integral for each part above the axis and one for each part below.
Example 12.9
Calculate the area enclosed by the curve \(y=x^3-x\) and the \(x\)-axis between \(x=-1\) and \(x=1\).
Solution.
With these type of questions it is best to start with a sketch of the function.
Fig. 12.6 Graph of \(y=x^3-x\) with shaded region between \(x=-1\) and \(x=1\).#
If we evaluate \(I=\displaystyle \int_{-1}^1(x^3-x)dx\) we get
which clearly doesn’t calculate the area correctly. What has happened is that the area below the \(x\)-axis has cancelled out that which is above.
To counteract this, we split the calculation into \(\displaystyle I_1= \int_{-1}^0(x^3-x)dx\) and \(\displaystyle I_2=\int_0^1(x^3-x)dx\). Then the area between \(x=-1\) and \(x=0\) is given by \(I_1\), the are between \(x=0\) and \(x=1\) is given by \(-I_2\) (since \(I_2\) will be negative) and hence the total area is
This highlights an important fact: there is a difference between a definite integral and the area it is used to calculate.
12.6. Other areas#
There may be other areas which we want to calculate which don’t lie either directly above or directly below a curve.
Example 12.10
Find the shaded area \(S\) lying over the curve \(y = x^2+x\) and bounded by \(x = 1\), \(x = 2\) and \(y= 6\).
Solution.
We first sketch the curve: \(y=x(x+1)\) so the curve cuts the \(x\)-axis at \(-1\) and \(0\). Note that when \(x=2\), \(y=2^2+2=6\). We get the following graph.
Fig. 12.7 Graph of \(y=x^2+x\) with shaded regions \(S\) and \(T\).#
Let \(T\) be the area under the curve between \(x=1\) and \(x=2\). Then \(S+T\) is the area of the rectangle with length \(1\) and height \(6\). Hence \(S+T = 6\). We can easily find \(T\) by integration:
Thus \(\displaystyle S = 6 - T = 6- \frac{23}{6} = \frac {36}{6} - \frac{23}{6} = \frac{13}{6}\).
Example 12.11
Find the area of the region between \(y = x^2\) and \(y = 2x\).
Solution.
We start by drawing both curves to get an idea what the picture looks like.
Fig. 12.8 Area bounded by \(y=x^2\) and \(y=2x\).#
Let \(S\) be the required area. To find \(S\) we will use integration.
First we need to find the limits for our integral. These are the points where the two graphs intersect. Solving \(x^2 = 2x\) we get \(x(x-2)=0\) so that \(x = 0\) or \(x = 2\). Hence we will be integrating between \(x = 0\) and \(x = 2\).
Now \(S\) is given by taking the area under the curve \(y = x^2\) between \(0\) and \(2\) from the area under the curve \(y = 2x\) between \(0\) and \(2\). Thus