Engineering Mathematics‹›⌂ 0:00 studied

Module 2 · 9 min read · Free chapter

Numerical methods: roots, integrals and differential equations

In short

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.

What are you preparing for? We show the practice and previous year questions of your exam.

Start from zero: when exact answers run out

Try solving x=cos⁡xx = \cos x exactly, or integrating e−x2e^{-x^2} 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 hh shrinks. An error of order h2h^2 falls to one quarter when hh is halved, and an error of order h4h^4 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 f(a)f(a) and f(b)f(b) have opposite signs, a root lies between them. Check the midpoint, keep the half where the sign still changes, and repeat. After nn steps the root is trapped in an interval of length b−a2n\dfrac{b-a}{2^n}.

Worked example. For f(x)=x2−2f(x) = x^2 - 2 on [1,2][1, 2], f(1)=−1f(1) = -1 and f(2)=2f(2) = 2. The midpoint 1.5 gives 0.25, so the root is in [1,1.5][1, 1.5]. Then 1.25 gives −0.4375-0.4375, so it is in [1.25,1.5][1.25, 1.5], and so on, closing on 2≈1.4142\sqrt{2} \approx 1.4142.

Newton-Raphson is much faster. At the current guess, draw the tangent and see where it crosses the x-axis: xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}. For x2−2x^2 - 2 from x0=2x_0 = 2, 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 f′(xn)f'(x_n) 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 Ax=bAx = b, 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 A=LUA = LU once, so that each new right-hand side bb costs only two quick triangular solves. Both need about n33\dfrac{n^3}{3} multiplications for nn unknowns.

Iterative methods start with a guess and improve it. In Jacobi, every new xix_i 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 yiy_i at equal spacing hh, and we need the area under them.

Trapezoidal rule. Join neighbouring points by straight lines and add the trapezoids: ∫≈h2[y0+2(y1+y2+⋯+yn−1)+yn]\int \approx \dfrac{h}{2}[y_0 + 2(y_1 + y_2 + \cdots + y_{n-1}) + y_n]. It is exact for straight lines, and its error is of order h2h^2.

Simpson's 13\dfrac{1}{3} rule. Fit a parabola through each group of three points: ∫≈h3[y0+4(y1+y3+⋯ )+2(y2+y4+⋯ )+yn]\int \approx \dfrac{h}{3}[y_0 + 4(y_1 + y_3 + \cdots) + 2(y_2 + y_4 + \cdots) + y_n]. It needs an even number of strips. Surprisingly, it is exact for cubics as well as parabolas, and its error is of order h4h^4.

Worked example. Find ∫02x3 dx\int_0^2 x^3\,dx with h=1h = 1, where y=0,1,8y = 0, 1, 8. Trapezoidal gives 12(0+2×1+8)=5\dfrac{1}{2}(0 + 2 \times 1 + 8) = 5. Simpson gives 13(0+4×1+8)=4\dfrac{1}{3}(0 + 4 \times 1 + 8) = 4, which is the exact answer.

Simpson's 38\dfrac{3}{8} 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 13\dfrac{1}{3} 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 y′=f(x,y)y' = f(x, y) with y(x0)=y0y(x_0) = y_0, numerical methods march forward in steps of size hh.

Euler's method follows the slope at the start of each step: yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,f(x_n, y_n). It is simple but only first order, so halving hh only halves the error. On a curving solution it drifts steadily off.

Worked example. For y′=yy' = y, y(0)=1y(0) = 1 and h=0.1h = 0.1, Euler gives y(0.1)≈1.1y(0.1) \approx 1.1, while the true value is e0.1≈1.10517e^{0.1} \approx 1.10517. 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 1+0.1×1+1.12=1.1051 + 0.1 \times \dfrac{1 + 1.1}{2} = 1.105, much closer.

Runge-Kutta, fourth order (RK4) samples four slopes: k1k_1 at the start, k2k_2 and k3k_3 at the midpoint, and k4k_4 at the end. Then yn+1=yn+k1+2k2+2k3+k46y_{n+1} = y_n + \dfrac{k_1 + 2k_2 + 2k_3 + k_4}{6}. Its error is of order h4h^4, 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).

  1. Find a root of x3−x−1=0x^3 - x - 1 = 0 by Newton-Raphson, correct to four decimal places, starting from x0=1.5x_0 = 1.5.
  2. Evaluate ∫01dx1+x2\int_0^1 \dfrac{dx}{1+x^2} by Simpson's 13\dfrac{1}{3} rule with h=0.25h = 0.25, and use it to estimate π\pi.
  3. Solve y′=x+yy' = x + y, y(0)=1y(0) = 1 for y(0.2)y(0.2) by RK4 with h=0.1h = 0.1, and compare with Euler's method.

Answer plan for question 2.

  • First, tabulate y=11+x2y = \dfrac{1}{1+x^2} at x=0,0.25,0.5,0.75,1x = 0, 0.25, 0.5, 0.75, 1, giving 1, 0.9412, 0.8, 0.64, 0.5.
  • Next, apply h3[y0+4(y1+y3)+2y2+y4]=0.253[1+4(1.5812)+1.6+0.5]≈0.7854\dfrac{h}{3}[y_0 + 4(y_1 + y_3) + 2y_2 + y_4] = \dfrac{0.25}{3}[1 + 4(1.5812) + 1.6 + 0.5] \approx 0.7854.
  • Then note that the exact value is tan⁡−11=π4\tan^{-1}1 = \dfrac{\pi}{4}, so π≈4×0.7854=3.1416\pi \approx 4 \times 0.7854 = 3.1416.
  • Finally, comment that four strips already give four correct decimals because the error is of order h4h^4.

Quick revision

  • Bisection always converges, linearly, with error at most b−a2n\dfrac{b-a}{2^n} after n steps.
  • Newton-Raphson: xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}, 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: h2[ends+2×middle]\dfrac{h}{2}[\text{ends} + 2 \times \text{middle}], error order h2h^2.
  • Simpson 13\dfrac{1}{3}: h3[ends+4×odd+2×even]\dfrac{h}{3}[\text{ends} + 4 \times \text{odd} + 2 \times \text{even}], even strips, exact for cubics, error order h4h^4.
  • Euler is first order, Heun second order, and RK4 fourth order with k1+2k2+2k3+k46\dfrac{k_1 + 2k_2 + 2k_3 + k_4}{6}.
  • Multi-step methods need starting values from a single-step method.

Check yourself

Exam-style questions on this chapter. Pick an answer to see the explanation. 0 of 13 answered

  1. The Newton-Raphson formula for a root of f(x)=0f(x) = 0 is:

  2. Applying Newton-Raphson to x2−2=0x^2 - 2 = 0 from x0=2x_0 = 2, x1x_1 equals:

  3. The order of convergence of Newton-Raphson at a simple root is:

  4. Bisection on an interval of length 1 needs how many steps to bring the error below 0.01?

  5. A sufficient condition for Gauss-Seidel iteration to converge is that the matrix is:

  6. Gauss-Seidel differs from Jacobi because it:

  7. ∫02x3 dx\int_0^2 x^3\,dx by the trapezoidal rule with h=1h = 1 gives:

  8. Simpson's 13\dfrac{1}{3} rule is exact for polynomials up to degree:

  9. Simpson's 13\dfrac{1}{3} rule requires the number of intervals to be:

  10. If the step hh is halved, the error of the trapezoidal rule becomes about:

  11. For y′=yy' = y, y(0)=1y(0) = 1, one Euler step with h=0.1h = 0.1 gives y(0.1)≈y(0.1) \approx

  12. The classical fourth-order Runge-Kutta method combines the slopes as:

  13. Which of these is a multi-step method?

Previous year questions

Previous year questions for UPSC CSE will appear here once each one is checked word for word against the official question paper.

Learn with AI

A tutor that asks instead of telling, a partner that argues the other side, and this chapter told through your own district.

Tell the tutor what you are stuck on. It will guide you with questions and give the answer after a few tries.

🙋 Raise a doubt or feedback

Stuck somewhere, or spotted a mistake? Write to the ExamHike team. We usually reply within a day, and you will see the reply on My progress.

Log in to ask a doubt or send feedback →

Frequently asked questions

What is the order of convergence of Newton-Raphson?

Quadratic (order 2) near a simple root.

How many intervals does Simpson's 1/3 rule need?

An even number.

Which method always converges if the root is bracketed?

The bisection method.

What is the error order of the RK4 method?

Global error of order h⁴.

More in this module: Equations, probability and numerical methods

Official sources

Facts in this chapter were checked against these official sources.

  1. GATE 2026 syllabus ME, Section 1 Engineering Mathematics
  2. GATE 2026 syllabus EE, Section 1 Engineering Mathematics
  3. NPTEL Numerical Methods (IIT Roorkee, 111107105)