Numerical Method BCA fourth semester TU

Numerical Method Concepts Quiz



 Topic: Solution of Nonlinear Equations

Solution of Nonlinear Equations (10 Hours)

Nonlinear equations are equations that involve nonlinear terms, such as variables raised to a power other than one, trigonometric functions, exponential functions, and more. Solving these equations is fundamental in numerical methods, as they arise in many engineering, physics, and mathematical applications.


1. Introduction to Nonlinear Equations

  • A nonlinear equation is an equation of the form f(x)=0f(x) = 0, where f(x)f(x) is a nonlinear function.
  • Examples include:
    • x24=0x^2 – 4 = 0
    • sin(x)x2=0\sin(x) – x^2 = 0
  • These equations generally cannot be solved analytically and require numerical methods.

2. Types of Equations

  • Algebraic Equations: Polynomial equations, e.g., x36x+2=0x^3 – 6x + 2 = 0.
  • Transcendental Equations: Equations involving trigonometric, exponential, or logarithmic functions, e.g., ex3sin(x)=0e^x – 3\sin(x) = 0.

3. Errors in Computing

Errors arise due to approximations in numerical methods. Common types include:

  • Absolute Error: Ea=xtruexapproxE_a = |x_{\text{true}} – x_{\text{approx}}|
  • Relative Error: Er=xtruexapproxxtrueE_r = \frac{|x_{\text{true}} – x_{\text{approx}}|}{|x_{\text{true}}|}
  • Truncation Error: Errors due to approximating a mathematical process.

4. Numerical Methods for Solving Nonlinear Equations


4.1 The Bisection Method

  • Principle: The method divides an interval [a,b][a, b] into halves and repeatedly checks where the root lies. It requires f(a)f(b)<0f(a)f(b) < 0.
  • Formula: c=a+b2,Check: f(c) to find the new interval.c = \frac{a+b}{2}, \quad \text{Check: } f(c) \text{ to find the new interval.}
  • Advantages: Simple and reliable.
  • Disadvantages: Slow convergence.

Example: Solve f(x)=x34x9=0f(x) = x^3 – 4x – 9 = 0 using the Bisection Method on [2,3][2, 3].

  1. f(2)=5f(2) = -5, f(3)=6f(3) = 6, f(2)f(3)<0f(2)f(3) < 0.
  2. Midpoint: c=2+32=2.5c = \frac{2+3}{2} = 2.5, f(2.5)=1.875f(2.5) = -1.875.
  3. Update interval to [2.5,3][2.5, 3].
  4. Repeat until desired accuracy.

Practice Question: Solve x25=0x^2 – 5 = 0 on [2,3][2, 3] using the Bisection Method.


4.2 The Method of False Position (Regula Falsi)

  • Principle: Similar to the Bisection Method but uses a linear approximation between points.
  • Formula: c=af(a)(ba)f(b)f(a)c = a – \frac{f(a)(b-a)}{f(b)-f(a)}
  • Advantages: Faster than Bisection.
  • Disadvantages: Can stagnate.

Example: Solve f(x)=x3x1=0f(x) = x^3 – x – 1 = 0 on [1,2][1, 2].

  1. f(1)=1f(1) = -1, f(2)=5f(2) = 5, f(1)f(2)<0f(1)f(2) < 0.
  2. c=11(21)5(1)=1.1667c = 1 – \frac{-1(2-1)}{5-(-1)} = 1.1667.
  3. Update interval and repeat.

Practice Question: Solve x26=0x^2 – 6 = 0 on [2,3][2, 3] using the Method of False Position.


4.3 Newton-Raphson Method

  • Principle: Uses the tangent line at a point to approximate the root.
  • Formula: xn+1=xnf(xn)f(xn)x_{n+1} = x_n – \frac{f(x_n)}{f'(x_n)}
  • Advantages: Very fast convergence near the root.
  • Disadvantages: Requires derivative and may diverge.

Example: Solve f(x)=x22=0f(x) = x^2 – 2 = 0 with x0=1.5x_0 = 1.5.

  1. f(x)=x22f(x) = x^2 – 2, f(x)=2xf'(x) = 2x.
  2. x1=1.51.5222(1.5)=1.4167x_1 = 1.5 – \frac{1.5^2 – 2}{2(1.5)} = 1.4167.
  3. Repeat until desired accuracy.

Practice Question: Solve ln(x)+x2=0\ln(x) + x – 2 = 0 using Newton-Raphson with x0=1x_0 = 1.


4.4 Fixed-Point Iteration

  • Principle: Rewrites the equation as x=g(x)x = g(x) and iterates.
  • Formula: xn+1=g(xn)x_{n+1} = g(x_n)
  • Convergence Criterion: g(x)<1 near the root.|g'(x)| < 1 \text{ near the root.}

Example: Solve x3+x1=0x^3 + x – 1 = 0 by rewriting as x=1x3x = \sqrt[3]{1 – x}.

  1. g(x)=1x3g(x) = \sqrt[3]{1-x}, x0=0.5x_0 = 0.5.
  2. x1=10.53=0.7937x_1 = \sqrt[3]{1 – 0.5} = 0.7937.
  3. Repeat.

Practice Question: Solve x23=0x^2 – 3 = 0 by Fixed-Point Iteration.


4.5 Solution of a System of Nonlinear Equations

  • Uses extensions of methods like Newton-Raphson.
  • Example: Solve: f(x,y)=x2+y24=0,g(x,y)=x2y1=0f(x, y) = x^2 + y^2 – 4 = 0, \quad g(x, y) = x^2 – y – 1 = 0 using an iterative approach.

Summary

  • Bisection Method: Reliable, slower.
  • Method of False Position: Faster, may stagnate.
  • Newton-Raphson: Fast, requires derivative.
  • Fixed-Point Iteration: Simple, depends on g(x)<1g'(x) < 1.
  • System of Equations: Extension of Newton-Raphson.

Practice Problems

  1. Solve x35x+3=0x^3 – 5x + 3 = 0 using Newton-Raphson with x0=1x_0 = 1.
  2. Solve sin(x)x/2=0\sin(x) – x/2 = 0 on [1,2][1, 2] using the Method of False Position.
  3. Solve the system: x2+y2=5,xy=1x^2 + y^2 = 5, \quad x – y = 1 using a numerical method.

Read more