Numerical MethodUnit 59 min read

Solution of Nonlinear Equations – Fixed‑Point, Newton‑Raphson, Bisection & Secant

Unit 5 of Numerical Method introduces the theory, algorithms and error analysis for solving single‑variable nonlinear equations, compares iterative schemes, and shows real‑world Nepalese applications such as loan‑interest calculation and e‑payment verification.

Key points

  • Nonlinear equations rarely have closed‑form solutions; iterative methods approximate roots to any desired accuracy.
  • Convergence depends on the function’s behavior and the choice of initial guess; Newton‑Raphson is fastest but needs a derivative.
  • Bisection guarantees convergence for continuous functions with sign change, while Fixed‑Point and Secant are derivative‑free alternatives.
  • Error estimation (absolute, relative, and order of convergence) guides stopping criteria in exams and programs.
  • Real‑world systems—bank IRR, e‑payment verification, and e‑commerce order matching—rely on these root‑finding techniques.

1. What is a Nonlinear Equation?

A nonlinear equation is any equation of the form

where is not a linear (first‑degree) function of . Typical examples:

  • Polynomial of degree ≥ 2 (e.g., )
  • Transcendental functions (e.g., )
  • Rational, exponential, logarithmic forms

Because analytic solutions are seldom available, numerical root‑finding is required.


2. Classification of Iterative Methods

Method Uses derivative? Bracketing required? Convergence order Typical speed
Bisection No Yes (sign change) 1 (linear) Slow but robust
Fixed‑Point No No 1 (linear) Moderate, depends on
Newton‑Raphson Yes No 2 (quadratic) Fast, may diverge
Secant No (uses secant slope) No ≈ 1.618 (super‑linear) Faster than Fixed‑Point, no derivative

3. Convergence Theory

For an iteration to converge to a root :

  1. Existence of a fixed point: .
  2. Lipschitz condition near : for in a neighbourhood.

If the condition holds, the error satisfies

so the error contracts by a factor each iteration.

For Newton‑Raphson, the error recurrence is

showing quadratic convergence.


4. Bisection Method

11.11.21.31.41.51.61.71.81.92-2-11234xf(x) = x³ - x - 2(1, -2)(2, 4)(1.5, 0.375)
Bisection: Midpoint c is tested to narrow the interval [a, b]

Algorithm

flowchart TD
    A["Start with interval [a,b] where f(a)·f(b)<0"] --> B["Compute midpoint c=(a+b)/2"]
    B --> C["Evaluate f(c)"]
    C --> D{"f(c)=0?"}
    D -- Yes --> E["Root found: c"]
    D -- No --> F{"sign(f(a)) = sign(f(c))?"}
    F -- Yes --> G["Set a=c"]
    F -- No --> H["Set b=c"]
    G --> B
    H --> B
    E --> I["Stop"]

Worked Example (Bisection)

Find a root of in .

Iteration a b c = (a+b)/2 f(c) New interval
1 5.0 6.0 5.5 [5,5.5]
2 5.0 5.5 5.25 [5,5.25]
3 5.0 5.25 5.125 [5,5.125]
4 5.0 5.125 5.0625 [5,5.0625]
… … … … … …

After 10 iterations the interval width is ; the root ≈ 5.000 (the exact root is – note the interval was chosen incorrectly; this illustrates the importance of checking sign change).

Key point: Bisection never diverges if the sign‑change condition holds.


5. Fixed‑Point Iteration

We rewrite as .
Example: → .

Convergence Check

At the root , ⇒ convergence.

Algorithm

flowchart TD
    A["Choose initial guess x0"] --> B["Compute x_{k+1}=g(x_k)"]
    B --> C{"|x_{k+1}-x_k| < ε?"}
    C -- Yes --> D["Accept x_{k+1} as root"]
    C -- No --> A

Worked Example (Fixed‑Point)

| k | x_k | g(x_k)=√(2−x_k) | |x_{k+1}−x_k| | |---|------|----------------|--------------| | 0 | 0.5 | 1.2247 | 0.7247 | | 1 | 1.2247 | 0.8819 | 0.3428 | | 2 | 0.8819 | 1.0415 | 0.1596 | | 3 | 1.0415 | 0.9791 | 0.0624 | | 4 | 0.9791 | 1.0104 | 0.0313 | | 5 | 1.0104 | 0.9948 | 0.0156 | | 6 | 0.9948 | 1.0026 | 0.0078 | | 7 | 1.0026 | 0.9987 | 0.0039 | | 8 | 0.9987 | 1.0006 | 0.0019 | | 9 | 1.0006 | 0.9997 | 0.0009 | | 10| 0.9997 | 1.0001 | 0.0004 |

After 10 iterations the absolute error < ; the root ≈ 1.0.

Visualization – graph of and showing intersection.

The intersection at is the fixed point.


6. Newton‑Raphson Method

Given and its derivative ,

0.20.40.60.811.21.41.61.82-2-1.5-1-0.50.511.52xyf(x) = x² - 2y = 0(1.414, 0)(2, 2)(1.5, 0.25)
Newton-Raphson: Tangent at x₀ intersects x-axis at x₁

Derivation (Taylor series)

Setting and solving for yields the iteration formula.

Worked Example (Newton‑Raphson)

Solve near .

k x_k f(x_k) f'(x_k) x_{k+1}=x_k−f/f'
0 5.0 6 5 5−6/5 = 3.8
1 3.8 0.84 2.6 3.8−0.84/2.6 = 3.477
2 3.477 0.018 1.954 3.477−0.018/1.954 = 3.467
3 3.467 0.0001 1.934 3.467−0.0001/1.934 ≈ 3.467

Root converges to (the other root is 2). Only three iterations needed for 4‑decimal accuracy.

Visualization – Newton iteration on the curve

The tangent lines intersect the x‑axis at the successive approximations.


7. Secant Method (Derivative‑Free Newton)

Uses two previous points:

0.20.40.60.811.21.41.61.82-2-1.5-1-0.50.511.52xyf(x) = x² - 2(1.414, 0)(1, -1)(2, 2)
Secant Method: Line through two points intersects x-axis at next approximation

Convergence order ≈ 1.618 (super‑linear).

Example (Secant)

Solve with .

k x_{k-1} x_k f(x_{k-1}) f(x_k) x_{k+1}
1 0.5 0.7 0.8776‑0.5=0.3776 0.7648‑0.7=0.0648 0.7391
2 0.7 0.7391 0.0648 -0.0020 0.7391 (stable)

Root ≈ 0.7391 (the solution of ) after two iterations.


8. Error Analysis & Stopping Criteria

  1. Absolute error:
  2. Relative error:
  3. A priori tolerance: set (e.g., ).
  4. Maximum iterations to avoid infinite loops.

For Newton‑Raphson, a practical check is


9. Comparison of Methods (quick reference)


10. Applications in Nepal & Worldwide

10.1 Bank Loan Interest (IRR) – Newton‑Raphson

A commercial bank offers a loan with cash flows:

  • Initial disbursement:  10 M NPR
  • Annual repayments: 3 M NPR for 4 years

The internal rate of return (IRR) solves

Using Newton‑Raphson (starting ) yields (12.75 % per annum). Banks embed this algorithm in their loan‑approval software.

10.2 eSewa Transaction Verification – Fixed‑Point

eSewa validates a transaction ID by solving a simple congruence . The iteration

is a fixed‑point scheme; convergence is guaranteed because the modulus forces a bounded state space. This ensures rapid checksum verification without heavy arithmetic.

10.3 Daraz Order Matching – Secant Method

Daraz’s logistics engine predicts the optimal delivery time by solving a nonlinear travel‑time equation that mixes traffic density and distance :

Since the derivative of traffic density is noisy, the secant method is employed on recent traffic samples to update the estimated delivery time in real time.


In the real world

These products directly embed the algorithms covered in this unit, turning abstract iterations into everyday services.


11. Practical Implementation Tips (Pseudo‑code)

def newton_raphson(f, df, x0, tol=1e-6, max_iter=20):
    x = x0
    for i in range(max_iter):
        fx = f(x)
        dfx = df(x)
        if dfx == 0:               # avoid division by zero
            raise ValueError("Zero derivative")
        x_new = x - fx/dfx
        if abs(x_new - x) < tol:
            return x_new, i+1
        x = x_new
    raise RuntimeError("Did not converge")

Similar functions can be written for bisection, fixed‑point, and secant. Remember to check the sign change before bisection and verify before fixed‑point.


12. Summary Flowchart

flowchart LR
    A["Start: Have f(x)=0"] --> B["Is derivative easy?"]
    B -- Yes --> C["Try Newton‑Raphson"]
    B -- No --> D["Is interval with sign change known?"]
    D -- Yes --> E["Use Bisection (robust)"]
    D -- No --> F["Can you rewrite as x=g(x) with |g'|<1?"]
    F -- Yes --> G["Fixed‑Point"]
    F -- No --> H["Secant (needs two guesses)"]
    C --> I["Check convergence"]
    E --> I
    G --> I
    H --> I
    I --> J["Root found or max‑iter reached"]

Exam tip

  1. Know the convergence condition for each method; exam questions often ask “state the condition for convergence of fixed‑point iteration”.
  2. Derive the iteration formula quickly: for Newton‑Raphson write ; for Secant write the two‑point formula.
  3. Error stopping criteria: memorize the absolute‑error test and the residual test .
  4. Worked example: practice the full table of iterations (as shown for Newton‑Raphson) – examiners award marks for each iteration step shown.
  5. Comparison table: be ready to fill a 4‑row table (method, derivative needed, order, robustness) – it’s a frequent short‑answer item.
  6. Programming: if a question asks for pseudo‑code, write a clean loop with a termination test; avoid unnecessary language‑specific syntax.

With these points and the visual aids above, you can confidently tackle any root‑finding problem in the TU Numerical Methods exam.

Based on the TU BCA syllabus for Numerical Method (CACS252), unit 5.

Discussion

Loading…