0% found this document useful (0 votes)
3 views9 pages

Numerical Integrations

Uploaded by

mastermash3543
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)
3 views9 pages

Numerical Integrations

Uploaded by

mastermash3543
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

1 Area, Volume and Numerical Integration

Definition. The area enclosed by the region between two curves y = f (x) and y = g(x)
over an interval [a, b], where f (x) ≥ g(x) for all x ∈ [a, b], is
Z b 
Area = f (x) − g(x) dx.
a

Example 1. Find the area of the region bounded by

y1 = 12 − 2x, y2 = 8 − 2x2 , x = −2, x = 3.

Solution.
Compute the difference of the curves:

y1 − y2 = (12 − 2x) − (8 − 2x2 ) = 2x2 − 2x + 4.

Since the discriminant (−2)2 − 4(2)(4) = −28 < 0 and the leading coefficient 2 > 0, y1 is
above y2 for all x.
Set up the integral: Z 3
Area = (2x2 − 2x + 4) dx.
−2

Antiderivative:
2 3
x − x2 + 4x.
3
Evaluate:  3
2 115
Area = x3 − x2 + 4x = .
3 −2 3
115
Area = ≈ 38.333 square units Example 2. Find the area of the region bounded by
3

y1 = x2 + 2x + 2, y2 = x + 3, x = 0, x = 2.

Solution.
Determine which curve is on top:

y2 − y1 = (x + 3) − (x2 + 2x + 2) = −x2 − x + 1.

Check the sign in [0, 2]:

−x2 − x + 1 is positive at x = 0 : 1 > 0, and at x = 2 : −4 − 2 + 1 = −5 < 0.


√ √
So

the curves intersect. Solve x2 + x − 1 = 0 ⇒ x = −1±2 5 . On [0, 5−1 2
], y2 > y1 ; on
[ 5−1
2
, 2], y√1 > y2 .
R ( 5−1)/2 R2
Area = 0 (y2 − y1 )dx + (√5−1)/2 (y1 − y2 )dx.
Evaluate the integrals (you can leave exact form or compute numerically).

1
Example 3. Find the area of the region bounded by
π
y1 = sin x, y2 = cos x, x = 0, x= .
4
Solution.
On [0, π/4], cos x > sin x, so
Z π/4
Area = (cos x − sin x) dx.
0

Antiderivative: Z
(cos x − sin x) dx = sin x + cos x.

Evaluate: √
π/4 π π
Area = [sin x + cos x]0 = (sin + cos ) − (0 + 1) = 2 − 1.
4 4

Area = 2 − 1
Example 4. Find the area of the region bounded by

y 1 = x3 , y2 = x, x = −1, x = 1.

Solution.
Determine which is on top. On [−1, 0], x3 < x, on [0, 1], x3 < x. So y2 is above y1 throughout
[−1, 1].
Set up the integral: Z 1
Area = (x − x3 ) dx.
−1

Antiderivative:
x2 x 4
Z
(x − x3 ) dx = − .
2 4
Evaluate: 1
x2 x4
    
1 1 1 1 1 1
Area = − = − − − = − = 0.
2 4 −1 2 4 2 4 4 4
Since area is positive, we take absolute values:
Z 0 Z 1
3 1
Area = (x − x ) dx + (x − x3 ) dx = .
−1 0 2

1
Area =
2
Definition.
The volume of a solid is the measure of the space occupied by it in three dimensions.
The volume generated by rotating a plane region around a line (axis) is the volume of the
resulting solid of revolution.

2
If a curve y = f (x) is revolved about the x-axis from x = a to x = b, the volume is given by
Z b
2
V =π f (x) dx.
a

If a curve x = g(y) is revolved about the y-axis from y = c to y = d, the volume is


Z d
2
V =π g(y) dy.
c

Example 1. Find the volume generated when the area enclosed by the y-axis and the curve

y = 2x2 + 2

is revolved about the y-axis from y = 1 to y = 3.


Solution.
Solve for x in terms of y: r
2 y−2
y = 2x + 2 =⇒ x = .
2
The formula for rotation about the y-axis is
Z y2
2
V =π x(y) dy.
y1

y−2
Substitute x(y)2 = 2
and y1 = 1, y2 = 3:
3 3
y−2
Z Z
π
V =π dy = (y − 2) dy.
1 2 2 1

Evaluate the integral:


Z 3  2 3        
y 9 1 3 3
(y − 2) dy = − 2y = −6 − −2 = − − − = 0.
1 2 1 2 2 2 2

Since the region between y = 1 and the curve is below y = 2, take absolute value of x2 .
3
π 3 π (y − 2)2 π 12
Z 
π
V = (y − 2) dy = = · = .
2 2 2 2 2 2 2 4

π
V =
4 √
Example 2. Find the volume generated when the area under y = x from x = 0 to x = 4
is revolved about the x-axis.
Solution.
Formula for rotation about the x-axis:
Z 4 Z 4
√ 2
V =π ( x) dx = π x dx.
0 0

3
Evaluate: 4
4
x2
Z 
16
π x dx = π =π· = 8π.
0 2 0 2
V = 8π
Example 3. Find the volume generated when the area under y = x2 from x = 0 to x = 1
is revolved about the y-axis.
Solution.

Solve x = y. Limits: y = 0 to y = 1.
Formula: Z 1 Z 1  2 1
√ 2 y π
V =π ( y) dy = π y dy = π = .
0 0 2 0 2
π
V =
2
Example 4. Find the volume generated when the region between y = 4 − x2 and the x-axis
from x = −2 to x = 2 is revolved about the x-axis.
Solution.
Formula: Z 2
V =π (4 − x2 )2 dx.
−2

Expand:
(4 − x2 )2 = 16 − 8x2 + x4 .
Integrate:
2 2
8x3 x5
Z     
2 4 64 32 64 32
(16 − 8x + x ) dx = 16x − + = 32 − + − −32 + − .
−2 3 5 −2 3 5 3 5

Simplify:
128 64 640 − 256 + 64 448
V = 64 − + = = π.
3 5 15 15
448π
V =
15
Example 5. Find the volume generated when the region under y = ex from x = 0 to x = 1
is revolved about the x-axis.
Solution.
Formula: Z 1 Z 1
x 2
V =π (e ) dx = π e2x dx.
0 0
Integrate:
1
e2x e2x
Z 
2x π 2
e dx = , V =π = (e − 1).
2 2 0 2
π 2
V = (e − 1)
2

4
Introduction
The Trapezoidal Rule is a numerical method for approximating the value of a definite
integral when the antiderivative is difficult or impossible to obtain. Instead of calculating
the exact area under the curve, we approximate it using trapezoids.

Formula
To approximate the definite integral
Z b
f (x) dx
a

using n trapezoidal strips, the Trapezoidal Rule is given by:


Z b
h
f (x) dx ≈ [y0 + 2y1 + 2y2 + · · · + 2yn−1 + yn ]
a 2
where:

ˆ h= b−a
n

ˆ xi = a + ih, for i = 0, 1, 2, . . . , n

ˆ yi = f (xi )

Example 1
Approximate the integral Z 1
x3 dx
0
using the Trapezoidal Rule with n = 2 subintervals.

Solution
1−0
h= = 0.5
2
x0 = 0, y0 = 03 = 0
x1 = 0.5, y1 = (0.5)3 = 0.125
x2 = 1.0, y2 = 13 = 1
Z 1
0.5
x3 dx ≈ [0 + 2(0.125) + 1] = 0.25 · 1.25 = 0.3125
0 2
Answer: 0.3125

5
Example 2
1
Approximate the area under the curve y = x
from x = 1 to x = 5 using n = 4 subintervals.

Solution
5−1
h= =1
4
x0 = 1, y0 = 1.0000
x1 = 2, y1 = 0.5000
x2 = 3, y2 = 0.3333
x3 = 4, y3 = 0.2500
x4 = 5, y4 = 0.2000
Z 5
1 1
dx ≈ [1 + 2(0.5 + 0.3333 + 0.25) + 0.2] = 0.5 · 3.8666 = 1.9333
1 x 2
Answer: 1.933 (approx)

Example 3
Evaluate the integral Z 1
1
2
dx
0 1+x
using the Trapezoidal Rule with n = 10 subintervals.

Solution
1−0
h= = 0.1
10
1
We compute yi = 1+x2i
for xi = 0, 0.1, . . . , 1.0. Using precomputed values:
X
= 1+2(0.9901+0.9615+0.9174+0.8621+0.8+0.7353+0.6711+0.6098+0.5556)+0.5 = 14.5418
Z 1
1 0.1
2
dx ≈ · 14.5418 = 0.7271
0 1+x 2
Answer: 0.727 (approx)

Example 4
Evaluate the integral Z π
sin2 x dx
0
using the Trapezoidal Rule with n = 6 subintervals.

6
Solution
π
h=
6
Using values yi = sin2 (xi ) at xi = 0, π6 , . . . , π:
X
= 0 + 2(0.25 + 0.75 + 1 + 0.75 + 0.25) + 0 = 4
Z π
π π
sin2 x dx ≈ · 4 = ≈ 1.0472
0 12 3
Answer: 1.047

Example 5
A function f (x) is given by the table below. Approximate the area under the curve y = f (x)
from x = 0 to x = 8 using the Trapezoidal Rule with n = 4 subintervals.

x f (x)
0 3
2 7
4 11
6 9
8 3

Solution
8−0
h= =2
4
Z 8
2
f (x) dx ≈ [3 + 2(7 + 11 + 9) + 3] = 1 · [3 + 54 + 3] = 60
0 2
Answer: 60

Example 1
Approximate the integral Z 6
xe−0.5x dx
0
using the Trapezoidal Rule with n = 3 strips.

7
Solution
We are given: a = 0, b = 6, n = 3
6−0
h= =2
3
x0 = 0, y0 = 0 · e0 = 0
x1 = 2, y1 = 2e−1 ≈ 0.73576
x2 = 4, y2 = 4e−2 ≈ 0.54134
x3 = 6, y3 = 6e−3 ≈ 0.29872
Z 6
2
xe−0.5x dx ≈ [y0 + 2y1 + 2y2 + y3 ] = 2.85292
0 2
Answer: 2.853 (correct to 3 decimal places)

Example 6
Approximate the integral Z 1 √
1 + x3 dx
0
using the Trapezoidal Rule with n = 5 strips.

Solution
We are given: a = 0, b = 1, n = 5
1−0
h= = 0.2
5

x0 = 0, y0 = 1.00000

x1 = 0.2, y1 = 1.008 ≈ 1.00399

x2 = 0.4, y2 = 1.064 ≈ 1.03150

x3 = 0.6, y3 = 1.216 ≈ 1.10272

x4 = 0.8, y4 = 1.512 ≈ 1.22963

x5 = 1.0, y5 = 2 ≈ 1.41421

Z 1 √ 0.2
1 + x3 dx ≈ [1+2(1.00399)+2(1.03150)+2(1.10272)+2(1.22963)+1.41421] = 1.11499
0 2

Answer: 1.115 (correct to 3 decimal places)

8
Example 7
Approximate the integral Z 3
(3x2 + 4x) dx
1
using the Trapezoidal Rule with n = 3 strips.

Solution
3−1 2
h= = ≈ 0.6667
3 3
x0 = 1.000, y0 =7
x1 = 1.667, y1 = 3(1.667)2 + 4(1.667) ≈ 15.004
x2 = 2.333, y2 = 3(2.333)2 + 4(2.333) ≈ 25.665
x3 = 3.000, y3 = 39
Z 3
0.6667
(3x2 + 4x) dx ≈ [7 + 2(15.004) + 2(25.665) + 39] ≈ 42.44
1 2
Answer: 42.44 (correct to 2 decimal places)

Example 8
Approximate the integral Z 1
3ex sin(x) dx
0
using the Trapezoidal Rule with n = 2 strips.

Solution
1−0
h= = 0.5
2
x0 = 0.0, y0 = 0
x1 = 0.5, y1 = 3e0.5 sin(0.5) ≈ 2.37
x2 = 1.0, y2 = 3e1 sin(1) ≈ 6.85
Z 1
0.5
3ex sin(x) dx ≈ [0 + 2(2.37) + 6.85] = 2.90
0 2
Answer: 2.90 (correct to 2 decimal places)

You might also like