ย 

Iterative methods for SQA Higher Maths

Iterative methods

This page covers the following topics:

1. Iterative formulas
2. Iterative Bisection
3. Linear Interpolation

Suppose we have an equation such as xยฒ โ€“ 3x + 2 = 0. One approach of solving this is to rearrange the equation so that x is the subject of the formula, giving x = โˆš(3x โ€“ 2). A value of x which satisfies this is also a solution of our original equation. We can find this value of x by considering this as an iterative formula xโ‚™โ‚Šโ‚ = โˆš(3xโ‚™ โ€“ 2). We then pick some starting value xโ‚€ and put it in the right hand side of our equation to give some new xโ‚. We then iteratively put the xโ‚ in the right side again to get xโ‚‚, and so on. The values we get from the equation should converge on an approximate solution to our original equation, but this can depend on the function and what starting xโ‚€ we use.

Iterative formulas

Suppose we are trying to find the root of some equation f(x). We can use the change of signs method and find 2 points a and b so that f(a) < 0 and f(b) > 0, and therefore we know the root will lie somewhere in between. We then consider the midpoint m of these 2 points (dashed line on graph). If f(m) < 0, then we now know the root is between m and b, and otherwise it's between a and m. Iterative bisection just involves repeadedly doing this process, finding a new smaller intervals until it converges to an approximate solution. After a certain number of iterations one obviously needs to stop, and then we just give the interval's midpoint as the approximate root. It doesn't strictly need to find a root either, we could check for values f(a) < 1 and f(b) > 1 when trying to solve f(x) = 1.

Iterative Bisection

Consider this graph of f(x), where we know f(x) = 0 between some f(a) < 0 and f(b) > 0. Linear Interpolation is similar to iterative bisection, but instead of finding the midpoint of a and b to get our new interval, we consider the straight line from f(a) to f(b). The xโ€“intercept (c) of this straight line can be easy calculated as c = ( a|f(b)| + b |f(a)| ) / ( |f(a)| + |f(b)| ), and this will be closer to the root of f(x) (note that the '| |' means the absolute, positive value). Then just as we did for iterative bisection, we identify the smaller interval which must contain the root and iteratively repeat the process, converging onto the root.

Linear Interpolation

1

Show that there is a root of f(x) = 2x + tan(x) + 1 at around x = โ€“0.3 using iterative bisection between x = 0 and x = 0.5.

As iterative bisection is repeatedly performed, one should see the interval becoming smaller and smaller around the point x = โ€“0.3.

Show that there is a root of f(x) = 2x + tan(x) + 1 at around x = โ€“0.3 using iterative bisection between x = 0 and x = 0.5.

2

Find the root of f(x) = xยณ + โˆš(x) โ€“ 3/2, using linear interpolation (to 1 decimal place).

x = 0.8 (rounded to 1 decimal place). To start, one needs to spot an interval where the function has a change of sign. It should be pretty easy to spot f(0) = โ€“3/2, and f(1) = 1/2. Now one starts the linear interpolation and repeatedly narrows down the interval. Once we reach an interval anywhere within the range x = 0.75 to 0.84, then we know the root in this range would always round to x = 0.8.

Find the root of f(x) = xยณ + โˆš(x) โ€“ 3/2, using linear interpolation (to 1 decimal place).

3

Find xยฒ + 5x + 6, using linear interpolation and knowing a root exists in the interval between x = โ€“ 3.5 and x = โ€“2.5.

f(โ€“3.5) = 0.75, and f(โ€“2.5) = โ€“0.25. The line intersects the xโ€“axis at x = (โ€“3.5*|f(โ€“2.5)| + (โ€“2.5)*|f(โ€“3.5)|) / (|f(โ€“3.5)| + |f(โ€“2.5)|) = (โ€“3.5*(0.25) + (โ€“2.5*0.75)) / (0.75 + 0.25) = โ€“2.75. We have f(โ€“2.75) = โ€“0.1875. The new interval must be between f(โ€“3.5) and f(โ€“2.75) since there is a change of sign. One then repeats the process, finding the new straight line's intercept with the xโ€“axis. One progressively gets closer to the root of x = โ€“3.

Find xยฒ + 5x + 6, using linear interpolation and knowing a root exists in the interval between x = โ€“ 3.5 and x = โ€“2.5.

4

Find a root of f(x) = sin(x) + x + 2 using linear interpolation, knowing the root is between x = โ€“1 and x = โ€“2.

The actual root is x = โ€“1.106โ€ฆ Using linear interpolation should converge to this root, but you obviously stop the iterative process at some point on an approximate root.

Find a root of f(x) = sin(x) + x + 2 using linear interpolation, knowing the root is between x = โ€“1 and x = โ€“2.

5

Find a root of xยฒ + 2x โ€“ 8 = 0 to 1 decimal place using an iterative formula with xโ‚€ = 3.

The iterative formula is xโ‚™โ‚Šโ‚ = โˆš(8 โ€“ 2xโ‚™). We have xโ‚€ = 3, xโ‚ = โ€ฆ

Find a root of xยฒ + 2x โ€“ 8 = 0 to 1 decimal place using an iterative formula with xโ‚€ = 3.

End of page

ย