Infinite powers
Contents
2. Infinite powers#
This chapter is about the mathematical concepts of order of magnitude and Taylor series. After working through the chapter you should be able to find Maclaurin and Taylor series expansions for given functions and discuss their convergence using numeric justification
2.1. Order of magnitude#
When describing the smallness or bigness of numbers it can be helpful to classify them into powers of a given reference quantity (called the base). Customarily we use base 10, though base 2 is used to describe computer memory, and in advanced mathematics it is common to use a base defined by a property of the system being investigated. We may denote the order of magnitude using the symbol
In base 10, the order of magnitude is given by the power in scientific notation. For example, the value
An order of magnitude estimate keeps only the most significant digit in scientific number format. For instance, an order of magnitude estimate for the number of humans on Earth is
Two physical quantities are said to be the same order of magnitude if their ratio lies between 1/10 and 10. For instance, the value
Exercise 2.1
By one estimate there are around
The world population of humans is around
Calculate the total ant biomass and the total human biomass. Are these the same order of magnitude?
Click to show
Expressing the total mass in kg, using the result
Ant biomass :
kgHuman biomass:
kg
The ant biomass and human biomass are the same order of magnitude, with a ratio around 21%.
2.2. Asymptotic equivalence#
Whereas the limit of a function refers to tendency towards a single value, asymptotic equivalence refers to tendency towards a relationship.
For “very small”
Notice that if
By way of example, consider the plots below, which show the curve

Fig. 2.1 Comparison of asymptotic expansions to the curve
We see that the linear approximation is an accurate representation of the curve in a very small domain close to
2.3. Power series construction#
To construct expansions of this type, we suppose that we can express a given function
The coefficients
Exercise 2.2
Find the first three derivatives of
Click to show
Exercise 2.3
Determine a general result for the
Match this to
Click to show
Assuming this matches
Note:
(e.g.
Exercise 2.4
Calculate the first three non-zero terms in the expansion for
Click to show
The expansion is
We can plot this together with
import numpy as np
import matplotlib.pyplot as plt
x=np.linspace(-1,1)
y=np.log(1+x)
plt.plot(x,y,label=r'$\ln(1+x)$')
p=x-x**2/2+x**3/3
plt.plot(x,p,label='$p(x)$')
plt.legend()
plt.show()

2.4. Convergence#
In the above discussion we assumed that
It is possible to use tools of mathematical analysis to formally determine the interval of convergence for the infinite series, which will be different for each function
What is truly remarkable is that for some functions the expansions constructed by the method outlined above are valid over a wider interval than
It is quite exciting to think that these non-polynomial functions can be represented by infinite polynomial series. However, the expansions converge increasingly slowly as we move further from the point
Here we will not develop the tools of analysis required to undertake a formal investigation of convergence. We will adopt a more experimental approach, by generating series containing a few terms and evaluating their accuracy on the interval that we are interested in.
Exercise 2.5
Demonstrate that with only five terms in the expansion of
Optional: How many terms are needed in the expansion to obtain a result that is accurate to within 1% on the interval
Click to show
import numpy as np
x=np.linspace(-0.5,0.5,1000)
y=np.log(1+x)
p=x-x**2/2+x**3/3-x**4/4+x**5/5
#maximum relative error
m=max(np.abs((y-p)/y))
#percentage error
print(100*m)
0.6644352054578373
The maximum relative error is 0.664%
To obtain an expansion that is accurate to within 1% on the interval
2.5. Generalization#
In the outline above we developed a power series expansion technique that was accurate in the neighbourhood of
Where we require a power series approximation to a function near to a non-zero location, a better technique is to construct the expansion so that it has greatest accuracy in the neighbourhood of the point of interest. We do this using a shifted version of the expansion formula:
By applying the technique of matching derivatives at
The formula (2.3) together with (2.4) is known as Taylor’s series. The special case when
Exercise 2.6
Find the first four non-zero terms of the Taylor series for the following cases:
about the point about the point
Click to show
Hence
The result could have been obtained by recognising that
and obtaining the expansion for
Click to show
Hence
Exercise 2.7
Explain why it is not possible to construct a series expansion of
Also explain the relationship between the series for
Click to show
The function
The series for
This can be seen by defining
2.6. Order of accuracy#
We assume the Taylor series is to be used in the neighbourhood of the expansion point, so
where the “big-O” notation describes the size of the error terms.
This finding can be used to describe the size of the error in the finite difference approximation presented in the last chapter. Discarding all terms of degree greater than one in Taylor’s expansion about
If we label
A simple rearrangement of Euler’s forward difference formula gives the previously obtained expression for the derivative at
The result also shows that the error in this expression is order
We should distinguish truncation error from the previously seen roundoff errors that occur as a computational artefact due to working with finite precision arithmetic.
Warning
A proper mathematical description of the order of magnitude requires the Lagrange remainder theorem, which places an upper bound on the size of the error. The error in the truncated expansion is found to be proportional to the next power of that was discarded in the expansion.