Welcome to Numerical Methods: Formal Iteration!
Ever tried to solve an equation like \(x^3 + x - 1 = 0\) and realized that your usual GCSE algebra tricks just don't work? Don't worry, even mathematicians get stuck! In this chapter, we explore Numerical Methods—a set of tools used to find "good enough" answers (approximations) when we can't find the exact answer easily. Think of it like a GPS: it might not tell you your exact location to the atom, but it gets you close enough to find the house you're looking for!
1. Simple Iteration: The \(x = g(x)\) Method
The core idea of iteration is taking a starting guess, plugging it into a formula, getting a new result, and then repeating the process until the number stops changing much.
How to set it up:
To use this method, we must first rearrange our original equation \(f(x) = 0\) into the form \(x = g(x)\).
Example: If we have \(x^2 - x - 1 = 0\), we could rearrange it to \(x = \sqrt{x + 1}\). Here, our \(g(x)\) is \(\sqrt{x + 1}\).The Iterative Formula:
We write this as a recurrence relation: \(x_{n+1} = g(x_n)\).
- \(x_0\) is your initial value (your first "best guess").
- \(x_1\) is the result of plugging \(x_0\) into the formula.
- \(x_2\) is the result of plugging \(x_1\) into the formula, and so on.
Quick Review: The subscripts (\(n, n+1\)) just tell you the "step number." \(x_5\) is simply the fifth number in your sequence.
Did you know? Computers use iteration for almost everything! From rendering graphics in video games to calculating weather forecasts, they are constantly "looping" through formulas to find precise results.
2. Visualizing Iteration: Cobwebs and Staircases
OCR examiners love to ask you to draw or identify diagrams that show how an iteration is behaving. We look at the intersection of the line \(y = x\) and the curve \(y = g(x)\).
The Two Shapes:
1. Cobweb Diagrams: These happen when the sequence "swings" back and forth around the root. It creates a square-like spiral that looks like a spider web. This usually happens if the gradient of \(g(x)\) is negative.
2. Staircase Diagrams: These happen when the sequence approaches the root from one side, creating a series of steps. This usually happens if the gradient of \(g(x)\) is positive.
Step-by-Step for Drawing:
1. Start at \(x_0\) on the x-axis.
2. Move vertically to hit the curve \(y = g(x)\).
3. Move horizontally to hit the line \(y = x\).
4. Repeat! Each horizontal hit on the line \(y = x\) represents your next value (\(x_1, x_2\), etc.).
Key Takeaway: If the "spiral" or "staircase" moves toward the intersection, the iteration is converging (working). If it moves away, it is diverging (failing).
3. The Newton-Raphson Method
The Newton-Raphson method is a more powerful type of iteration. Instead of just "plugging in" a formula, it uses tangents (differentiation) to "slide" down the curve toward the x-axis.
The Formula:
\(x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}\)
Don't worry if this looks scary! It’s basically just: New Guess = Old Guess - (Original Function / Derivative).
Step-by-Step Process:
- Make sure your equation is in the form \(f(x) = 0\).
- Differentiate the function to find \(f'(x)\).
- Plug your \(x_0\) into the formula.
- Use the ANS button on your calculator to speed things up!
Example: To solve \(x^2 - 2 = 0\):
\(f(x) = x^2 - 2\)
\(f'(x) = 2x\)
Formula: \(x_{n+1} = x_n - \frac{x_n^2 - 2}{2x_n}\)
Common Mistake to Avoid: When using Newton-Raphson with trigonometry (like \(\sin(x)\) or \(\cos(x)\)), your calculator MUST be in Radians. If you use degrees, the calculus rules fall apart and your answer will be wrong!
4. When Iteration Fails
Numerical methods are brilliant, but they aren't magic. Sometimes they fail to find a root.
Why \(x = g(x)\) Fails:
An iteration \(x_{n+1} = g(x_n)\) will only converge (find the answer) if the gradient of the curve is "flat enough" at the root.
The Rule: It converges if \(|g'(a)| < 1\), where \(a\) is the root.
If the gradient is steeper than 1 (or less than -1), the numbers will get bigger and bigger and fly away from the answer! It's like trying to land a plane on a treadmill that's moving too fast.
Why Newton-Raphson Fails:
Newton-Raphson fails if the initial value (\(x_0\)) is a stationary point.
Why? Look at the formula: \(x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}\). If you are at a stationary point, \(f'(x) = 0\). You cannot divide by zero! Geometrically, the tangent at a stationary point is horizontal, so it will never cross the x-axis to find a root.
Memory Aid: "Flat fails for Newton." If your starting point is on a "peak" or "valley" (stationary point), the method can't go anywhere.
Summary Checklist
Quick Review:
- Rearranging: Can you change \(f(x)=0\) into \(x=g(x)\)?
- Notation: Remember \(x_{n+1}\) is just the "next number."
- Diagrams: Cobwebs = negative gradient; Staircases = positive gradient.
- Newton-Raphson: Practice the formula \(x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}\).
- Convergence: Check \(|g'(a)| < 1\) for simple iteration.
- Failure: Newton-Raphson dies at stationary points (\(f'(x) = 0\)).
Final Tip: Always show your iterations clearly in the exam. Write down \(x_1, x_2, x_3\) to at least 4 decimal places unless told otherwise. Examiners give marks for the process, even if you make a tiny calculator error at the end!