Module 2 · 9 min read · Free chapter
Numerical methods: roots, integrals and differential equations
Numerical methods solve problems that have no neat formula by careful step-by-step approximation. Newton-Raphson finds roots fast using the tangent line. Simpson's rule integrates by fitting parabolas, and Runge-Kutta methods solve differential equations far more accurately than Euler's method for the same step size.
Start from zero: when exact answers run out
Try solving exactly, or integrating from 0 to 1. Neither has a neat formula answer. Most real engineering equations are like this: the beam has varying section, the pipe network has a dozen loops, or the reactor's heat equation has messy boundaries.
Numerical methods give answers as numbers, to any accuracy we need, by repeating simple arithmetic. A computer can do millions of such steps a second. The engineer's job is to pick a method that converges, to know how fast its error falls, and to know when it can fail.
Two ideas run through the chapter. First, iteration: start with a guess and keep improving it. Second, local approximation: replace the hard curve by a straight line or a parabola over a small step, where the maths is easy.
Error words. The order of a method tells how fast its error shrinks as the step shrinks. An error of order falls to one quarter when is halved, and an error of order falls to one-sixteenth.
Why it matters. GATE ME, CE, EE and EC each have one or two questions here, usually a short calculation. The same methods sit inside every design software, from structural analysis to circuit simulation.
Roots of non-linear equations
Bisection is the safest method. If and have opposite signs, a root lies between them. Check the midpoint, keep the half where the sign still changes, and repeat. After steps the root is trapped in an interval of length .
Worked example. For on , and . The midpoint 1.5 gives 0.25, so the root is in . Then 1.25 gives , so it is in , and so on, closing on .
Newton-Raphson is much faster. At the current guess, draw the tangent and see where it crosses the x-axis: . For from , the steps are 1.5, 1.4167 and 1.41422. The number of correct digits roughly doubles each step, which is called quadratic convergence.
When Newton fails. If is close to zero, the tangent is nearly flat and the next guess flies far away. A poor start can also cycle or head to a different root. A common fix is a few bisection steps first, then Newton.
The secant method uses the line through the last two points instead of the tangent, so it needs no derivative. Its order is about 1.618, between bisection's 1 and Newton's 2.
Systems of linear equations
Truss forces, circuit currents by nodal analysis and finite-element models all lead to , often with thousands of unknowns. There are two families of methods.
Direct methods reach the answer in a fixed number of steps. Gaussian elimination clears entries below the diagonal and then back-substitutes. LU decomposition writes once, so that each new right-hand side costs only two quick triangular solves. Both need about multiplications for unknowns.
Iterative methods start with a guess and improve it. In Jacobi, every new is computed from the old values of all others. In Gauss-Seidel, each new value is used as soon as it is found, which usually halves the number of rounds needed.
When do iterations converge? A sufficient condition is strict diagonal dominance: in each row, the size of the diagonal entry exceeds the sum of the sizes of the other entries. Engineering matrices from stiffness and conductance often have this property, which is why iterative methods work so well on them.
Why it matters. For large sparse systems, iteration saves both memory and time compared with elimination. Pivoting, that is swapping rows to bring a large entry to the diagonal, protects elimination from dividing by tiny numbers.
Numerical integration: trapezoidal and Simpson's rules
A surveyor has depths of a river measured every 2 m across its width and needs the cross-section area. An engineer has an indicator diagram from an engine and needs the work done. In both cases we have values at equal spacing , and we need the area under them.
Trapezoidal rule. Join neighbouring points by straight lines and add the trapezoids: . It is exact for straight lines, and its error is of order .
Simpson's rule. Fit a parabola through each group of three points: . It needs an even number of strips. Surprisingly, it is exact for cubics as well as parabolas, and its error is of order .
Worked example. Find with , where . Trapezoidal gives . Simpson gives , which is the exact answer.
Simpson's rule fits cubics through groups of four points and needs strips in multiples of three. It is useful when the number of strips is odd, combined with a rule on the rest.
Interpolation in one line. When values are needed between table entries, Newton's forward-difference formula or Lagrange's formula fits a polynomial through the given points. The integration rules above are just integrals of such fitted polynomials.
Solving differential equations step by step
Many differential equations from the previous chapter have no closed-form solution once real data enters. For with , numerical methods march forward in steps of size .
Euler's method follows the slope at the start of each step: . It is simple but only first order, so halving only halves the error. On a curving solution it drifts steadily off.
Worked example. For , and , Euler gives , while the true value is . The small gap grows with every step.
Modified Euler (Heun's method) first predicts with Euler, then averages the slopes at the start and the predicted end. It is second order. For the same example it gives , much closer.
Runge-Kutta, fourth order (RK4) samples four slopes: at the start, and at the midpoint, and at the end. Then . Its error is of order , which is why it is the default workhorse in engineering software.
Single-step versus multi-step. Euler and Runge-Kutta use only the last point. Multi-step methods such as Adams-Bashforth and Milne's method reuse several past points, so they need fewer new slope evaluations, but they need starting values from a single-step method. In predictor-corrector pairs, an explicit formula predicts and an implicit one corrects.
Descriptive lens: how ESE and state papers ask this
Descriptive papers ask you to carry out a few iterations by hand in a table, compare two methods on the same problem, or explain why one method converges faster.
Our practice questions (not previous-year questions).
- Find a root of by Newton-Raphson, correct to four decimal places, starting from .
- Evaluate by Simpson's rule with , and use it to estimate .
- Solve , for by RK4 with , and compare with Euler's method.
Answer plan for question 2.
- First, tabulate at , giving 1, 0.9412, 0.8, 0.64, 0.5.
- Next, apply .
- Then note that the exact value is , so .
- Finally, comment that four strips already give four correct decimals because the error is of order .
Quick revision
- Bisection always converges, linearly, with error at most after n steps.
- Newton-Raphson: , quadratic near a simple root.
- Secant needs no derivative and has order about 1.618.
- Jacobi and Gauss-Seidel converge for strictly diagonally dominant matrices, and Gauss-Seidel is usually faster.
- Trapezoidal: , error order .
- Simpson : , even strips, exact for cubics, error order .
- Euler is first order, Heun second order, and RK4 fourth order with .
- Multi-step methods need starting values from a single-step method.