Calculus

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

1.

The trapezoidal rule is a method of numerical integration used for approximating a


definite integral by evaluating the integrant at two points. That is,

∫ f ( x ) dx ≈ h2 [ f ( a ) +f ( b ) ]
a

Where h=b-a

The trapezoidal rule approximates the values of definite integralsby use of trapezoids. This can
be illustrated as shown below;

∆ x isthe width of each−interval∧can be given as ;


b−a
∆ x=
n

The area of the shaded region is approximately equal to the area bounded by the curve y=f(x)
2. The Simpson’s rule is a method of numerical integration that provides an approximation
of a definite integral over the interval (a,b) using parabolas. That is,

∫ f ( x ) dx ≈ 3h [ f ( a ) +4 f ( a+ b ) +2 f ( b )]
a

The integral values are approximated by the use of parabolas on a curve. The integral is then
estimated by summing the areas of the regions below these parabolic segments

3. The error of approximation is the difference between the exact value of the equation and
the approximation
5

4. Definite integral ∫ x ln x dx where n=6


2

a) Trapezoidal rule

Solution

∫ f ( x ) dx= h2 [ ( y 0+ yn ) +2 ( y 1+ y 2+ y 3+… ) ]
a

b−a 5−2 1
h= , h= =
n 6 2

x 2 2.5 3 3.5 4 4.5 5

Y=F(x)=x 1.3863 2.2907 3.2958 4.3847 5.5452 6.7683 8.0472


ln x

5
1
∫ x ln x dx= 4 [ ( 1.3863+8.0472 )+2 ( 2.2907+3.2958+ 4.3847+5.5452+ 6.7683 ) ]
2

1
= ¿
4

1
= [ 54.0029 ]
4
=13.500725

b) Simpson’s rule

Solution

∫ f ( x ) dx= h3 ¿
a

b−a 5−2 1
h= , h= =
n 6 2

x 2 2.5 3 3.5 4 4.5 5

Y=F(x)=x 1.3863 2.2907 3.2958 4.3847 5.5452 6.7683 8.0472


ln x

5
1
∫ x ln x dx= 6 [ (1.3863+ 8.0472 ) +4 (2.2907 +4.3847+ 6.7683 ) +2 ( 3.2958+5.5452 ) ]
2

1
= [ ( 9.4335+53.7748+17.6820 ) ]
6

1
= [80.8903]
6

=13.4817167
5
c) Integration by hand.∫ x ln x dx
2
Solution

∫ udv =uv−∫ vdu


Let u=ln x

Let dv=xdx, hence;

x2
v=∫ 1 dv =
2

1
du=
x

x2 x2 1
therefore; ln x × -∫ × dx
2 2 x

x2 1
=ln x × − ∫ xdx
2 2

=ln x × − ( )
x2 1 x 2
2 2 2

x2 x2
=ln x × −
2 4

5 5
x2 x2
∫ x ln x dx=[lnx× 2
− ]
4 2
2
25 25 4 4
= [ln 5 × − ¿−[ln 2 × − ]
2 4 2 4

= [20.11797−¿6.25]-[1.38629−¿ 1]

=13.48168

Error in trapezoidal rule = 13.500725-13.48168

=0.019045

Error in Simpson’s rule= 13.4817167-13.48168

=0.0000367

Simpson’s rule gives an accurate result as it has smaller error of 0.0000367 compared to the exact
solution.

2
5. Definite integral ∫ e dx
x2

0
Where n=8

a) Trapezoidal rule

Solution
b

∫ f ( x ) dx= h2 [ ( y 0+ yn ) +2 ( y 1+ y 2+ y 3+… ) ]
a

b−a 2−0 1
h= , h= = =0.25
n 8 4

x 0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0


Y=f(x)=e x 2 1 1.06449 1.28403 1.75505 2.71828 4.77073 9.48774 21.3809 54.59815
4
2

∫ e x2 dx= 18 [ ( 1+ 54.59815 ) +2 (1.06449+ 1.28403+1.75505+2.71828+ 4.77073+9.48774+ 21.38094 ) ]


0

1
= [ 55.59815+84.92252 ]
8

1
= [140.52067 ]
8

=17.5650838

b) Simpson’s rule

Solution
b

∫ f ( x ) dx= h3 ¿
a

b−a 2−0 1
h= , h= = =0.25
n 8 4

x 0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0


Y=f(x)=e x 2 1 1.06449 1.28403 1.75505 2.71828 4.77073 9.48774 21.3809 54.59815
4

2
1
=∫ e dx=
x2
¿¿
0 12

1
= [198.46309]
12

=16.5385908

2
c) ∫ e x2 dx
0
=16.45262776

d) Error using trapezoidal rule=17.5650838-16.45262776

=1.11245604

Error using Simpson’s rule=16.5385908-16.45262776

=0.08596304

The Simpson’s rule gives the more accurate answer because it a smaller error compared to
that of the trapezoidal rule.

e) One can increase the accuracy by using larger values of n.

f) One can use numerical quadrature if you have two functions, that is, F(x) and f(x)

Where; F’(x)=f(x)
b
Hence; ∫ f ( x ) dx=F ( b ) −F (a)
a

6. The temperatures are;

20.6, 20.8, 20.9, 21, 21.1, 21.2, 21.2, 21.2, 21.3, 21.3, 21.5, 21.6, 21.8

Solution

Time=t

Temperature=T (t)

Average temp.= t=3 and t=0

3
T ave =∫ T ( t ) dt
0
Using Simpson’s rule;

15 1
h= minutes=
180 12

1
T ave = ¿( y 0 + y 12) +4( y 1 + y 3 + y 5 + y 7 + y 9 + y 11 ¿+2( y2 + y 4 + y 6 + y 8 + y 10)¿
36

1
= [42.4+4(127.1) + 2(106)]
36

1
= [42.4 + 508.4 + 212]
36

=21.190 c

The average temperature=


20.6+20.8+20.9+ 21+ 21.1+ 3 ( 21.2 )+2 ( 21.3 ) +21.5+ 21.6+21.8
13

=21.190 c

The Simpson’s rule provides a more accurate answer because it has the smallest
error.

7. n =8

Region=(0≤x≤8)

a) About the x-axis


Solution
8 8

∫πr 2
dx=π ∫ f (x ) dx
2

0 0
8−0
h= =1
8

x 0 1 2 3 4 5 6 7 8
y0 y1 y2 y3 y4 y5 y6 y7 y8
2
y=f(x ) 0 1 4 9 16 25 36 49 64

π
= ¿( y 0 + y 8 ) +4( y 1 + y 3 + y 5 + y 7 ¿+2( y 2 + y 4 + y6 )¿
3

π
= [ ( 0+64 ) +4 ( 1+ 9+25+ 49 ) +2 ( 4+ 16+36 ) ]
3

π
= [ 512.0000001 ]
3

=170.67π

b) About y-axis

Solution

4 4

Volume=∫ π r dy=π ∫ f (x ) dy
2 2

0 0

y 0 1 2 3 4
x0 x1 x2 x3 x4
x= 0 1 4 9 16

π
= ¿( x 0 + x 4) +4( x 1+ x3 +¿+ 2(x 2)¿
3

π
= [ ( 0+16 )+ 4 ( 1+9 )+ 2 ( 4 ) ]
3
=21.33 π

You might also like