Welcome to Numerical Methods!
In your math journey so far, you have spent a lot of time solving equations like \( 2x + 4 = 10 \) or \( x^2 - 5x + 6 = 0 \). These are great because we can find the exact answer using algebra.
But what happens when you meet an equation like \( x^3 + x - 1 = 0 \)? There isn't a simple "quadratic formula" for that! This is where Numerical Methods come to the rescue. Instead of finding the exact answer, we use clever tricks to get an answer that is "good enough" (very close to the real thing). Think of it like a GPS: it might not tell you exactly where you are to the nearest atom, but it gets you close enough to find your house!
In this chapter, we will learn how to locate where a root (the solution) is hiding and then "zoom in" on it using three different methods: Interval Bisection, Linear Interpolation, and the Newton-Raphson Process.
1. Locating the Root: The Sign Change Rule
Before we can find a root, we need to know where it is. A root of the equation \( f(x) = 0 \) is simply the x-value where the graph crosses the x-axis.
The Concept: If a continuous graph is below the axis at one point and above the axis at another point, it must have crossed the axis somewhere in between.
The Rule: If \( f(x) \) is continuous on the interval \( [a, b] \) and the values of \( f(a) \) and \( f(b) \) have opposite signs (one is positive, one is negative), then there is at least one root between \( a \) and \( b \).
How to do it:
1. Plug your first x-value \( (a) \) into the function to get \( f(a) \).
2. Plug your second x-value \( (b) \) into the function to get \( f(b) \).
3. Look at the results. If one is \( + \) and the other is \( - \), you’ve found a root!
Example: Show that \( f(x) = x^3 + x - 1 \) has a root between \( x = 0 \) and \( x = 1 \).
\( f(0) = (0)^3 + 0 - 1 = -1 \) (Negative)
\( f(1) = (1)^3 + 1 - 1 = +1 \) (Positive)
Since there is a change of sign and the function is continuous, a root exists between 0 and 1.
Common Mistake to Avoid: This rule only works if the function is continuous (no gaps or jumps). If the graph has an asymptote (like \( y = \frac{1}{x} \)), the sign might change because the graph jumped over the axis, not because it crossed it!
Key Takeaway: A change of sign in a continuous function tells you a root is nearby.
2. Method 1: Interval Bisection
This is the most straightforward method. It’s like playing the "Higher or Lower" game. If I’m thinking of a number between 1 and 100, you guess 50. I say "Higher," so you know the number is between 50 and 100. You keep cutting the range in half until you find it.
Step-by-Step Process:
1. Start with an interval \( [a, b] \) where you know a root exists (from a sign change).
2. Find the midpoint: \( m = \frac{a + b}{2} \).
3. Calculate \( f(m) \).
4. Determine which half contains the root:
- If \( f(m) \) has the opposite sign to \( f(a) \), the root is in the first half \( [a, m] \).
- If \( f(m) \) has the opposite sign to \( f(b) \), the root is in the second half \( [m, b] \).
5. Repeat the process with your new, smaller interval until it's narrow enough for the required accuracy.
Quick Review: Midpoint is just the average of the two ends. This method is slow but very reliable!
Key Takeaway: Bisection "squeezes" the root by repeatedly cutting the interval in half.
3. Method 2: Linear Interpolation
Bisection is reliable but a bit "blind"—it just cuts the middle every time. Linear Interpolation is a bit smarter. It looks at which end of the interval is closer to zero and guesses that the root is probably closer to that end.
Analogy: Imagine a string stretched tight between the points \( (a, f(a)) \) and \( (b, f(b)) \). Where that straight string crosses the x-axis is our estimate for the root.
The Formula:
To find the estimate \( x \), we use the idea of similar triangles:
\( \frac{x - a}{b - a} = \frac{-f(a)}{f(b) - f(a)} \)
Don't worry if this seems tricky! You can also think of it as a ratio: the distance \( x \) is from \( a \) depends on how large \( f(a) \) is compared to the total "jump" from \( f(a) \) to \( f(b) \).
How to do it:
1. Pick your interval \( [a, b] \).
2. Calculate \( f(a) \) and \( f(b) \).
3. Plug the values into the formula to find your estimate \( x \).
4. To improve accuracy, check the sign of \( f(x) \) and create a new, smaller interval, then repeat.
Key Takeaway: Linear interpolation uses a straight line to "predict" where the root is, usually getting closer faster than bisection.
4. Method 3: The Newton-Raphson Process
This is often the fastest method. Instead of using two points, it uses one point and the gradient (slope) of the curve at that point to "slide" down to the x-axis.
Prerequisite Knowledge:
You need to remember how to differentiate from your P1 and P2 units.
If \( f(x) = x^n \), then \( f'(x) = nx^{n-1} \).
The Formula:
The next estimate \( x_{n+1} \) is found using:
\( x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} \)
Step-by-Step Process:
1. Start with an initial guess, \( x_0 \) (the question usually gives you this).
2. Differentiate the function to find \( f'(x) \).
3. Plug \( x_0 \) into the Newton-Raphson formula to find \( x_1 \).
4. Take \( x_1 \) and plug it back into the same formula to find \( x_2 \).
5. Repeat until the value stops changing much (convergence).
Did you know? Newton-Raphson is so powerful that most computers and calculators use a version of it to find square roots and solve equations!
When Newton-Raphson Fails:
Every superhero has a weakness. Newton-Raphson fails if:
- The derivative \( f'(x_n) \) is zero (a stationary point). The formula would involve dividing by zero, which is impossible!
- The initial guess is too far away, and the "tangent slide" takes you away from the root instead of toward it.
Key Takeaway: Newton-Raphson uses tangents to zoom into the root very quickly, provided the gradient isn't zero.
Summary Checklist for Success
- Accuracy: Always check if the question asks for a specific number of decimal places or significant figures.
- Radians: If your \( f(x) \) involves trigonometry (sin, cos, tan), make sure your calculator is in Radians mode! This is a very common mistake in the exam.
- Continuity: Always mention that the function is "continuous" when using the sign-change rule to get those easy explanation marks.
- Iteration: For Newton-Raphson, use the ANS button on your calculator. Type your first guess and hit \( = \). Then type the formula using the "Ans" key instead of \( x \). Every time you hit \( = \), it calculates the next step for you!
You've got this! Numerical methods are just logical steps to follow. Practice these a few times, and they will become second nature.