MAT1001 Differential Calculus: Lecture Notes
Chapter 4 Integration
Integration: The inverse process to differentiation, i.e. the process of finding a function with a derivative that is a given function.
Penguin Dictionary of Mathematics
4.1 Integration and antiderivatives
As the above quote from the Penguin Dictionary of Mathematics says, integration is the reverse process to differentiation. If differentiation is all about finding the rates of change of functions then we an think of integration as being about the areas under curves.
As with differentiation it is a process that was discovered to handle problems from physics so you can find plenty of examples of applications by looking into topics from mechanics. We may meet some of those at the end of this chapter, but for now we will focus on the
mathematics.
The integral of a function over an interval is a measure of the signed area between the curve and the \(x\)-axis, with the convention that areas above the \(x\)-axis are positive and areas under the \(x\)-axis are negative. This is shown for \(f(x)=\sin (x)\) between
\(0\) and \(3\uppi /2\) in fig. 4.1. When we discuss numerical methods of integration in chapter 6 we will understand how to
approximate these areas using thin rectangles as is shown in fig. 1.4.
For now we will approach integration as the reverse of differentiation. In other words, if we have a function \(f(x)\) we want to find the function whose derivative is \(f(x)\).
-
Example 4.1. If we have the function
\(\seteqnumber{0}{4.}{0}\)\begin{equation*} f(x)=x^{4}+2x^{2}+2 \end{equation*}
what function is this the derivative of?
To find this we need to remember our rules for differentiation, in particular the monomial rule of eq. (3.10), which says that we need to find an \(x^{n}, x^{m}\) and an \(x^{p}\) such that
\(\seteqnumber{0}{4.}{0}\)\begin{align*} \frac {\ud (ax^{n})}{\ud x}&=anx^{n-1}=x^{4},\\ \frac {\ud (bx^{m})}{\ud x}&=bmx^{m-1}=2x^{2},\\ \frac {\ud (cx^{p})}{\ud x}&=cpx^{p-1}=2. \end{align*}
By observation we find that \(n=5, a=1/5\), \(m=3, b=2/3\), \(p=1\) and \(c=2\). Thus if we have the function
\(\seteqnumber{0}{4.}{0}\)\begin{equation*} F(x)=\frac {1}{5}x^{5}+\frac {2}{3}x^{3}+2x, \end{equation*}
its derivative is \(F'(x)=f(x)\).
This looks like we are done. However, recall that in eq. (3.9) we said that the derivative of a constant is zero. Thus we could add any constant to \(F(x)\) and still have a function whose derivative is \(f(x)\). This means that we should write
\(\seteqnumber{0}{4.}{0}\)\begin{equation*} F(x)=\frac {1}{5}x^{5}+\frac {2}{3}x^{3}+2x+c, \end{equation*}
where \(c\) can be any constant such as \(0, 10, \uppi , 11/25, -2, \dots \) , when we have our brief discussion in chapter 5, we will see that often there are conditions that we need to apply which determine the constant.
Notice that since the constant in the example is arbitrary there are actually an infinite number of \(F(x)\)’s such that their derivative is the given \(f(x)\). We call such functions \(F(x)\) antiderivatives of \(f(x)\).
As an aside, you might be wondering why a constant shows up here, but we did not mention anything about a constant when giving the intuition of an integral as the area under a curve. Surely the area is a fixed concept and cannot be arbitrarily changed by a constant?
This is true. The difference is because when we talked about the area under a curve, we specified a region of the \(x\)-axis that we were interested in.
This leads to what is called a definite integral which we will study in more detail later. When we are constructing an antiderivative like \(F(x)\), we are not specifying any limits which is why we need to add the constant. You will gain more experience with this
as we look at some more examples.
In general we say that given a function \(f(x)\), an antiderivative of \(f(x)\) is any function \(F(x)\) such that
\(\seteqnumber{0}{4.}{0}\)\begin{equation} \frac {\ud F}{\ud x}=f(x). \label {eq: antiderivative} \end{equation}
When we are explicitly including the arbitrary constant \(c\) we refer to the indefinite integral of \(f(x)\) denoted by
\(\seteqnumber{0}{4.}{1}\)\begin{equation} \int f(x) \ud x=F(x)+c. \label {eq: indefinite integral} \end{equation}
The symbol \(\int \) is the integral or integration symbol and in the above expression \(f(x)\) is called the integrand, the function being integrated, while \(x\) is called the integration variable and \(c\) is the constant of
integration.
As with many things in this module, the easiest way to get to grips with the content and the new terminology is through solving example problems.
-
Example 4.2. The indefinite integral
\(\seteqnumber{0}{4.}{2}\)\begin{equation*} \int \left (x^{4}+2x^{2}+2\right )\ud x \end{equation*}
is calculated as in the same way as the antiderivative above. Thus we have
\(\seteqnumber{0}{4.}{2}\)\begin{equation*} \int \left (x^{4}+2x^{2}+2\right )\ud x=\frac {1}{5}x^{5}+\frac {2}{3}x^{3}+2x+c. \end{equation*}
It is important to include the \(\ud x\) after the \(\int \) so that it is clear what is being integrated over. I also like to put brackets round the integrand when it involves multiple terms to make it unambiguous what is being integrated over.
Warning! If you are asked to calculate an indefinite integral you must include the constant of integration for your answer to be counted as correct.
Note that the integral has several nice properties which we will not prove here:
\(\seteqnumber{0}{4.}{2}\)
\begin{align}
\int c f(x) \ud x &= c\int f(x) \ud x, \label {eq: integral scalar multiplication}\\ \int \left (-f(x)\right )\ud x&=-\int f(x)\ud x, \\ \int \left (f(x)\pm g(x)\right )\ud x &=\int f(x)\ud x \pm \int g(x)\ud x. \label {eq:
integral of sum}
\end{align}
These are analogous to eqs. (3.3) to (3.5) for
the derivative. We have implicitly been using them already.
Note that for all of the functions that we know the derivative of we now know the integral of by reversing the identities so we have that
\(\seteqnumber{0}{4.}{5}\)\begin{align*} \int \cos (x)\ud x &=\sin (x) +c,\\ \int \sin (x) \ud x &=-\cos (x)+c,\\ \int \frac {1}{x}\ud x &=\ln (x) +c,\\ \int e^{x}\ud x &=e^{x}+c. \end{align*}
We can also invert the identity that
\(\seteqnumber{0}{4.}{5}\)\begin{equation*} \frac {\ud x^{n}}{\ud x}=nx^{n-1} \end{equation*}
to be
\(\seteqnumber{0}{4.}{5}\)\begin{equation} \int x^{n}\ud x =\frac {1}{n+1}x^{n+1} +c \label {eq: integral of monomial} \end{equation}
which holds for \(n\neq -1\).
-
Example 4.3. We know that the derivative of \(\tan (x)\) is \(\sec ^{2}(x)\) which means that the antiderivative of \(\sec ^{2}(x)\) is
\(\seteqnumber{0}{4.}{6}\)\begin{equation*} F(x)=\tan (x), \end{equation*}
and the indefinite integral is thus
\(\seteqnumber{0}{4.}{6}\)\begin{equation*} \int \sec ^{2}(x)\ud x = \tan (x)+c. \end{equation*}
The process of calculating an integral by finding the antiderivative as the reverse of differentiation is sometimes called integration by inspection. This is very useful when you have a simple enough function that you already know what you differentiate to get
it.
-
Example 4.6. Using some of the standard integrals that we have given above we evaluate
\(\seteqnumber{0}{4.}{6}\)\begin{equation*} \int \left (x^{2}+x^{-3}+x^{-1}\right )\ud x \end{equation*}
as follows:
\(\seteqnumber{0}{4.}{6}\)\begin{align*} \int \left (x^{2}+x^{-3}+x^{-1}\right )\ud x&=\int x^{2}\ud x+\int x^{-3}\ud x+\int x^{-1}\ud x\\ &=\frac {1}{3}x^{3}-\frac {1}{2}x^{-2}+\ln (x) +c\\ &=\frac {x^{3}}{3}-\frac {1}{2x^{2}}+\ln (x)+c. \end{align*} Note that here we have used eq. (4.6) for both the positive and negative power terms.
4.2 Techniques for integration
Integration by substitution
Now that we know the basics of how to calculate indefinite integrals we can introduce some common techniques. The first of these is integration by substitution, which is a way to integrate more complicated expressions by making them look like expressions
that we already know how to integrate.
The idea behind integration by substitution is to consider an integral like
\(\seteqnumber{0}{4.}{6}\)\begin{equation*} I= \int 3x^{2}\sqrt [3]{x^{3}+4}\ud x. \end{equation*}
We then observe that if we let \(u=x^{3}+4\) and differentiate \(u\) with respect to \(x\) we get
\(\seteqnumber{0}{4.}{6}\)\begin{equation*} \frac {\ud u}{\ud x}=3x^{2}. \end{equation*}
Then we see that we can rewrite \(I\) as
\(\seteqnumber{0}{4.}{6}\)\begin{equation*} I=\int \frac {\ud u}{\ud x}\sqrt [3]{u}\ud x. \end{equation*}
Remember back in chapter 3 we said that in certain circumstances we could treat a derivative as a bit like a fraction, well we can do this under an integral sign. It turns out that if we define a function \(u(x)\) then integrating over \(u\) is related to integrating over \(x\) in the following way
\(\seteqnumber{0}{4.}{6}\)\begin{equation} \int f(u)\ud u=\int f(u(x))\frac {\ud u}{\ud x}\ud x. \label {eq: measure change of variable} \end{equation}
This means that in our above integral we can rewrite \(\frac {\ud u}{\ud x}\ud x=\ud u\) so that
\(\seteqnumber{0}{4.}{7}\)\begin{equation*} I=\int \frac {\ud u}{\ud x}\sqrt [3]{u}\ud x=\int \sqrt [3]{u}\ud u=\frac {3}{4}u^{\frac {4}{3}}+c=\frac {3}{4}\left (x^{3}+4\right )^{\frac {4}{3}}+c. \end{equation*}
This is the same recipe that we will always use when integrating by substitution:
-
• Simplify the integrand as much as possible.
-
• Guess at a simplifying substitution \(u=u(x)\), or use the substitution that you are given.
-
• Calculate the derivative \(\ud u/\ud x\) and turn the integral over \(x\) into an integral over \(u\).
-
• Evaluate the integral over \(u\)
Not all substitutions are as obvious as the above one, this is particularly true for trig substitutions where identifying the correct substitution to use takes practice.
-
Example 4.7. Consider the integral
\(\seteqnumber{0}{4.}{7}\)\begin{equation*} I=\int \frac {1}{x^{2}+1}\ud x. \end{equation*}
We can evaluate this using the substitution \(x=\tan (u)\), then since \(\tan (u)=\sin (u)/\cos (u)\) we use the quotient rule to evaluate the derivative of \(\sin (u)\)
\(\seteqnumber{0}{4.}{7}\)\begin{align*} \frac {\ud }{\ud u}\tan (u) &=\frac {\ud }{\ud u}\left (\frac {\sin (u)}{\cos (u)}\right )\\ &=\frac {1}{\cos ^{2}}\left (\cos ^{2}(u)+\sin ^{2}(u)\right )\\ &=1+\tan ^{2}(u). \end{align*} Recalling that \(x=\tan (u)\) we have that
\(\seteqnumber{0}{4.}{7}\)\begin{equation*} \frac {\ud x}{\ud u}=1+x^{2}, \end{equation*}
which means that
\(\seteqnumber{0}{4.}{7}\)\begin{align*} I &=\int \frac {1}{x^{2}+1}\ud x\\ &=\int \frac {1}{x^{2}+1}\frac {\ud x}{\ud u}\ud u\\ &=\int \frac {1}{x^{2}+1}(x^{2}+1)\ud u\\ &=\int \ud u\\ &=u+c\\ &=\arctan (x)+c. \end{align*}
Approaches like the above example are how we can calculate integral expressions for all of the inverse trig functions. We just need to know the correct substitution.
Integration by parts
Integration by parts is the integral equivalent of the product rule from differentiation. We can use it whenever we have an integral which is the product of two functions and we know how to differentiate one of them and how to integrate the other.
Recall that the product rule says that given two functions of \(x\), \(f(x),g(x)\) the derivative of their product is
\(\seteqnumber{0}{4.}{7}\)\begin{equation*} \frac {\ud }{\ud x}\left (fg\right )=\frac {\ud f}{\ud x}g(x)+f(x)\frac {\ud g}{\ud x}. \end{equation*}
If we integrate this expression we have that
\(\seteqnumber{0}{4.}{7}\)\begin{align*} \int \frac {\ud }{\ud x}\left (fg\right )\ud x &=f(x)g(x)+c,\\ &=\int \left (\frac {\ud f}{\ud x}g(x)+f(x)\frac {\ud g}{\ud x}\right )\ud x\\ &=\int \frac {\ud f}{\ud x}g(x)\ud x+\int f(x)\frac {\ud g}{\ud x}\ud x. \end{align*} rearranging this and setting \(c\) to zero gives
\(\seteqnumber{0}{4.}{7}\)\begin{equation} \int f(x)\frac {\ud g}{\ud x}\ud x=f(x)g(x)-\int \frac {\ud f}{\ud x}g(x)\ud x. \label {eq: integration by parts} \end{equation}
The reason that we can set \(c\) to zero is that we still have some other indefinite integrals that have not been evaluated and these contain a constant of integration. Thus we can absorb \(c\) into the remaining integral.
The formula in eq. (4.8) is known as the integration by parts formula. We will apply it for indefinite integrals first and then turn to definite integrals.
-
Example 4.8. Consider the integral
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} \int \ln (x)\ud x=\int \ln (x) 1 \ud x=\int \ln (x)\frac {\ud x}{\ud x}\ud x \end{equation*}
this can be evaluated using integration by parts with \(f(x)=\ln (x)\) and \(g(x)=x\).
Applying eq. (4.8) gives
\(\seteqnumber{0}{4.}{8}\)\begin{align*} \int \ln (x)\ud x &=\int \ln (x)\frac {\ud x}{\ud x}\ud x\\ &=\ln (x) x -\int \left (\frac {\ud }{\ud x}\ln (x)\right )x\ud x\\ &=x\ln (x)-\int \frac {1}{x}x \ud x\\ &=x\ln (x)-x+c. \end{align*}
The trick when applying integration by parts is to look for one function that is easy to integrate, which will be our \(\ud g(x)/\ud x\), and another that is easy to differentiate, our \(f(x)\).
-
Example 4.9. Consider the integral
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} \int x\sin (x)\ud x =\int x\frac {\ud }{\ud x}\left (-\cos (x)\right )\ud x. \end{equation*}
We integrate this by parts taking \(f(x)=x\) and \(g(x)=-\cos (x)\), so that
\(\seteqnumber{0}{4.}{8}\)\begin{align*} \int x\sin (x)\ud x &=\int x\frac {\ud }{\ud x}\left (-\cos (x)\right )\ud x\\ &=x(-\cos (x))-\int \left (\frac {\ud x}{\ud x}\right )(-\cos (x))\ud x\\ &=-x\cos (x)+\int \cos (x)\ud x\\ &=-x\cos (x)+\sin (x)+c. \end{align*}
In this module we will only come across problems where you need to apply integration by parts once. However, some integrals require us to apply integration by parts more than once, and some require other tricks.
-
Mathematical Diversion 4.1. As an example of repeated integration by parts consider
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} I=\int x^{2}\sin (x)\ud x=\int x^{2}\frac {\ud }{\ud x}(-\cos (x))\ud x. \end{equation*}
We can carry out an integration by parts taking \(f(x)=x^{2}\) and \(g(x)=-\cos (x)\) to get
\(\seteqnumber{0}{4.}{8}\)\begin{align*} I &=\int x^{2}(-\cos (x))\ud x\\ &=-x^{2}\cos (x)-\int 2x(-\cos (x))\ud x\\ &=-x^{2}\cos (x)+2\int x\cos (x)\ud x\\ &=-x^{2}\cos (x)+2\int x\frac {\ud }{\ud x}(\sin (x))\ud x. \end{align*} The integral in the last line is one that we have to do by parts taking \(f(x)=x\) and \(g(x)=\sin (x)\). This means that
\(\seteqnumber{0}{4.}{8}\)\begin{align*} I &=-x^{2}\cos (x)+2\int x\frac {\ud }{\ud x}(\sin (x))\ud x\\ &=-x^{2}\cos (x)+2\left (x\sin (x)-\int \sin (x)\ud x\right )\\ &=-x^{2}\cos (x)+2\left (x\sin (x)+\cos (x)+c\right )\\ &=-x^{2}\cos (x)+2x\sin (x)+2\cos (x)+\tilde {c}, \end{align*} where in the last line we have redefined the constant of integration to be \(\tilde {c}=2c\).
Partial fractions
Another integration technique that is useful for integration fractions is known as Partial fractions. It is an example of a simplification method and is not examinable within this module. However, it may be useful for you to have seen it at least once.
The idea is to take an expression like \(1/(x^{2}-1)\) and express it as the some of two fractions
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} \frac {1}{x^{2}-1}=\frac {1}{(x-1)(x+1)}=\frac {A}{x+1}+\frac {B}{x-1}, \end{equation*}
for \(A\) and \(B\) constants that need to be determined. This is done by multiplying through by \((x+1)(x-1)\) to get
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} 1=A(x-1)+B(x+1), \end{equation*}
which rearranges to
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} (A+B)x-A+B-1=0. \end{equation*}
For this to be true we need to match up coefficients of powers of \(x\) on both sides of the equation so that
\(\seteqnumber{0}{4.}{8}\)\begin{align*} A+B&=0,\\ B-A-1&=0, \end{align*} which is solved by
\(\seteqnumber{0}{4.}{8}\)\begin{align*} A&=-\frac {1}{2},\\ B&=\frac {1}{2}. \end{align*} Which gives
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} \frac {1}{x^{2}-1}=-\frac {1}{2}\left [\frac {1}{x+1}-\frac {1}{x-1}\right ]. \end{equation*}
These are both expressions that we can integrate to get
\(\seteqnumber{0}{4.}{8}\)\begin{align*} \int \frac {1}{x^{2}-1}\ud x &=-\frac {1}{2}\left [\int \frac {1}{x+1}\ud x-\int \frac {1}{x-1}\ud x\right ]\\ &=-\frac {1}{2}\ln \left (x+1\right )+\frac {1}{2}\ln \left (x-1\right )+c\\ &=\ln \left [\left (\frac {x-1}{x+1}\right )^{\frac {1}{2}}\right ]+c. \end{align*} Note that in terms of what we know at this stage, the right hand side is only valid for \(x>1\).
The general procedure is as follows:
-
• Factorise the denominator in terms of its roots.
-
• Write down a sum of the reciprocals of the roots with arbitrary coefficients. This steps becomes complicated if there are repeated roots.
-
• Multiply through by the denominator on the left hand side and express it as a polynomial in \(x\).
-
• Solve the system of equations for the coefficients \(A, B, \dots {}\).
-
• Substitute the coefficients into the partial fractions expression and carry out the integral making use of integration by parts or substitutions as necessary.
As mentioned in the second step, if there are repeated roots this becomes trickier, since this is already a non examinable diversion we will not give the details here.
4.3 Definite integrals
In the previous section we focussed on antiderivatives and indefinite integrals, now we return to the original motivation for the integral, as the measure of the area under a curve. This is called a definite integral and returns a number rather than a function as it involves us
carrying out a definite integral and then evaluating the result at the end points. This may sound confusing at first but we will learn how to do it by seeing some examples.
To start consider the function \(f(x)=x^{2}+1\) on the interval \([0,2]\), the full details of this example are given in Dawkins [2025b]. The idea is that we want to find teh area enclosed between the curve and the \(x\)-axis, shown in fig. 4.2. Once we can integrate we will eb able to compute this exactly, but for now we should consider how to approximate this area.
A shape that we understand how to calculate the area of really well is a rectangle. If a rectangle has height \(\Delta y\) and base length \(\Delta x\) then its area is \(\Delta x \times \Delta y\). The aim is then to find the area under the curve by breaking it up into rectangles with a regular width. We do this by splitting up the interval, \([0,2]\) in this case, into \(n\) subintervals. This will give us an approximation of the area which will improve the more sub integrals we take, in other words the larger that \(n\) is. The width of a subinterval is then
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} \Delta x=\frac {2-0}{n}=\frac {2}{n}. \end{equation*}
In general it will be \(\Delta x=(b-a)/n\), where the interval is \([a,b]\).
We will choose the height of the intervals so that the agree with the value of \(f\) at the right hand side of the subinterval. For example if \(n=4\) we have four subintervals of length \(1/2\),
\(\seteqnumber{0}{4.}{8}\)\begin{equation*} \left [0,\frac {1}{2}\right ], \quad \left (\frac {1}{2},1\right ], \quad \left (1,\frac {3}{2}\right ], \quad \left (\frac {3}{2},2\right ]. \end{equation*}
In the each sub interval we take the height of our rectangle to be
\(\seteqnumber{0}{4.}{8}\)
\begin{align*}
f\left (\frac {1}{2}\right )&=\frac {5}{4},\\ f(1)&=2,\\ f\left (\frac {3}{2}\right )&=\frac {13}{4},\\ f(2)&=5.
\end{align*}
Plotting the rectangles we get the picture in fig. 4.3, note that the area of the rectangles is larger than the area under the curve. As an exercise consider the case where we take the rectangle to have the
height of the function on the left boundary of the integral, what changes?
Now lets calculate the area of each of these integrals by multiplying the width, \(1/2\) for all four, by the height:
\(\seteqnumber{0}{4.}{8}\)\begin{align*} A_{1}&=\frac {1}{2}\times \frac {5}{4}=\frac {5}{8} ,\\ A_{2}&=\frac {1}{2}\times 2=1,\\ A_{3}&=\frac {1}{2}\times \frac {13}{4}=\frac {13}{8},\\ A_{4}&=\frac {1}{2}\times 5=\frac {5}{2}. \end{align*} Adding all of these together gives
\(\seteqnumber{0}{4.}{8}\)\begin{align*} A_{r} &=A_{1}+A_{2}+A_{3}+A_{4}\\ &=\frac {5}{8}+1+\frac {13}{8}+\frac {5}{2}\\ &=\frac {23}{4}=5.75. \end{align*}
If we had taken the heights at the left end points we would have found \(A_{l}=3.75\), which is an underestimate of the area, again I invite you to check the details for yourself, or look at Dawkins [2025b] which goes through it.
Finally, we could make a third choice where we take the height of the rectangle to be the value of the function at the midpoint, shown in fig. 4.4, then we find that the area is
\(A_{m}=37/8=4.625\).
You will see that the value of the value of the area that we calculate depends on the size of our rectangles. This should not be surprising, but suggests that we need a more systematic way to do this, which enables us to find a unique answer. This is what integration will
give us. Once we have the machinery of integration we can calculate the actual area under the curve to be \(A=14/3=4.67\). So the mid point method above is the closest to the true value.
This leads us to the concept of the Riemann sum1. Consider a function plotted over an interval. Split the integral into \(n\) subintervals each of width \(\Delta x\) as above. Then pick a point \(x_{i}^{\star }\) in each sub interval and use the rectangle of height \(f(x_{i}^{*})\) as our approximation for the area of the function over that sub interval. The total area is then
\(\seteqnumber{0}{4.}{8}\)\begin{equation} A\simeq f(x_{1}^{*})\Delta x+f(x_{2}^{*})\Delta x +\cdots + f(x_{i}^{*})\Delta x+\cdots +f(x_{n}^{*})\Delta x=\sum _{i=1}^{n} f(x_{i}^{*})\Delta x. \end{equation}
This approximation gets better and better the more subintervals we take, as they will become narrower and narrower, and their height becomes a better match for the functions value over that interval. If we could take the limit of \(n\to \infty \) the sub intervals will become a single point and the height is the value of the function at that point. The sum would then become the exact area,
\(\seteqnumber{0}{4.}{9}\)\begin{equation} A=\lim _{n\to \infty }\sum _{i=1}^{n} f(x_{i}^{*})\Delta x. \label {eq: Riemann Sum} \end{equation}
It is important to note that if our function was below the \(x\)-axis, then we would get a negative answer for the area. This is because we take the heights of the rectangles to be the value of the value of the function at some point in the interval. So if the function takes
negative values, we will find a negative area.
This is a feature and not a bug! The integral will be a signed count of the area under a curve. This does mean that if a function crosses the axis in the interval that we are interested in, we will need to be careful whether we are interested in the net area under the curve, the difference between the positive and negative areas, or the total area, which does not care about the sign.
1 Bernhard Riemann was a German Mathematician who contributed to many different areas of mathematics and is maybe most famous for the Riemann hypothesis about the distribution of prime numbers.
-
Exercise 4.11. Consider the function \(x^{2}-4\) on the interval \([0,2]\). Take \(n=8\) and use the midpoint approach to estimate the area between the function and the \(x\)-axis. You should find \(A_{m}=-171/32\).
The sum in eq. (4.10) is taken as the definition of the definite integral:
\(\seteqnumber{0}{4.}{10}\)\begin{equation} \int _{a}^{b}f(x)\ud x = \lim _{n\to \infty }\sum _{i=1}^{n} f(x_{i}^{*})\Delta x. \label {eq: definite integral} \end{equation}
This is the integral of the function \(f(x)\) over the interval \([a,b]\). The terminology that is usually used is that \(a\) is called the lower limit and \(b\) the upper limit.
-
Mathematical Diversion 4.2. If this was a module for mathematicians, we would spend a bit of time here discussing how to calculate this using the sum definition given on the right hand side of eq. (4.11). Doing this involves knowing some standard expressions for summations such as:
\(\seteqnumber{0}{4.}{11}\)\begin{align*} \sum _{i=1}^{n}1&=n,\\ \sum _{i=1}^{n}i&=\frac {n(n+1)}{2},\\ \sum _{i=1}^{n}i^{2}&=\frac {n(n+1)(2n+2)}{6}. \end{align*} Armed with these and a few other expressions one can evaluate the Riemann sum expression for a wide variety of functions. Including \(f(x)=x^{2}+1\) that we discussed above. If you are interested in trying this it is worth doing at least once, though is an exercise for maths enthusiasts only as you are unlikely to need to use the Riemann sum definition of an integral directly.
The properties that we discussed for indefinite integrals still hold here, but now we get some new properties:
\(\seteqnumber{0}{4.}{11}\)\begin{align*} \int _{a}^{b}f(x)\ud x&=-\int _{b}^{a}f(x)\ud x, \quad \text {swapping limits introduces a minus sign.}\\ \int _{a}^{a}f(x)\ud x&=0, \quad \text {if the limits agree the integral is zero.}\\ \int _{a}^{b}f(x)\ud x &=\int _{a}^{c}f(x)\ud x +\int _{c}^{b}f(x)\ud x, \quad \text { where $c$ is any number between $a$ and $b$.} \end{align*}
Recall that the antiderivative \(F(x)\) for the function \(f(x)\) is defined as any function such that
\(\seteqnumber{0}{4.}{11}\)\begin{equation*} \frac {\ud F}{\ud x}=f(x). \end{equation*}
For a definite integral antiderivatives make an appearance through the fundamental theorem of calculus. This states that for a function \(f(x)\) which is continuous on \([a,b]\) and has antiderivative \(F(x)\) then:
\(\seteqnumber{0}{4.}{11}\)\begin{equation} \int _{a}^{b}f(x)\ud x=\left [F(x)\right ]_{a}^{b}=F(b)-F(a). \label {eq: ftc I} \end{equation}
In other words, a definite integral is just the difference between the antiderivative evaluated at the endpoints of the interval. This result is proved in Dawkins [2025b], and a proof may be added to chapter 12 at some stage.
-
Example 4.12. Consider the function \(f(x)=x^{2}+1\), we know that an antiderivative for this is
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} F(x)=\frac {1}{3}x^{3}+x, \end{equation*}
where we have carried out the indefinite integral of \(f(x)\). Using eq. (4.12) we get that the definite integral over the interval \([0,2]\) is
\(\seteqnumber{0}{4.}{12}\)\begin{align*} \int _{0}^{2}\left (x^{2}+1\right )\ud x &=\left [\frac {1}{3}x^{3}+x\right ]_{0}^{2}\\ &=\frac {1}{3}(2)^{3}+2-\left (\frac {1}{3}(0)^{3}+0\right )\\ &=\frac {8}{3}+2-0\\ &=\frac {14}{3} \end{align*} which is what we claimed was the exact value above.
Note that we can use any antiderivative since the constant piece will cancel out in the difference for example if we took
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} F_{2}(x)=\frac {1}{3}x^{3}+c, \end{equation*}
then
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} \left [\frac {1}{3}x^{3}+x+c\right ]_{0}^{2}=\frac {14}{3}+c-\left (0+c\right )=\frac {14}{3}+c-c=\frac {14}{3}. \end{equation*}
This is why we always take the simplest antiderivative when evaluating definite integrals.
-
Example 4.13. Consider the function \(f(x)=x^{4}+2x^{2}+2\) and calculate its integral over the interval \([0,1]\). Recall that an antiderivative of this function is
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} F(x)=\frac {1}{5}x^{5}+\frac {2}{3}x^{3}+2x, \end{equation*}
so using eq. (4.12) the definite integral is
\(\seteqnumber{0}{4.}{12}\)\begin{align*} \int _{0}^{1}\left (x^{4}+2x^{2}+2\right )\ud x &=\left [\frac {1}{5}x^{5}+\frac {2}{3}x^{3}+2x\right ]_{0}^{1}\\ &=\frac {1}{5}+\frac {2}{3}+2 -0\\ &=\frac {43}{15}. \end{align*}
As with derivatives you will not evaluate every integral by finding an antiderivative. You will become familiar with a range of standard integrals, and techniques for evaluating integrals so that you do not have to calculate an antiderivative every time. The techniques of substitution and integration by parts that we met above are very useful here. Though we now need to be careful about what happens to the limits when we perform a substitution and when dealing with the total derivative part of integration by parts.
-
Example 4.14. Consider the integral
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} I=\int _{0}^{1}\frac {1}{x^{2}+1}\ud x. \end{equation*}
We evaluated the indefinite integral above using the substitution \(x=\tan (u)\) which meant that
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} \int \frac {1}{x^{2}+1}\ud x=\int \ud u. \end{equation*}
The new step is that we need to look at what happens to the limits of the integral upon substitution. e.g. find the values of \(u\) such that \(\tan (u)=0\) and \(\tan (u)=1\), remembering that we need to work in radians. In this case \(\tan (0)=0\) and \(\tan (\uppi /4)=1\) so we have that
\(\seteqnumber{0}{4.}{12}\)\begin{equation*} I=\int _{0}^{1}\frac {1}{x^{2}+1}\ud x=\int _{0}^{\frac {\uppi }{4}}\ud u=\left [u\right ]^{\frac {\uppi }{4}}_{0}=\frac {\uppi }{4}. \end{equation*}
Any time you use integration by substitution for a definite integral you similarly need to keep track of how the limits transform under the substitution.
With integration by parts the identity in eq. (4.8) is modified to become
\(\seteqnumber{0}{4.}{12}\)\begin{equation} \int ^{b}_{a} f(x)\frac {\ud g}{\ud x}\ud x =\left [f(x)g(x)\right ]_{a}^{b}-\int _{a}^{b}\frac {\ud f}{\ud x}g(x)\ud x. \end{equation}
In other words we need to evaluate the total derivative at the limits of integration.
-
Example 4.15. Consider the integral
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} I=\int _{1}^{2}\ln (x)\ud x. \end{equation*}
We saw above that integration by parts gave that
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} \int \ln (x)\ud x=x\ln (x)-x+c. \end{equation*}
When we calculated this we took \(f(x)=\ln (x)\) and \(g(x)=x\) so that
\(\seteqnumber{0}{4.}{13}\)\begin{align*} I &=\int _{1}^{2}\ln (x)\ud x\\ &=\int _{1}^{2}\ln (x)\frac {\ud x}{\ud x}\\ &=\left [\ln (x)x\right ]_{1}^{2}-\int {1}^{2}\ud x\\ &=2\ln (2)-\ln (1)-\left [x\right ]_{1}^{2}\\ &=2\ln (2)-(2-1)\\ &=2\ln (2)-1. \end{align*}
Improper integrals
An important type of definite integrals are the improper integrals. These are definite integrals
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} \int _{a}^{b}f(x)\ud x, \end{equation*}
where either \(f(x)\) becomes infinite for \(a\leq x\leq b\), or one of the limits goes to infinity.
The following integrals are improper:
-
•
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} \int _{1}^{\infty }\frac {1}{x^{2}}\ud x, \end{equation*}
because the upper limit is infinity,
-
•
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} \int _{0}^{1}\frac {1}{\sqrt {x}}\ud x \end{equation*}
because \(1/\sqrt {x}\) becomes infinite for \(x=0\).
-
•
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} \int _{1}^{\infty }\sin (x)\ud x, \end{equation*}
because the upper limit is infinity,
It turns out that some improper integrals can still give sensible results, we just need to interpret them properly.
First up, we reinterpret them using a limit so that
\(\seteqnumber{0}{4.}{13}\)\begin{align*} \int _{1}^{\infty }\frac {1}{x^{2}}\ud x &=\lim _{X\to \infty }\int _{1}^{X}\frac {1}{x^{2}}\ud x\\ &=\lim _{X\to \infty }\left [-\frac {1}{x}\right ]_{0}^{X}\\ &=\lim _{X\to \infty }\left (1-\frac {1}{X}\right )\\ &=1. \end{align*} Thus the improper integral gives us a sensible answer.
Next consider
\(\seteqnumber{0}{4.}{13}\)\begin{align*} \int _{0}^{1}\frac {1}{\sqrt {x}}\ud x &=\lim _{X\to 0}\int _{X}^{1}\frac {1}{\sqrt {x}}\ud x\\ &=\lim _{X\to 0}\left [2\sqrt {x}\right ]_{X}^{1}\\ &=\lim _{X\to 0}2\left (1-\sqrt {X}\right )\\ &=2. \end{align*}
When we can reinterpret improper integrals using limits and get a finite answer we say that the integral is convergent. However, this does not always work as sometimes the improper integral is divergent.
-
Example 4.16. Consider the integral
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} I=\int _{0}^{\infty }\sin (x)\ud x. \end{equation*}
If we try to interpret it as above we find that
\(\seteqnumber{0}{4.}{13}\)\begin{align*} I &=\int _{0}^{\infty }\sin (x)\ud x\\ &=\lim _{X\to \infty }\int _{0}^{X}\sin (x)\ud x\\ &=\lim _{X\to \infty }\left [-\cos (x)\right ]_{0}^{X}\\ &\lim _{X\to \infty }\left (1-\cos (x)\right ) \end{align*} which does not converge as \(\cos (x)\) oscillates between \(-1\) and \(1\).
-
Example 4.17. Consider the integral
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} I=\int _{0}^{\infty }x\ud x. \end{equation*}
We can attempt to evaluate this as follows:
\(\seteqnumber{0}{4.}{13}\)\begin{align*} I &=\int _{0}^{\infty }x\ud x\\ &=\lim _{X\to \infty }\int _{0}^{X}x\ud x\\ &=\lim _{X\to \infty }\left [\frac {1}{2}x^{2}\right ]_{0}^{X}\\ &=\lim _{X\to \infty }\frac {1}{2}X^{2}, \end{align*} which tends to infinity, so this is another divergent integral.
-
Example 4.18. Consider the integral
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} I=\int _{0}^{1}\frac {1}{x}\ud x. \end{equation*}
We attempt to evaluate this as follows:
\(\seteqnumber{0}{4.}{13}\)\begin{align*} I &=\int _{0}^{1}\frac {1}{x}\ud x\\ &=\lim _{X\to 0^{+}}\int _{X}^{1}\frac {1}{x}\ud x\\ &=\lim _{X\to 0^{+}}\left [\ln (x)\right ]_{X}^{1}\\ &=\lim _{X\to 0^{+}}\left (-\ln (X)\right ), \end{align*} which again tends to infinity.
Splitting the range
Another useful technique for evaluating definite integrals is to split the range of integration. For example if we are interested in the integral of
\(\seteqnumber{0}{4.}{13}\)\begin{equation*} I=\int _{-\frac {\uppi }{2}}^{\frac {\uppi }{2}}\sin \left (\vert x\vert \right )\ud x \end{equation*}
by splitting the range of the integral.