0% found this document useful (0 votes)
2 views13 pages

Indian Institute of Technology Indore MA 204N: Numerical Methods

This document presents solutions to two problems related to numerical integration techniques, specifically focusing on the quadrature formula coefficients and the generalized trapezoidal rule. It details the derivation of coefficients for the quadrature formula, the associated error term, and the degree of precision, concluding that the error term has a specific form. Additionally, it outlines the generalized trapezoidal rule, determining its error term and providing a composite rule for numerical integration over an interval.

Uploaded by

akash.vg7188
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views13 pages

Indian Institute of Technology Indore MA 204N: Numerical Methods

This document presents solutions to two problems related to numerical integration techniques, specifically focusing on the quadrature formula coefficients and the generalized trapezoidal rule. It details the derivation of coefficients for the quadrature formula, the associated error term, and the degree of precision, concluding that the error term has a specific form. Additionally, it outlines the generalized trapezoidal rule, determining its error term and providing a composite rule for numerical integration over an interval.

Uploaded by

akash.vg7188
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IIT Indore MA 204N – Numerical Methods

Indian Institute of Technology Indore


MA 204N: Numerical Methods
Tutorial Sheet–2: Numerical Integration
Solutions

March 20, 2026

Problem 1. Quadrature Formula Coefficients and Error Term


Problem. Determine the coefficients a, b, c in the quadrature formula
Z x1
f (x) dx = h(af0 + bf1 + cf2 ) + R,
x0

where fi = f (xi ), xi = x0 + ih, i = 0, 1, 2. Prove that the error term R has the form
R = kf (n) (ζ), x0 < ζ < x1 , and determine k and n.
Solution.

Step 1: Method of Undetermined Coefficients


We require the formula to be exact for f (x) = 1, x, x2 (three basis functions, three
unknowns). Without loss of generality set x0 = 0 so that x1 = h and x2 = 2h. After
finding a, b, c we translate back.
Case f (x) = 1:
Z h
1 dx = h =⇒ h(a + b + c) = h =⇒ a + b + c = 1.
0

Case f (x) = x: Here f0 = 0, f1 = h, f2 = 2h.


Z h
h2 h2 1
x dx = =⇒ h(0 · a + h · b + 2h · c) = =⇒ b + 2c = .
0 2 2 2
Case f (x) = x2 : Here f0 = 0, f1 = h2 , f2 = 4h2 .
Z h
h3 h3 1
x2 dx = =⇒ h(0 + h2 b + 4h2 c) = =⇒ b + 4c = .
0 3 3 3
Solving the system:
a + b + c = 1,
b + 2c = 12 ,
b + 4c = 13 .

1
IIT Indore MA 204N – Numerical Methods

1 1
Subtracting the second from the third: 2c = 3
− 2
= − 61 , so

1
c=− .
12
1 1 1 1
Then b = 2
− 2(− 12 )= 2
+ 6
= 23 , so

2
b= .
3

And a = 1 − b − c = 1 − 23 + 1
12
= 5
12
, so

5
a= .
12

Hence the formula reads


Z x1  
5 2 1
f (x) dx = h f0 + f1 − f2 + R.
x0 12 3 12

Step 2: Degree of Precision and Error Term


Check f (x) = x3 (set x0 = 0):
h
h4
Z
x3 dx = .
0 4
5 4
· 0 + 23 h3 − 12
1
· 8h = h 23 − 23 h3 = 0 ̸= h4 .
3


RHS = h 12
So the formula is not exact for f (x) = x3 ; hence its degree of precision is 2.
To find the error term, expand f in a Taylor series about x0 :

(x − x0 )2 ′′ (x − x0 )3 ′′′
f (x) = f0 + (x − x0 )f0′ + f0 + f0 + · · ·
2! 3!
Integrate term by term over [x0 , x0 + h]:
Z x1
h2 h3 h4
f (x) dx = hf0 + f0′ + f0′′ + f0′′′ + · · ·
x0 2 6 24

Also expand f1 = f (x0 + h) and f2 = f (x0 + 2h):

h2 ′′ h3 ′′′ h4 (4)
f1 = f0 + hf0′ + f + f0 + f0 + · · · ,
2 0 6 24
2 3
4h 8h 16h4 (4)
f2 = f0 + 2hf0′ + f0′′ + f0′′′ + f + ··· .
2 6 24 0
5
Now compute h(af0 + bf1 + cf2 ) with a = 12 , b = 23 , c = − 12
1
:
Coefficient of f0 : h(a + b + c) = h · 1 =h. ✓
Coefficient of f0′ : h · h(b + 2c) = h2 23 − 12 2
= h2 · 12 . ✓
2 3 3 3
Coefficient of f0′′ : h · h2 (b + 4c) = h2 32 − 124
= h2 · 31 = h6 . ✓

3 4  h4
Coefficient of f0′′′ : h · h6 (b + 8c) = h6 23 − 128
= 6 · 0 = 0.

2
IIT Indore MA 204N – Numerical Methods

So the formula is exact through f0′′′ terms as well (degree 3 coefficient vanishes). Check
(4)
f0 :
(4) 4 5  h5 2  5
Coeff of f0 : h · h24 (b + 16c) = h24 23 − 16
12
= 24 − 3 = − h36 .
h5 (4) h5
Exact integral contributes f
120 0
(from 5!
).
Error:
h5 (4)
 5
13h5 (4)
 
h (4) 5 (4) 1 1 (4) 3 + 10
R= f0 − − f0 = h f0 + = h5 f0 · = f (ζ).
120 36 120 36 360 360
Wait — let us redo this carefully. The error is:
Z x1
R= f dx − h(af0 + bf1 + cf2 ).
x0

Leading error term at order h5 :


 5
h 1 h5 2

(4)
R= · − (− 3 ) f0 + O(h6 )
4! 5 24
Z h
(x − x0 )4 (4) h5 (4) h5 (4)
Exact: f0 dx = f0 = f .
0 4! 5 · 4! 120 0
5 (4) 5 (4) 5 (4)
Formula gives h24 (b + 16c)f0 = h24 · (− 23 )f0 = − h36 f0 .
Therefore:
13h5 (4)
 
1 1 3 + 10 5 (4)
R= + h5 f (4) (ζ) = h f (ζ) = f (ζ), x0 < ζ < x1 .
120 36 360 360

13h5
Hence n = 4 and k = .
360

Problem 2. Generalized Trapezoidal Rule


Problem. Obtain a generalized trapezoidal rule
Z x1
h
f (x) dx = (f0 + f1 ) + ph2 (f0′ − f1′ ).
x0 2
Find p, the error term, and deduce the composite rule over [a, b].
Solution.

Step 1: Determine p by Exactness Condition


Require exactness for f (x) = x3 (set x0 = 0, x1 = h).
Z h
h4
LHS: x3 dx = .
0 4
h h4
RHS: (0 + h3 ) + ph2 (0 − 3h2 ) = − 3ph4 .
2 2
h4 h4 1 1 1 1
Setting equal: = − 3ph4 =⇒ 3p = − = =⇒ p = .
4 2 2 4 4 12
Check with f (x) = 1, x, x2 :

3
IIT Indore MA 204N – Numerical Methods

• f = 1: LHS= h, RHS= h2 (2) + 0 = h.✓


h2 h2 h2
• f = x: LHS= 2
, RHS= h2 (0 + h) + 12
(1 − 1) = 2
.✓
h3 h2 h3 h3 h3
• f = x2 : LHS= 3
, RHS= h2 (0 + h2 ) + 12
(0 − 2h) = 2
− 6
= 3
.✓
• f = x3 : Exact by construction.✓
h5 h2 h5 h5 h5 h5
• f = x4 : LHS= 5
, RHS= h2 h4 + 12
(0 − 4h3 ) = 2
− 3
= 6
̸= 5
.
Degree of precision is 3.

Step 2: Error Term


Using Taylor expansions about x0 with t = x − x0 :
t2 ′′ t3 ′′′ t4 (4)
f (x) = f0 + tf0′
+ f0 + f0 + f0 + · · ·
2! 3! 4!
Z h
h2 ′ h3 ′′ h4 ′′′ h5 (4)
f dt = hf0 + f0 + f0 + f0 + f + ···
0 2 6 24 120 0

h2 ′′ h3 ′′′ h4 (4)
 
h h ′
(f0 + f1 ) = 2f0 + hf0 + f0 + f0 + f0 + · · ·
2 2 2 6 24
h2 h3 h4 h5 (4)
= hf0 + f0′ + f0′′ + f0′′′ + f0 + · · ·
2 4 12 48

h2 ′′′ h3 (4)
 
f0′ − f1′ f0′ ′ ′′
= − f0 + hf0 + f0 + f0 + · · ·
2 6
2 3
h h (4)
= −hf0′′ − f0′′′ − f0 − · · ·
2 6
So:
h2 ′ h3 h4 h5 (4)
(f0 − f1′ ) = − f0′′ − f0′′′ − f0 − · · ·
12 12 24 72
Adding:
h2 ′ h2 ′
   
h ′ 1 1 3 ′′ 1 1
(f0 + f1 ) + (f0 − f1 ) = hf0 + f0 + − h f0 + − h4 f0′′′
2 12 2 4 12 12 24
 
1 1 (4)
+ − h5 f0 + · · ·
48 72
h2 h3 h4 h5 (4)
= hf0 + f0′ + f0′′ + f0′′′ + f + ···
2 6 24 144 0
Error:
Z x1
h2 ′
   
h ′ 1 1 (4)
R= f dx − (f0 + f1 ) + (f0 − f1 ) = − h5 f0 + O(h6 ).
x0 2 12 120 144
1 1 144 − 120 24 1
− = = = .
120 144 120 · 144 17280 720

h5 (4)
R= f (ζ), x0 < ζ < x1 .
720
1
This is the Euler–Maclaurin based generalized trapezoidal rule with p = 12
.

4
IIT Indore MA 204N – Numerical Methods

Step 3: Composite Rule


Partition [a, b] with xi = a + ih, h = (b − a)/n. Apply the rule on each [xi−1 , xi ]:
Z xi
h h2 ′ ′ h5 (4)
f dx = (fi−1 + fi ) + (fi−1 − fi ) + f (ζi ).
xi−1 2 12 720

Summing over i = 1, . . . , n:
Z b " n−1
# n−1
h X h2 ′ ′ h2 X ′
f dx = f0 + 2 fi + fn + (f0 − fn ) + (fi−1 − fi′ )|telescoping + O(h4 ).
a 2 i=1
12 12 i=1

The derivative terms telescope:


n
X h2 ′ h2 ′
(fi−1 − fi′ ) = (f − fn′ ).
i=1
12 12 0

" n−1
#
b
h2
Z
h X
f (x) dx ≈ f0 + 2 fi + fn + (f0′ − fn′ ),
a 2 i=1
12

(b − a) 4 (4)
with composite error E = − h f (η), a < η < b.
720

Problem 3. Step Length for Composite Trapezoidal Rule


0.2
x2
Z
Problem. For dx, find the largest step length of the form 10−k , 2 × 10−k , 5 ×
0.1 cos x
10−k , 8 × 10−k such that the composite trapezoidal error < 10−6 .
Solution.

Step 1: Error Formula


For the composite trapezoidal rule:

(b − a)h2
|ET | = max f ′′ (x) , a = 0.1, b = 0.2.
12 x∈[a,b]

We need |ET | < 10−6 .

Step 2: Compute f ′′ (x)


x2
Let f (x) = .
cos x
2x cos x + x2 sin x
f ′ (x) = .
cos2 x
d 2x cos x + x2 sin x
 
′′
f (x) = .
dx cos2 x

5
IIT Indore MA 204N – Numerical Methods

Using the quotient rule (numerator u, denominator v = cos2 x):

u = 2x cos x + x2 sin x,
u′ = 2 cos x − 2x sin x + 2x sin x + x2 cos x = 2 cos x + x2 cos x,
v = cos2 x, v ′ = −2 cos x sin x = − sin 2x.

′′ u′ v − uv ′ (2 + x2 ) cos x · cos2 x + (2x cos x + x2 sin x) · 2 cos x sin x


f (x) = = .
v2 cos4 x
(2 + x2 ) cos x + 2(2x cos x + x2 sin x) sin x
= .
cos3 x

Step 3: Bound |f ′′ (x)| on [0.1, 0.2]


Since x ∈ [0.1, 0.2] is small, cos x ≈ 1 and sin x ≈ x. Evaluate at x = 0.2 (worst case as
x increases):

cos(0.2) ≈ 0.98007, sin(0.2) ≈ 0.19867.


Numerator ≈ (2 + 0.04)(0.98007) + 2(0.4 · 0.98007 + 0.04 · 0.19867)(0.19867)
≈ 2.04 × 0.98007 + 2(0.39203 + 0.00795)(0.19867)
≈ 1.99934 + 2(0.39998)(0.19867)
≈ 1.99934 + 0.15891 ≈ 2.158.
Denominator = (0.98007)3 ≈ 0.94137.

2.158
|f ′′ (0.2)| ≈ ≈ 2.294.
0.941
So we take M2 = max |f ′′ | ≈ 2.3 (conservative).

Step 4: Required Step Size


(b − a)h2 12 × 10−6 12 × 10−6
M2 < 10−6 =⇒ h2 < = ≈ 5.217 × 10−5 .
12 (0.1)(2.3) 0.23

h < 5.217 × 10−5 ≈ 7.22 × 10−3 .

Step 5: Select Largest Valid Step


We test values of the form α × 10−k :

Step h Value ≤ 7.22 × 10−3 ?

8 × 10−3 0.008 No (> 7.22 × 10−3 )


5 × 10−3 0.005 Yes
2 × 10−3 0.002 Yes
−3
10 0.001 Yes

6
IIT Indore MA 204N – Numerical Methods

h = 5 × 10−3
is the largest step length of the given form satisfying the error requirement.
Verification: With h = 5 × 10−3 :

(0.1)(25 × 10−6 ) 5.75 × 10−6


|ET | ≤ (2.3) = ≈ 4.79 × 10−7 < 10−6 .✓
12 12
With h = 8 × 10−3 :
(0.1)(64 × 10−6 )
|ET | ≤ (2.3) ≈ 1.23 × 10−6 > 10−6 .×
12

Problem 4. Gaussian-Type Quadrature with Weight Function


Problem. Find a quadrature formula
Z 1
dx
f (x) p = α1 f (0) + α2 f (1/2) + α3 f (1)
0 x(1 − x)
Z 1
dx
exact for polynomials of highest possible degree. Apply it to √ .
0 x − x3
Solution.

Step 1: Compute Moments


1
The weight function is w(x) = p . Using the substitution x = sin2 θ, dx =
p x(1 − x)
2 sin θ cos θ dθ, x(1 − x) = sin θ cos θ:
1 π/2 π/2
xk sin2k θ
Z Z Z
µk = p dx = · 2 sin θ cos θ dθ = 2 sin2k θ dθ.
0 x(1 − x) 0 sin θ cos θ 0

Using the Wallis formula:


2k
π/2

π (2k − 1)!!
Z
2k π k
sin θ dθ = · = · k .
0 2 (2k)!! 2 4

π
µ0 = 2 · = π,
2
π 1 π
µ1 = 2 · · = ,
2 2 2
π 1·3 3π
µ2 = 2 · · = ,
2 2·4 8
π 1·3·5 5π
µ3 = 2 · · = .
2 2·4·6 16

7
IIT Indore MA 204N – Numerical Methods

Step 2: Exactness Conditions


f (x) = 1: α1 + α2 + α3 = π.
f (x) = x: 0 · α1 + 12 α2 + α3 = π2 .
f (x) = x2 : 0 · α1 + 41 α2 + α3 = 3π
8
.
From the second and third equations:
1 π 1 3π
α2 + α 3 = , α2 + α3 = .
2 2 4 8
Subtracting: 41 α2 = π8 =⇒ α2 = π2 .
Then α3 = π2 − 12 · π2 = π2 − π4 = π4 .
And α1 = π − π2 − π4 = π4 .

π π π
α1 = , α2 = , α3 = .
4 2 4

Step 3: Check Degree of Precision


f (x) = x3 : 0 + 18 · π
2
+ π
4
= π
16
+ π
4
= 5π
16
= µ3 . ✓
1 π 35π 9π 36π
f (x) = x4 : Formula gives 0+ 16 · 2 + π4 = 32
π
+ 8π
32
= 9π
32
. Exact: µ4 = ̸= = .
128 32 128
Not equal. So degree of precision is 3.
The quadrature formula is:
Z 1  
dx π π 1 π
f (x) p = f (0) + f + f (1).
0 x(1 − x) 4 2 2 4

Step 4: Application
1 1 1
Note that √ =p =p . Rewrite:
x − x3 x(1 − x2 ) x(1 − x)(1 + x)
Z 1 Z 1
dx 1 dx
√ = √ ·p .
0 x − x3 0 1+x x(1 − x)
1
So f (x) = √ .
1+x
Apply the formula:
Z 1
dx π π  π π π 1 π 1
√ ≈ f (0) + f 12 + f (1) = · 1 + · p + ·√ .
0 x−x 3 4 2 4 4 2 3/2 4 2
r
π π 2 π π π π
= + · + √ = +√ + √ .
4 2 3 4 2 4 6 4 2
Numerically:
π
≈ 0.7854,
4
π 3.14159
√ ≈ ≈ 1.2825,
6 2.44949
π 3.14159
√ ≈ ≈ 0.5554.
4 2 5.65685

8
IIT Indore MA 204N – Numerical Methods

Approximate value ≈ 0.7854 + 1.2825 + 0.5554 = 2.6233.


Exact value: Using x = sin2 θ:
Z 1 Z π/2
dx dθ
√ =2 √ ,
0 x − x3 0 1 + sin2 θ
which is an elliptic integral 2K(−1) (complete elliptic integral of first kind with parameter
−1) ≈ 2 × 1.3111 = 2.6221.
The approximate value 2.6233 is very close to the exact value 2.6221, confirming
accuracy.

R2
Problem 5. Composite Simpson’s Rule for 1 dx/x
Z 2
dx
Problem. Evaluate using the composite Simpson’s rule accurate up to 10−3 .
1 x
Solution.

Step 1: Error Bound


For composite Simpson’s rule:

(b − a)h4
|ES | = max |f (4) (x)|.
180 x∈[a,b]

For f (x) = 1/x: f (4) (x) = 24/x5 . On [1, 2], max |f (4) | = 24 (at x = 1).

(1)h4 180 × 10−3


(24) < 10−3 =⇒ h4 < = 7.5 × 10−3 =⇒ h < (7.5 × 10−3 )1/4 .
180 24
(7.5 × 10−3 )1/4 = (0.0075)0.25 ≈ 0.2943.
So h ≤ 0.25 (and n must be even). Choose h = 0.25, n = 4 (even). ✓

Step 2: Set Up Nodes


a = 1, b = 2, h = 0.25, n = 4.

x0 = 1, x1 = 1.25, x2 = 1.5, x3 = 1.75, x4 = 2.


2 4
f0 = 1, f1 = 0.8, f2 = 3
≈ 0.666, f3 = 7
≈ 0.57143, f4 = 0.5.

Step 3: Apply Simpson’s Rule


Z 2
dx h
≈ [f0 + 4f1 + 2f2 + 4f3 + f4 ].
1 x 3
0.25
= [1 + 4(0.8) + 2(0.66) + 4(0.57143) + 0.5].
3
0.25
= [1 + 3.2 + 1.3333 + 2.28571 + 0.5].
3
9
IIT Indore MA 204N – Numerical Methods

0.25 0.25 × 8.31905 2.07976


= × 8.31905 = = ≈ 0.69325.
3 3 3
Exact value: ln 2 ≈ 0.69315.
Error: |0.69325 − 0.69315| = 0.00010 < 10−3 . ✓
Z 2
dx
≈ 0.6933 (exact: ln 2 ≈ 0.6931).
1 x

Problem 6. Error Formula for Simpson’s Rule via Taylor Expan-


sion
Problem. Derive the error formula for Simpson’s rule using the Taylor expansion tech-
nique given in the problem.
Solution.
Simpson’s rule (over [x0 , x2 ], two subintervals of width h) states:
Z x2
h
f (x) dx = (f0 + 4f1 + f2 ) + RS ,
x0 3

where x1 = x0 + h, x2 = x0 + 2h.

Step 1: Expand the Exact Integral


Using the Taylor series technique from problem statement (with g ′ = f ):
Z x2
(2h)2 ′ (2h)3 ′′ (2h)4 ′′′ (2h)5 (4)
f dx = 2hf0 + f + f + f + f + ···
x0 2! 0 3! 0 4! 0 5! 0

4h3 ′′ 2h4 ′′′ 4h5 (4)


= 2hf0 + 2h2 f0′ + f + f + f + ···
3 0 3 0 15 0

Step 2: Expand f0 , f1 , f2

f0 = f0 ,
h2 ′′ h3 ′′′ h4 (4)
f1 = f0 + hf0′ + f + f0 + f0 + · · · ,
2 0 6 24
3
4h 2h4 (4)
f2 = f0 + 2hf0′ + 2h2 f0′′ + f0′′′ + f + ···
3 3 0

h4 (4)
f0 + 4f1 + f2 = 6f0 + 6hf0′ + 3h2 f0′′ + h3 f0′′′ + f0 + · · ·
4
h2
(Coefficient details: constant: 1 + 4 + 1 = 6; f0′ : 4h + 2h = 6h; f0′′ : 4 · 2
+ 2h2 =
2h + 2h2 = 4h2 ... let me redo carefully.)
2

10
IIT Indore MA 204N – Numerical Methods

h2
f0 + 4f1 + f2 = (1 + 4 + 1)f0 + (0 + 4h + 2h)f0′ + (0 + 4 · 2
+ 2h2 )f0′′
h3 3 4 2h4 (4)
+ (0 + 4 · 6
+ 4h3 )f0′′′ + (0 + 4 · h24 + 3
)f0 + · · ·
3 3 4 2h4 (4)
= 6f0 + 6hf0′ + (2h2 + 2h2 )f0′′ + ( 2h3 + 4h3 )f0′′′ + ( h6 + 3
)f0 + ···
4 (4)
= 6f0 + 6hf0′ + 4h2 f0′′ + 2h3 f0′′′ + 5h6 f0 + · · ·
Hence:
h 2 ′ 4h3 ′′ 2h4 ′′′ 5h5 (4)
(f0 + 4f1 + f2 ) = 2hf0 + 2h f0 + f + f + f + ···
3 3 0 3 0 18 0

Step 3: Compute the Error


Z x2
h
RS = f dx − (f0 + 4f1 + f2 )
3
x0 5 5

4h 5h (4)
= − f0 + O(h6 )
15 18
 
5 4 5 (4)
=h − f + O(h6 )
15 18 0
 
5 24 − 25 (4)
=h f0 + O(h6 )
90
5
h (4)
= − f0 + O(h6 ).
90
By the mean value theorem for integrals:
h5 (4)
RS = − f (ζ), x0 < ζ < x2 .
90
This confirms that Simpson’s rule has a local error of order h5 and degree of precision
3.

Problem 7. Deducing Trapezoidal and Simpson’s Rules via New-


ton’s Forward Divided Difference Formula
Problem. Using Newton’s forward divided difference formula, deduce the trapezoidal
and Simpson’s rules.
Solution.

Newton’s Forward Difference Interpolation


x − x0
With equally spaced nodes xi = x0 + ih and t = , dx = h dt:
h
t(t − 1) 2 t(t − 1)(t − 2) 3
f (x) ≈ P (t) = f0 + t∆f0 + ∆ f0 + ∆ f0 + · · ·
2! 3!
Integrating from x0 to x0 + nh (i.e., t from 0 to n):
Z x0 +nh Z n
f dx = h P (t) dt.
x0 0

11
IIT Indore MA 204N – Numerical Methods

Trapezoidal Rule (n = 1)
Integrate from t = 0 to t = 1, keeping terms up to ∆f0 :
Z 1    
1 f1 − f 0 h
h (f0 + t∆f0 ) dt = h f0 · 1 + ∆f0 · = h f0 + = (f0 + f1 ).
0 2 2 2
Z x1
h
f dx ≈ (f0 + f1 ).
x0 2

Simpson’s Rule (n = 2)
Integrate from t = 0 to t = 2, keeping terms up to ∆2 f0 :
Z 2 
t(t − 1) 2
h f0 + t∆f0 + ∆ f0 dt.
0 2
Compute each integral:
Z 2
1 dt = 2,
0
Z 2
t dt = 2,
0
Z 2
1 2 2
 
t(t − 1)
Z
1 8 1 2 1
dt = (t − t) dt = −2 = · = .
0 2 2 0 2 3 2 3 3
So: Z x2  
1 2
f dx ≈ h 2f0 + 2∆f0 + ∆ f0 .
x0 3
Now substitute ∆f0 = f1 − f0 , ∆2 f0 = f2 − 2f1 + f0 :
 
1
= h 2f0 + 2(f1 − f0 ) + (f2 − 2f1 + f0 )
3
 
f2 2f1 f0
= h 2f0 + 2f1 − 2f0 + − +
3 3 3
 
f0 4f1 f2
=h + +
3 3 3
h
= (f0 + 4f1 + f2 ).
3
Z x2
h
f dx ≈ (f0 + 4f1 + f2 ).
x0 3

Problem 8. Volume of a Solid of Revolution


Problem. A solid of revolution is formed by rotating the curve through the given points
about the x-axis. Estimate the volume using composite Simpson’s rule.
Solution.

12
IIT Indore MA 204N – Numerical Methods

Step 1: Setup
Volume of solid of revolution about the x-axis:
Z 1
V =π [y(x)]2 dx.
0

The data:
x 0.00 0.25 0.50 0.75 1.00
y 1.0000 0.9896 0.9589 0.9089 0.8415
Compute y 2 :
x 0.00 0.25 0.50 0.75 1.00
y 2 1.00000 0.97929 0.91950 0.82608 0.70812
Let us verify:
y02 = (1.0000)2 = 1.00000,
y12 = (0.9896)2 = 0.97929,
y22 = (0.9589)2 = 0.91950,
y32 = (0.9089)2 = 0.82608,
y42 = (0.8415)2 = 0.70812.

Step 2: Apply Composite Simpson’s Rule


h = 0.25, n = 4 (even):
Z 1
h 2
y 2 dx ≈ [y0 + 4y12 + 2y22 + 4y32 + y42 ].
0 3

0.25
= [1.00000 + 4(0.97929) + 2(0.91950) + 4(0.82608) + 0.70812]
3
0.25
= [1.00000 + 3.91716 + 1.83900 + 3.30432 + 0.70812]
3
0.25
= × 10.76860
3
0.25 × 10.76860
=
3
2.69215
=
3
= 0.89738.

Step 3: Compute Volume


Z 1
V =π y 2 dx ≈ π × 0.89738 ≈ 3.14159 × 0.89738 ≈ 2.820.
0

V ≈ 2.820 cubic units (to three decimal places).


Note: The function y = sin x/x satisfies
R 1 the given data (since sin(0)/0 is taken as 1
2
by L’Hôpital), and the exact volume π 0 (sin x/x) dx ≈ 2.819 confirms our answer.

13

You might also like