# StudySquare

# Iterative methods for SQA Higher Maths

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.

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.

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.

# 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.

# 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.

# 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.

# 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.

# 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₁ = …

End of page