Pulpul Exam Practice

GATE · XE-A Engineering Mathematics concept book

Numerical Methods

Trapezoidal rule

The trapezoidal rule approximates a definite integral by replacing the integrand on each panel with the straight line joining its two end values, so each panel contributes the area of a trapezoid. For [a,b] divided into n equal subintervals of width h=(b-a)/n, with nodes x_i=a+ih and f_i=f(x_i), the composite rule is $\int_a^b f\,dx \approx \frac{h}{2}\left[f_0+2(f_1+f_2+\cdots+f_{n-1})+f_n\right].$ The weights are 1,2,\dots,2,1 multiplied by h/2. The two end nodes carry half weight, and every interior node carries full weight h. Two counting points cause most errors in exam questions. First, n subintervals means n+1 nodes, so two subintervals use three function values: both ends and the midpoint. Second, when the step size h is given instead of n, the number of subintervals follows from n=(b-a)/h, and the sum must be built from exactly that many nodes.

The rule integrates every linear function exactly. For a function with continuous second derivative, the error is $\int_a^b f\,dx - T = -\frac{(b-a)h^2}{12}f''(\xi), \quad \xi\in(a,b),$ so the error is of order h^2. Where f''>0 the trapezoidal value is larger than the true integral. Do not confuse the trapezoidal rule with Simpson's 1/3 rule, which uses weights 1,4,2,\dots times h/3 and requires an even number of subintervals.

Example: for \int_0^1 x^2\,dx with n=2, h=\tfrac12, we get T=\tfrac14\left[0+2\cdot\tfrac14+1\right]=0.375, compared with the exact value \tfrac13\approx0.333.

Quadrature rule exactness

A quadrature rule \sum_i w_i f(x_i) has degree of exactness m if it integrates every polynomial of degree at most m exactly. Since the rule is linear in f, it is enough to test the monomials 1,x,x^2,\dots,x^m. If the rule is exact on each monomial, it is exact on every linear combination of them. Each test gives one equation in the unknown weights and nodes, with the right-hand side equal to the exact integral of that monomial over the same interval.

On [-1,1] the exact moments are \int_{-1}^1 x^k\,dx=\frac{2}{k+1} for even k and 0 for odd k. Odd monomials give zero by symmetry, which often gives the simplest equation. For example, the rule \int_{-1}^1 f\,dx\approx 2f(0) is exact for 1 and for x, but for x^2 it gives 0 instead of \tfrac23. Its degree of exactness is therefore 1.

When a rule has several free constants, the number of test equations is set by the required degree. Requiring exactness up to degree 3 produces four equations, so a rule with three free constants is over-determined, and consistency itself fixes the parameters. When a question asks which relation among the constants must hold, substitute the monomial tests and check each candidate option against the resulting equations. Do not assume that a relation holds because it looks symmetric.

What comes next

Sign in to read the full text free, up to 2 units a day.

Read this unit in the app

Exams that include this subject: GATE XE · Engineering Sciences