A Level Maths: Numerical Methods

Exam Season

Numerical Methods – Introduction

When solving equations such as a quadratic there is a formula that can be used, or depending on the type of quadratic that we have it can also be factorised as well using the technique of completing the square. 

There are also polynomial equations which you would have met as part of your A Level maths course where you would have discovered techniques to solve these equations such as algebraic long division , comparing coefficients and also the grid method. 

But there are some equations that cannot be solved using the methods as detailed above and so we need to establish different techniques to solve more complicated equations. 

Some of the topics that we are going to discuss in this topic include the following: 

To be able to understand that a change of sign in an interval can be used to find a root

To be able to understand the interval bisection method

To be able to understand the iteration Newton-Raphson method

To be able to use Euler’s method to find approximations to differential equations. 

Numerical methods are used to help us to solve equations which cannot be solved algebraically. However it needs to be stressed that any solutions are very close approximations.

Numerical Methods - Change of Sign

If you consider the above curve. If you find the value of y at x = a it will be positive and if you find the value of y at x = b then it will be positive. This you can see from the graph. 

Now the curve has changed sign in the interval [a, b] and because of this we say that there is a root that must exist within this interval. 

Example

Show that a lies in the interval [-1.6, -1.5] of the equation x^3-x+2=0

Solution

Let f(x)=x^3-x+2

\begin{aligned} & f(-1.6)=(-1.6)^3-(-1.6)+2=-0.496 \\ & (-1.5)=(-1.5)^3-(-1.5)+2=0.125 \end{aligned}

Because there has been a change of sign we can say that a root does exist in the interval stated. 

Example

Does a root exist for the equation \frac{1}{x}=y?

Solution

There are instances where change of sign does not always give an accurate answer and this example will show. 

If we consider the interval [-1, 2] then: f(-1)=-1 \text { and } f(2)=\frac{1}{2}

This clearly suggests that because of a change in sign a root must exist. But if we take a moment to sketch the curve we have the following: 


From the graph you can clearly see that the curve is discontinuous and it does not cross the xaxis at any point. So in this case, a change of sign is actually misleading and the change of sign approach has resulted in a failure. This is why it is essential to have a sketch of the curve to determine if everything is correct. 

Example

Prove that -2.196 is a root of x^3-3 x+4=0

Solution


A sketch of the curve is shown above and it can be seen that the curve crosses the x-axis at just one location. 

Now if -2.196 is a root then we need to consider the points before and after i.e. -2.1955 and – 2.1965. 

Let f(x)=x^3-3 x+4

\begin{aligned} & f(-2.1955)-0.003706 \\ & f(-2.1965)=-0.007760 \end{aligned}

Here we can see a change of sign has taken place and the diagram does support this and so -2.196 is a root. 

Numerical Methods - Interval Bisection

 

One particular technique that uses a change of sign is the interval bisection method where the interval is actually bisected. 

For instance consider the equation x^5-5 x+3=0 and a sketch of this is shown: 


From the diagram above you can see that the curve crosses the -axis at three locations within the following intervals: [-2, -1], [0, 1] and [1, 2].

Suppose that we want to find the root in the interval [0, 1]. First we should verify that a root actually exists in this interval and determine if a change of sign actually exists. 

Then f(0)=3 \text { and } f(1)=-1.

There is a change of sign therefore there is a root. 

Next we want to bisect the interval between 0 to 1 by choosing the midpoint i.e. 0.5. f0.5= 0.53125 which means that the root lies in the interval [0.5, 1]. 

We now consider the midpoint of this latest interval which is 0.75 and f0.75= -0.51269  which means that the root lies in the interval [0.5, 0.75]

Next we bisect the newest interval at the midpoint which is 0.625. f0.625= -0.0296 and so the new interval is [0.5, 0.625]. 

The above process is repeated until the root is found to the required degree of accuracy. 

Numerical Methods – Linear Interpolation. 

If the root of f(x)=a lies between two values x=a \text { and } x=b then y=f(x) must cross the xaxis between a and b


From the curve above we approximate the curve by using a straight line and to use the value of y at x = c as the next approximation. 

The formula that we can use to approximate the root is: 

\frac{a f(b)-b f(a)}{f(b)-f(a)}

Example

Using linear interpolation to show that x^3-4 x-10=0 has roots between 2 and 3. 

Solution

First we need to verify that a change of sign exists. 

\text { Let } f(x)=x^3-4 x-10 \text { so } f(2)=-10 \text { and } f(3)=5

Using the linear interpolation formula we have: \frac{a f(b)-b f(a)}{f(b)-f(a)}=\frac{(5 \times 2)-(-10 \times 3)}{5–10}=\frac{40}{15} \approx 2.7 and this confirms that a root exists between 2 and 3. 

Numerical Methods – Newton-Raphson

Consider the curve y=f(x) as shown below: 


We can see that the curve crosses the x-axis in the interval [a, b]. In order to find this root we pick a starting point that is close to the root that we want to find say x_1.

So at \left[x_1, f\left(x_1\right)\right] a tangent is drawn to the curve where the tangent then crosses the x-axis and this then gives the next approximation. The process is then repeated until the root has been found with the appropriate level of accuracy. 

This is known as the Newton-Raphson iteration and the formula used is: 

x_{n+1}=x_n-\frac{f\left(x_n\right)}{f^{\prime}\left(x_n\right)}

Example

For the curve with equation x^3+x-1=0. Given that x_1=0.7 and find x_2 \text { and } x_3 \text { to } 4 \mathrm{dp} \text {. }

Solution

Let f(x)=x^3+x-1 \text { then } f^{\prime}(x)=3 x^2+1

Using the formula we have: 

\begin{gathered} x_2=x_1-\frac{f\left(x_1\right)}{f^{\prime}\left(x_1\right)} \\ =0.7-\frac{f(0.7)}{f^{\prime}(0.7)}=0.62826 \\ x_3=x_2-\frac{f\left(x_2\right)}{f^{\prime}\left(x_2\right)}=0.6823 \end{gathered}

The numerical methods used in A Level Maths are important not only for your exams but also in the real world and they have many practical applications such as in the design of formula one motor racing cars. 

Once, these techniques were in a piece of coursework that was done at the end of year 12 and this was the case when exams were modular. Now that exams are linear, the assessment of this topic is now examination based.