A-level Mathematics/OCR/C3/Numerical Methods

Finding Roots of an Equation
In this module we will explore approximating where an equation has a root. Below we have two graphs.

Finding A Root Using a Graph
In the graph we have two functions. If we want to approximate where the roots are we have to look at where the function cross the x-axis. The lilac function crosses the x-axis somewhere between 2.05 and 2.25. The green function has roots around 1 and 3.5. If we want to know where the green function is equivalent to the lilac function we need to look at the graph. When the two graphs cross they are equivalent. This number will be the root. In this case it is around 1.75. We can also say that on this domain, the functions will only cross once.

Finding A Root By Searching for A Sign Change
When a function has a root the value of the function will change from a positive value to a negative value or vice versa. If below is the table of values for the lilac function we can say that the root occurs between 2.05 and 2.10:

Iterative Formulae
An iterative formula is a formula that is composed of itself. That is the output of the function is the next input of the function. $$x_{n + 1}= F(n)$$. These functions are a sequence of approximations that usually converge to the value of a function. You can tell if a function converges by the fact that the outputs become closer and closer to each other, if this does not happen then the function diverges and there is no value. The output of an iterative formula is written as:
 * $$x_2\,$$
 * $$x_3\,$$
 * $$x_4\,$$

The first x is provided for you. The output of the iterative formula is written as the Greek letter alpha: α. α can be found to the required degree of accuracy when $$x_n = x_{n + 1}$$ to the required number of decimal places. Given an iterative function you can find the root of an equation. Also you find the function from a given iterative function by setting x = iterative function, then solving so that you have a zero on one side. The aforementioned process can be done in reverse.

Example
Given the sequence that is defined by the iterative formula $$\left(2x+5\right)^{\frac{1}{3}}$$ with $$x_1 = 2$$ converges to $$\alpha$$ With an iterative formula we have:
 * 1) Find $$\alpha$$ correct to 4 decimal places.
 * 2) Find equation that has $$\alpha$$ as a root.
 * 3) Does the equation have any more roots?
 * 1) We plug in $$x_1$$ to get $$x_2$$ and so on
 * 2) $$x_2 = \left(2\times(2)+5\right)^{\frac{1}{3}} = 2.0801$$
 * 3) $$x_3 = \left(2\times(2.0801)+5\right)^{\frac{1}{3}} = 2.0924$$
 * 4) $$x_4 = \left(2\times(2.0924)+5\right)^{\frac{1}{3}} = 2.0942$$
 * 5) $$x_5 = \left(2\times(2.0942)+5\right)^{\frac{1}{3}} = 2.0945$$
 * 6) $$x_6 = \left(2\times(2.0945)+5\right)^{\frac{1}{3}} = 2.0945$$
 * 7) $$\alpha = 2.0945\,$$
 * 8) $$x = \left(2x+5\right)^{\frac{1}{3}}$$
 * 9) $$x^3 = 2x+5\,$$
 * 10) $$x^3 -2x -5 = 0\,$$
 * 11) To determine if the function has any roots just graph the graph of the highest power of x and then the rest. The number of times they cross is the number of roots you have.
 * 12) If we plot $$y = x^3$$ and $$y = 2x + 5$$ we can see that they only cross once.
 * 13) The function only has one root.

Simpson's Rule for Area
To find the area beneath a curve we have already learned the trapezium rule. The trapezium rule is not very accurate it takes a very large number of trapezoids to get an very accurate area. The Simpson rule is much more accurate to find the area underneath a curve. Simpson's Rule states: $$\int^b_a y dx \approx \frac{1}{3}h\left\{\left(y_0 + y_n\right) + 4\left(y_1 + y_3 + \ldots + y_{n-1}\right) + 2\left(y_2 + y_4 + \ldots + y_{n-2}\right) \right\}$$

where$$h = \frac{b-a}{n}$$ and n is even

Example
Use Simpson's Rule to evaluate $$\int_{1}^{5}x^2 + 2x\, dx$$ with h = 1.

$$\int_{1}^{5}x^2 + 2x \,dx \approx \frac{1}{3}\left[\left(1^2 + 2\times 1 \right) + 4\left(2^2 + 2\times 2 \right) + 2\left(3^2 + 2\times 3\right) + 4\left(4^2 + 2\times 4\right) + \left(5^2 + 2\times 5\right)\right]$$

$$\int_{1}^{5}x^2 + 2x\,dx = 65\frac{1}{3}$$

The area under the curve $$x^2 + 2x\,$$is equal to $$65\frac{1}{3}$$.

This is the true value. If we compare it to the value of 66 that we trapezium rule and to the value of 65 that we got from the midpoint rule we can see that Simpson's rule is the most accurate.