Numerical Methods · Unit 2
Root Finding Methods
Exam-focused notes for Root Finding Methods (Numerical Methods, BIT203): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.
Root Finding Methods in short
Many equations such as $x^3 + 2x - 2 = 0$ cannot be solved by a formula. Root finding methods start from a guess and improve it step by step until $f(x) = 0$ is met to the needed accuracy.
What this unit covers
- Bisection method derivation and application
- Newton Raphson method formula and convergence
- Secant method formula and derivation
- Comparison of root finding methods
- Horner's method for polynomial evaluation
- Algorithm and implementation of root finding methods
Comparison of root finding methods
2082 · 10 marks
Explain how bisection method differ from secant. Derive the formula for Newton Raphson. Use Newton Raphson method to solve the equation $f(x) = x^3 + 2x - 2$ correct upto three decimal places. [2+4+4]
Show solved answerHide answer
Numerical Methods: Bisection vs Secant, Newton-Raphson
Given Data
- Equation: $f(x) = x^3 + 2x - 2 = 0$
- Required accuracy: three decimal places
- Marks split: $2 + 4 + 4$
(a) Bisection Method vs Secant Method
| Feature | Bisection Method | Secant Method |
|---|---|---|
| Type | Bracketing (closed) method | Open method |
| Initial points | Needs $a,b$ with $f(a)\cdot f(b) < 0$ | Needs any two starting points $x_0, x_1$ (no sign change required) |
| Formula | $x = \dfrac{a+b}{2}$ | $x_{n+1} = x_n - f(x_n)\dfrac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}$ |
| Convergence rate | Linear (slow), order 1 | Superlinear, order $\approx 1.618$ |
| Convergence guarantee | Always converges | May diverge |
| Idea | Repeated halving of interval | Chord (secant line) approximation |
Key difference: Bisection guarantees convergence by successively halving a bracketed interval but is slow; the secant method uses the line joining two previous points and converges faster but is not guaranteed.
(b) Derivation of Newton-Raphson Formula
Let $x_0$ be an initial approximation and $h$ a small correction so that $x_1 = x_0 + h$ is the root, i.e. $f(x_0 + h) = 0$.
Taylor expansion:
$$f(x_0 + h) = f(x_0) + h,f'(x_0) + \frac{h^2}{2!}f''(x_0) + \cdots$$
Neglecting $h^2$ and higher order terms (since $h$ is small):
$$f(x_0) + h,f'(x_0) = 0 \implies h = -\frac{f(x_0)}{f'(x_0)}$$
Therefore:
$$x_1 = x_0 - \frac{f(x_0)}{f'(x_0)}$$
The general iterative formula:
$$\boxed{x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}, \quad n = 0,1,2,\ldots}$$
(valid provided $f'(x_n) \neq 0$).
(c) Solve $f(x) = x^3 + 2x - 2 = 0$
$$f(x) = x^3 + 2x - 2, \qquad f'(x) = 3x^2 + 2$$
Bracketing: $f(0) = -2 < 0$, $f(1) = 1 > 0$, so root in $[0,1]$. Take $x_0 = 1$.
$$x_{n+1} = x_n - \frac{x_n^3 + 2x_n - 2}{3x_n^2 + 2}$$
Iteration 1: $x_0 = 1$ $$f(1) = 1,\quad f'(1) = 5$$ $$x_1 = 1 - \frac{1}{5} = 0.800000$$
Iteration 2: $x_1 = 0.8$ $$f(0.8) = 0.512 + 1.6 - 2 = 0.112$$ $$f'(0.8) = 1.92 + 2 = 3.92$$ $$x_2 = 0.8 - \frac{0.112}{3.92} = 0.771429$$
Iteration 3: $x_2 = 0.771429$ $$f(x_2) = 0.771429^3 + 2(0.771429) - 2 = 0.459045 + 1.542857 - 2 = 0.001902$$ $$f'(x_2) = 3(0.595102) + 2 = 1.785306 + 2 = 3.785306$$ $$x_3 = 0.771429 - \frac{0.001902}{3.785306} = 0.771429 - 0.000502 = 0.770926$$
Iteration 4: $x_3 = 0.770926$ $$f(x_3) = 0.770926^3 + 2(0.770926) - 2$$ $$= 0.458148 + 1.541853 - 2 = 0.000001 \approx 0$$
Check: $|x_3 - x_2| = |0.770926 - 0.771429| = 0.000503 < 0.001$ region; one more confirms stability.
Rounded to three decimals:
$$\boxed{x \approx 0.771}$$
Verification: $f(0.771) = 0.458314 + 1.542 - 2 = 0.000314 \approx 0$. ✓
Algorithm and implementation of root finding methods
2080 · 10 marks
Write an algorithm and a C-Program to obtain roots of non-linear equation using Newton Raphson Method.[10]
Secant method formula and derivation
2080 · 5 marks
Use secant method to estimate the root of the equation $x^2-5x+6=0$, with initial estimate $x_1 = 4$ and $x_2 = 2$ (EPS=0.05). [5]
0 · 10 marks
How Secant methods differs from Newton Raphson method? Derive the formula for Secant Method. Solve the equation $\cos x + 2\sin x - x^2 = 0$ using Secant method. Assume error precision is 0.01. [10]
Bisection method derivation and application
2079 · 10 marks
Question
Define true error and relative error. Derive the bisection method for solving non-linear equation and using this method solve $2x^3 - 2x - 5$ with initial $x_0 = 1$ and $x_1 = 2$. Calculate upto 10th iteration.[10]
Horner's method for polynomial evaluation
2079 · 5 marks
Write an algorithm for Honer's method. Evaluate the polynomial $f(x) = x^4 + 3x^3 + 5x^2 + 7^x + 9$ at x = 2 by using Honer's method. [5]
0 · 5 marks
Define the terms true error and relative error? Write down algorithm for Horner' method to evaluate polynomial and use the method to evaluate the polynomial $2x^3 - 3x^2 + 5x - 2$ at x=3. [5]
Show solved answerHide answer
True Error, Relative Error, and Horner's Method
Given
- Polynomial: $P(x) = 2x^3 - 3x^2 + 5x - 2$
- Coefficients (high to low degree): $a_3 = 2,\ a_2 = -3,\ a_1 = 5,\ a_0 = -2$
- Evaluation point: $x = 3$
Solution
1. True Error
The true error is the difference between the exact (true) value and the approximate (computed) value.
$$E_t = X_{\text{true}} - X_{\text{approx}}$$
It expresses the actual magnitude of the deviation but does not indicate how significant that deviation is relative to the quantity being measured.
2. Relative Error
The relative error is the true error divided by the true value (often given as a percentage).
$$\epsilon_t = \frac{X_{\text{true}} - X_{\text{approx}}}{X_{\text{true}}} = \frac{E_t}{X_{\text{true}}}$$
$$\epsilon_t(%) = \frac{E_t}{X_{\text{true}}} \times 100%$$
It provides a normalized (scale-independent) measure of accuracy.
3. Horner's Method
Horner's method (nested multiplication / synthetic division) rewrites
$$P(x) = a_n x^n + a_{n-1}x^{n-1} + \cdots + a_1 x + a_0$$
as
$$P(x) = (\cdots((a_n x + a_{n-1})x + a_{n-2})x + \cdots)x + a_0$$
reducing the count to $n$ multiplications and $n$ additions.
Algorithm:
Algorithm Horner(a[0..n], n, x):
Step 1: result = a[n]
Step 2: for i = n-1 down to 0:
result = result * x + a[i]
Step 3: return result
4. Evaluation of $P(x) = 2x^3 - 3x^2 + 5x - 2$ at $x = 3$
| Degree | 3 | 2 | 1 | 0 |
|---|---|---|---|---|
| Coeff | 2 | -3 | 5 | -2 |
Step 1: $b_3 = 2$
Step 2: $b_2 = 2 \times 3 + (-3) = 6 - 3 = 3$
Step 3: $b_1 = 3 \times 3 + 5 = 9 + 5 = 14$
Step 4: $b_0 = 14 \times 3 + (-2) = 42 - 2 = 40$
$$\boxed{P(3) = 40}$$
Verification (direct): $$P(3) = 2(27) - 3(9) + 5(3) - 2 = 54 - 27 + 15 - 2 = 40 \checkmark$$
Newton Raphson method formula and convergence
2078 · 5 marks
Show that the rate of convergence of Newtons Raphson method is quadratic. [5]
Make Unit 2 stick
Practice BIT203 with flashcards & quizzes