Numerical Methods: University Study Notes
Original educational notes covering core concepts, formulas, examples, and practice questions
Purpose: These notes provide a concise introduction to numerical methods for undergraduate students in
engineering, computer science, and applied mathematics.
1. Introduction to Numerical Methods
Numerical methods are techniques used to obtain approximate solutions to mathematical problems when exact
analytical solutions are difficult, impossible, or inefficient to calculate. They are widely used in engineering
simulations, scientific computing, data analysis, and computer graphics.
Common sources of error
• Round-off error: caused by storing numbers with limited precision.
• Truncation error: caused by replacing an exact mathematical process with an approximation.
• Measurement error: caused by inaccurate input data.
• Iteration error: caused by stopping an iterative method before reaching the desired accuracy.
2. Absolute, Relative, and Percentage Error
If the exact value is x and the approximate value is x■:
Absolute error = |x − x■|
Relative error = |(x − x■) / x|
Percentage error = Relative error × 100
Example: The exact value is 3.14159 and the approximation is 3.14. Absolute error = 0.00159. Percentage
error ≈ 0.0506%.
3. Solution of Nonlinear Equations
A nonlinear equation has the general form f(x)=0. Numerical methods estimate the root when algebraic methods
are inconvenient.
3.1 Bisection Method
The bisection method requires an interval [a,b] where f(a) and f(b) have opposite signs. The midpoint is
calculated as:
c = (a + b) / 2
Evaluate f(c). Select the half-interval that still contains a sign change. Repeat until the interval or function value
is sufficiently small.
Advantages: Simple and guaranteed to converge for continuous functions with a sign change.
Limitation: Usually slower than Newton-Raphson.
3.2 Newton-Raphson Method
x■■■ = x■ − f(x■)/f′(x■)
It uses the tangent line at the current estimate to obtain a better estimate. It can converge very quickly when the
initial guess is suitable, but may fail if the derivative is zero or the starting value is poor.
3.3 Secant Method
x■■■ = x■ − f(x■)(x■−x■■■)/(f(x■)−f(x■■■))
The secant method approximates the derivative using two previous points and does not require an explicit
derivative formula.
4. Systems of Linear Equations
A linear system can be written as AX=b, where A is the coefficient matrix, X is the vector of unknowns, and b is
the constants vector.
4.1 Gaussian Elimination
Gaussian elimination transforms the augmented matrix into upper triangular form using elementary row
operations. Back substitution is then used to find the unknowns.
Basic steps:
1. Form the augmented matrix.
2. Eliminate entries below each pivot.
3. Continue until an upper triangular matrix is obtained.
4. Solve from the last equation upward.
4.2 Gauss-Seidel Iteration
Gauss-Seidel is an iterative method in which newly calculated values are immediately used in the next
calculations. It often performs well for diagonally dominant systems.
5. Interpolation
Interpolation estimates the value of a function between known data points.
5.1 Linear Interpolation
y = y■ + [(x−x■)/(x■−x■)](y■−y■)
Example: If (2,5) and (6,13) are known, estimate y at x=4. Since x=4 is halfway between 2 and 6, y=9.
5.2 Newton’s Divided-Difference Interpolation
This method builds a polynomial using divided differences. It is useful when data points are not equally spaced.
6. Numerical Differentiation
Forward difference: f′(x) ≈ [f(x+h)−f(x)]/h
Backward difference: f′(x) ≈ [f(x)−f(x−h)]/h
Central difference: f′(x) ≈ [f(x+h)−f(x−h)]/(2h)
The central-difference formula is generally more accurate than the forward and backward formulas for the same
step size.
7. Numerical Integration
Numerical integration estimates the area under a curve when an antiderivative is difficult to obtain.
7.1 Trapezoidal Rule
∫■■ f(x) dx ≈ (b−a)[f(a)+f(b)]/2
Composite trapezoidal rule divides the interval into several smaller subintervals and adds the areas of the
trapezoids.
7.2 Simpson’s 1/3 Rule
For an even number n of equal subintervals: integral ≈ (h/3)[f(x■)+f(x■)+4(sum of odd-indexed values)+2(sum
of even-indexed interior values)].
Simpson’s rule is often more accurate than the trapezoidal rule for smooth functions.
8. Ordinary Differential Equations
An ordinary differential equation relates a function to one or more of its derivatives.
8.1 Euler’s Method
y■■■ = y■ + h f(x■,y■)
Euler’s method uses the slope at the current point to predict the next value. It is easy to implement but may
require a small step size for good accuracy.
8.2 Runge-Kutta Method
The fourth-order Runge-Kutta method uses four slope estimates in each step and is generally much more
accurate than basic Euler’s method.
9. Practical Tips for Solving Numerical Problems
• Clearly identify the given data and required quantity.
• Keep sufficient decimal places during intermediate calculations.
• Check whether a method requires a sign-changing interval, derivative, or equally spaced data.
• State the stopping criterion for iterative methods.
• Verify the final answer by substitution or an independent method when possible.
• Report the answer with a sensible number of significant figures.
10. Practice Questions
1. Calculate the absolute and percentage error when the exact value is 2.71828 and the approximation is 2.72.
2. Use two bisection iterations to locate a root of f(x)=x²−4 in the interval [1,3].
3. Perform one Newton-Raphson iteration for f(x)=x²−5 using x■=2.
4. Use linear interpolation to estimate y at x=7 from points (5,10) and (9,18).
5. Approximate the derivative of f(x)=x² at x=3 using h=0.1 and the central-difference formula.
6. Apply the trapezoidal rule with one interval to estimate the integral of f(x)=x² from 0 to 2.
7. Explain two differences between Gaussian elimination and Gauss-Seidel iteration.
8. Write the Euler formula for solving y′=f(x,y) and explain each symbol.
Conclusion
Numerical methods provide practical ways to solve mathematical problems using systematic approximations.
Understanding error, convergence, and method selection is as important as memorizing formulas. Regular
practice with small examples builds the foundation for engineering and scientific computing.