MTH117 Mathematics I

Mathematics IUnit 817 min read

Numerical Methods – Roots, Integration, Interpolation & ODEs

Unit 8 of Mathematics I covers numerical techniques for approximating roots of equations, definite integrals, interpolation, and solving ordinary differential equations (ODEs) using methods like the bisection, Newton-Raphson, trapezoidal rule, Simpson’s rule, Euler’s method, and Runge-Kutta, with emphasis on error anal

1. Introduction to Numerical Methods

Numerical methods are computational algorithms used to approximate solutions to mathematical problems that cannot be solved analytically (exactly). They are essential in engineering, physics, and computer science when exact solutions are intractable.

Why Numerical Methods?

  • Many real-world problems (e.g., root-finding, integration, ODEs) lack closed-form solutions.
  • Computers require step-by-step procedures to approximate solutions.
  • Methods like Newton-Raphson (for roots) or Simpson’s rule (for integration) provide practical alternatives.

2. Root-Finding Methods

2.1 Bisection Method

Definition: A bracketing method that repeatedly bisects an interval where and have opposite signs (Intermediate Value Theorem). The midpoint is tested, and the subinterval containing the root is retained.

How it works:

  1. Check (root exists in ).
  2. Compute .
  3. If , is the root.
  4. Else, replace or with based on the sign of .
  5. Repeat until .

Example: Find the root of in with tolerance .

Trace:

Iteration New Interval
1 2 3 2.5 -0.625 [2.5, 3]
2 2.5 3 2.75 0.984 [2.5, 2.75]
3 2.5 2.75 2.625 0.177 [2.5, 2.625]
... ... ... ... ... ...

Final root ≈ 2.0945 (after 10 iterations).

Advantages/Disadvantages:

Advantages Disadvantages
Guaranteed convergence if . Slow convergence (linear).
No derivative required. Requires initial bracket.

2.2 Newton-Raphson Method

Definition: An open method that uses the function’s derivative to iteratively approximate roots. The update formula is:

How it works:

  1. Choose an initial guess .
  2. Compute using the formula above.
  3. Repeat until .

Example: Find (i.e., solve ) to 5 decimal places.

Trace: Let , . Start with .

Iteration
1 1.2 -0.287 9.331 1.2307
2 1.2307 0.0003 10.24 1.23074
3 1.23074 ~0 ~10.25 1.23074055

Final root ≈ 1.23074 (converges quickly).

Advantages/Disadvantages:

Advantages Disadvantages
Fast convergence (quadratic). Requires derivative.
Works well for smooth functions. May diverge if is poor.

Comparison Table: Bisection vs. Newton-Raphson

Feature Bisection Method Newton-Raphson Method
Convergence Rate Linear () Quadratic ()
Derivative Needed? No Yes
Initial Guess Requires bracket Single point
Guaranteed? Yes (if ) No (depends on )

3. Numerical Integration

3.1 Rectangle Method (Riemann Sums)

Definition: Approximates the area under a curve from to by dividing into subintervals and summing the areas of rectangles.

Types:

  1. Left Endpoint Rule:
  2. Right Endpoint Rule:
  3. Midpoint Rule:

Example: Estimate using the left endpoint rule with subintervals.

Trace:

  • .
  • .
  • .
  • Approximation: .
  • Exact value: .

Error Analysis: The error for the rectangle method is bounded by: For , , so: The approximation has an error of , which is larger than the bound (since the bound is for the worst-case error over all possible ).


3.2 Trapezoidal Rule

Definition: Approximates the integral by dividing into subintervals and summing the areas of trapezoids formed by secant lines.

Formula:

Example: Use the trapezoidal rule with to estimate .

Trace:

  • .
  • .
  • .
  • Approximation:
  • Exact value: .

Error Bound: For , , so: The approximation error is , which is within the bound.


3.3 Simpson’s Rule

Definition: A more accurate method that fits parabolas to pairs of subintervals. Requires an even number of subintervals ( must be even).

Formula:

Example: Estimate using Simpson’s rule with .

Trace:

  • .
  • .
  • .
  • Approximation:
  • Exact value: .

Error Bound: For , , so: The approximation error is , which is larger than the bound (due to rounding in intermediate steps).

Comparison Table: Integration Methods

Method Formula Error Order Notes
Left Rectangle Simplest but least accurate.
Trapezoidal Better than rectangles.
Simpson’s Most accurate for smooth functions.

4. Numerical Solution of ODEs

4.1 Euler’s Method

Definition: A first-order method for approximating solutions to initial value problems (IVPs) of the form: The update formula is:

Example: Solve , from to with .

Trace:

0 0.0 1.0 1.0 1.0 + 0.1*1.0 = 1.1
1 0.1 1.1 1.2 1.1 + 0.1*1.2 = 1.22
2 0.2 1.22 1.42 1.22 + 0.1*1.42 = 1.362
3 0.3 1.362 1.662 1.362 + 0.1*1.662 = 1.5282
4 0.4 1.5282 1.9282 1.5282 + 0.1*1.9282 = 1.7210
5 0.5 1.7210 - -

Exact solution: . At , exact , Euler’s approximation: .

Error Analysis: The local truncation error for Euler’s method is , and the global error is .


4.2 Runge-Kutta Methods (RK4)

Definition: A higher-order method that improves accuracy by evaluating the derivative at intermediate points. The fourth-order Runge-Kutta (RK4) method is widely used.

Update Formula:

Example: Solve the same IVP , using RK4 with .

Trace for to :

  • , .
  • .
  • .
  • .
  • .
  • .

Comparison with Euler:

  • Euler gave .
  • RK4 gives (closer to the exact value).

Error Analysis: RK4 has a local truncation error of and a global error of , making it far more accurate than Euler’s method.


5. Interpolation (Lagrange’s Method)

Definition: Given data points , the Lagrange interpolating polynomial is:

Example: Find the polynomial passing through , , and .

Trace: Thus, Simplifying: Correction: The exact polynomial should be (since the points lie on ). The error arises from algebraic simplification. Instead, observe that the points , , lie on , so the interpolating polynomial is .

Note: Lagrange interpolation is exact for polynomials of degree .


6. Exam Tips for Numerical Methods

6.1 Common Pitfalls

  1. Incorrect Interval Division:

    • For the rectangle method, ensure and .
    • For Simpson’s rule, must be even.
  2. Sign Errors in Bisection:

    • Always check before applying the bisection method.
  3. Derivative Calculations in Newton-Raphson:

    • Forgetting to compute or misapplying the chain rule can lead to incorrect iterations.
  4. Step Size in ODEs:

    • Smaller improves accuracy but increases computation time. Justify your choice in exams.
  5. Interpolation Degree:

    • Using high-degree polynomials can lead to Runge’s phenomenon (oscillations). Stick to low-degree interpolations unless specified.

6.2 What Examiners Look For

  • Correct Formulas: Write down the exact formula (e.g., Newton-Raphson, Simpson’s rule) before plugging in values.
  • Step-by-Step Calculations: Show intermediate steps, especially in iterative methods.
  • Error Analysis: Mention the error bound (e.g., for trapezoidal rule) even if not asked explicitly.
  • Units and Tolerance: In root-finding, state the tolerance (e.g., ) and how many iterations were needed.
  • Graphical Interpretation: For integration, sketch the curve and rectangles/trapezoids to justify your approximation.

6.3 High-Scoring Strategies

  1. Compare Methods:

    • If asked to approximate an integral, compute it using both the trapezoidal and Simpson’s rules and discuss which is more accurate.
  2. Verify Convergence:

    • For root-finding, show that the method converges by checking the change in between iterations.
  3. Use Exact Values for Verification:

    • If the exact solution is known (e.g., ), compare your numerical result to it.
  4. Discuss Limitations:

    • For example, Newton-Raphson may fail if or if the initial guess is poor.
  5. Practical Applications:

    • Relate numerical methods to real-world problems, such as:
      • Root-finding: Designing algorithms for optimization.
      • Integration: Calculating areas under probability density functions.
      • ODEs: Modeling population growth or heat transfer.

7. Summary Table of Key Methods

Method Problem Type Formula Error Order When to Use
Bisection Root-finding Guaranteed convergence, no derivative.
Newton-Raphson Root-finding Fast convergence, smooth functions.
Left Rectangle Integration Quick estimate, low accuracy.
Trapezoidal Rule Integration Better than rectangles.
Simpson’s Rule Integration High accuracy, smooth functions.
Euler’s Method ODEs Simple but inaccurate.
RK4 ODEs High accuracy, preferred for most problems.
Lagrange Interpolation Interpolation Exact for polynomials Fitting data points.

8. Practice Problems (Exam-Style)

  1. Root-Finding: Use the bisection method to find the root of in with a tolerance of . Show the first 3 iterations.

  2. Numerical Integration: Estimate using:

    • (a) The trapezoidal rule with .
    • (b) Simpson’s rule with . Compare with the exact value .
  3. ODEs: Solve , from to using:

    • (a) Euler’s method with .
    • (b) RK4 with .
  4. Interpolation: Find the Lagrange polynomial for the points , , .


9. References

  • Burden, R.L., & Faires, J.D. (2011). Numerical Analysis (9th ed.). Brooks/Cole.
  • Stewart, J. (2015). Calculus: Early Transcendentals (8th ed.). Cengage.
  • TU Syllabus for Mathematics I (MTH117), Tribhuvan University.

Note: Always cross-verify your results with exact solutions where possible. In exams, prioritize clarity and correctness over speed. Good luck!**

Based on the TU BSc CSIT syllabus for Mathematics I (MTH117), unit 8.

Discussion

Loading…