Integral Calculus: 12. Problem: Area Under A Curve
Integral Calculus: 12. Problem: Area Under A Curve
Chapter 12
Ch
Integral Calculus
1
Newton Leibniz
g
• Idea: Introduce rectangles
under the curve, defined by
f(x), find the area of all of
those rectangles and add
them all up.
2
1
Ch 12 - Integral Calculus 5/29/2013
2
Ch 12 - Integral Calculus 5/29/2013
3
Ch 12 - Integral Calculus 5/29/2013
12.1 Notation
• f(x): function (it must be continuous in [a,b]).
• x: variable of integration
• f( ) dx:
f(x) d integrand
i t d
• a, b: boundaries
b
∫ a
f ( x ) dx
4
Ch 12 - Integral Calculus 5/29/2013
10
5
Ch 12 - Integral Calculus 5/29/2013
11
12
6
Ch 12 - Integral Calculus 5/29/2013
13
n ≠ −1 κ
∫ κx dx = n + 1 x
For n +1
n
+C
κ
∫ x dx = κ ln( x ) + C
1
Integration of
x
e λx
∫e
λx
The Integral of ex dx = +C
λ
The Constant Multiple Rule ∫ cf ( x)dx = c ∫ f ( x)dx
The Sum Rule for Integrals ∫[ f (x) + g(x)]dx = ∫ f (x)dx+ ∫ g(x)dx14
7
Ch 12 - Integral Calculus 5/29/2013
15
sin α x
Integration of cosine function: ∫ cos αxdx = α + C
dx
∫ 1+ x
1
Integration of = arctan x + C
1+ x2 2
16
8
Ch 12 - Integral Calculus 5/29/2013
• Graph
p
2 2 2
• Sum of 3 integrals ∫0
x 3 dx + 2 ∫
0 ∫
e 3 x dx + dx
0
2
⎡1 4 ⎤
2
⎡ e3x ⎤
⎥ + [x ]0
• Apply integration rules and + 2
FTC Part 1.
x
⎢4 ⎥ 2 ⎢
⎣ ⎦0 ⎣⎢ 3 ⎦⎥ 0
• Consider
∫x cos( x 3 − 2 ) dx
2
• Graph:
• W
We can use a chain
h i rule
l lik
like argumentt tto simplify
i plif th
the iintegration.
t ti
For example, let u=x3-2, then du=3x2 dx => x2 dx = 1/3 du
9
Ch 12 - Integral Calculus 5/29/2013
Th
Then,
2.5
2 .5 ⎡ 1 ⎤
∫ x cos( x − 2)dx = ⎢= sin( x 3 − 2) + C ⎥
2 3
−1 ⎣ 3 ⎦ -1
1
= [sin(2.5 3 - 2) - sin(-13 - 2)] = 0.3376015
3
• Graph:
19
• Another example:
∫ (4 x + 3 )
4
dx
u = 4x + 3
du
du = 4 dx ⇒ = dx
4
u4 1 u5
∫ 4
du =
4 5
+C
20
10
Ch 12 - Integral Calculus 5/29/2013
∫ xe
x
• Example: dx
11
Ch 12 - Integral Calculus 5/29/2013
23
• Example:
∫ e 2 x cos( x ) dx
• Select appropriate u & v functions.
• Exponential functions come before trigonometric functions.
Then, u = e2x .
• From u, get du. =>u= e2x =>then du = 2 e2x dx
• From dv, get v. => dv=cos(x) dx => v = sin(x).
• Then, simply plug this into the integration by parts formula.
Κ = ∫ udv = uv − ∫ vdu
∫e cos( x ) dx = Κ
2x
Κ = e 2 x sin( x ) − 2 ∫ e 2 x sin( x ) dx 24
12
Ch 12 - Integral Calculus 5/29/2013
26
13
Ch 12 - Integral Calculus 5/29/2013
5 1
∫ 0 x−4
dx Discontinuity at x=4.
28
14
Ch 12 - Integral Calculus 5/29/2013
15
Ch 12 - Integral Calculus 5/29/2013
15 15 15
1 1 1 1 1
P(10 ≤ X ≤ 15) = ∫ f ( x)dx = ∫ dx = ∫ dx = ( x) |15
10 = (15 −10) = .
10 10
20 20 10 20 20 4
31
32
16
Ch 12 - Integral Calculus 5/29/2013
34
17
Ch 12 - Integral Calculus 5/29/2013
35
Area of Rij is Δ A = Δ x Δ y
Volume of ij’s column: f ( xij* , yij* )ΔA
m n
Total volume of all columns: ∑∑ f ( x , y
i =1 j =1
*
ij
*
ij ) ΔA
36
18
Ch 12 - Integral Calculus 5/29/2013
m n
V ≈ ∑∑ f ( xij* , yij* )Δ A
i =1 j =1
37
m n
∫∫ f ( x , y ) dA = li ∑ ∑
lim
m, n → ∞ i = 1 j =1
f ( x ij* , y ij* ) Δ A , if the
h lilimit
i exists.
i
R
m n
19
Ch 12 - Integral Calculus 5/29/2013
39
m=n=4;V≈41.5 m=n=8;V≈44.875 m=n=16;V≈ 46.46875
∫∫ cf ( x, y)dA = c ∫∫ f ( x, y)dA
A A
∫∫ f ( x, y ) dA ≥ ∫∫ g ( x, y ) dA
A A
∫∫ f ( x , y ) dA =
A1 ∪ A 2
∫∫ A1
f ( x , y ) dA + ∫∫
A2
f ( x , y ) dA 40
20
Ch 12 - Integral Calculus 5/29/2013
d b b d
c
x
a x b 41
11
⎛1
1
⎞
∫∫R f ( x, y)dA =∫∫
00
( x + y)dxdy=∫ ⎜∫
⎜
0⎝0
( x + y)dx⎟
⎟dy =
⎠
1
1
⎛ (x + y)2 ⎞ 1
⎛ (1+ y)2 − y2 ⎞ 1
(1+ y)2 − y2
= ∫ ⎜⎜ ⎟⎟ dy =∫ ⎜⎜ ⎟⎟dy =∫ dy
0⎝ ⎠0 0⎝ ⎠
2 2 0
2
1 1
(1+ y)2
1 1 2
y ⎛ (1+ y)3 ⎞ ⎛ y3 ⎞ 23 −1 1
=∫ dy − ∫ dy = ⎜⎜ ⎟⎟ − ⎜⎜ ⎟⎟ = − =1
0
2 0
2 ⎝ 6 ⎠0 ⎝ ⎠0
6 6 6
42
21
Ch 12 - Integral Calculus 5/29/2013
b g ( x)
y
g(x) ∫∫ f ( x, y)dA =∫ ∫ f ( x, y)dydx
A a h( x)
A
h(x)
x
a x b 43
d g ( y)
d
y ∫∫ f ( x, y)dA = ∫ ∫ f ( x, y)dxdy
R c h( y )
A
y
h(y) g(y)
c x
44
22
Ch 12 - Integral Calculus 5/29/2013
d b
⎡b ⎤ ⎡d ⎤
∫∫R f ( x , y ) dA = ∫c ∫a ϕ ( x )ψ ( y ) dxdy = ⎢∫
⎣a
ϕ ( x ) dx ⎥ ⎢∫
⋅
⎦ ⎣c
ψ ( y ) dy ⎥
⎦
• Examples:
∫∫ y sin((x)dA,
R
A = [1 / 2,1] × [π / 2, π ]
( x−μ x )2 ( y −μ y )2
1 − −
∫∫R 2π e 2
e 2
dxdy, R = [−∞, ∞] × [−∞, ∞]
45
-t3
∫(-t2 + 10t + 24) dt = + 5 t2 + 24t + C
3
• Computational science provides methods for estimating
integrals and derivatives from actual data.
46
23
Ch 12 - Integral Calculus 5/29/2013
Extra
Introduction to Numerical
Integration
47
Numerical Integration
Idea is to do integral in small parts, like the way we presented
integration: a summation.
N
Numerical
i l methods
h d jjust try to make
k it
i faster
f andd more accurate.
12
10
0 48
3 5 7 9 11 13 15
24
Ch 12 - Integral Calculus 5/29/2013
f(x) = c 0 f ( x 0 ) + c 1 f ( x 1 ) + LL + c n f ( x n )
x0 x1 xn-1 xn 49 x
∫ f(x)dx ≈ ∑ ci f ( xi )
a i =1
25
Ch 12 - Integral Calculus 5/29/2013
Numerical Integration
• The weights are derived from the Lagrange basis polynomials
L(x). They depend only on the xi's; not on the function ƒ.
Diff
Different
t methods
th d use different
diff t polynomials
l i l to
t gett the
th ci's.
'
• Newton-Cotes Closed Formulae -- Use both end points
– Trapezoidal Rule : Linear
– Simpson’s 1/3-Rule : Quadratic
– Simpson’s 3/8-Rule : Cubic
– Boole
Boole’ss Rule : Fourth
Fourth-order
order
Numerical Integration
• Error analysis
The error of the approximation is the difference between the
value of the integral and the numerical result:
error = ε = ∫ f(x) dx - Σi ci f(xi)
52
26
Ch 12 - Integral Calculus 5/29/2013
Trapezoid Rule
• Straight-line approximation
The trapezoid rule approximates the region under the graph of
the function f(x) as a trapezoid and calculating its area.
b 1
∫
a
f ( x ) dx ≈ ∑ i=0
ci f ( xi ) = c0 f ( x0 ) + c1 f ( x1 )
h
= [ f ( x 0 ) + f ( x 1 )]
2
f(x)
L(x)
x0 x1 53 x
Trapezoid Rule
• Lagrange interpolation
x − x1 x − x0
L( x) = f ( x0 ) + f ( x1 )
x 0 − x1 x1 − x 0
x−a d
dx
let a = x 0 , b = x1, ξ = , dξ = ; h=b−a
b−a h
⎧x = a ⇒ ξ = 0⎫
⎨ ⎬ ⇒ L (ξ ) = (1 − ξ ) f ( a ) + (ξ ) f ( b )
⎩x = b ⇒ ξ =1⎭
27
Ch 12 - Integral Calculus 5/29/2013
Trapezoid Rule
55
• Graph
56
28
Ch 12 - Integral Calculus 5/29/2013
• Trapezoidal Rule
4−0
[ f ( 0 ) + f ( 4 )] = 2( 0 + 4 e 8 ) = 23847 .66
4
I= ∫
0
xe 2 x dx ≈
2
5216 .926 − 23847 .66
ε = = − 357 .12 %
5216 .926
57
∑c
b
∫a
f ( x )dx ≈
i =0
i f ( x i ) = c0 f ( x0 ) + c1 f ( x1 ) + c 2 f ( x 2 )
h
= [ f ( x 0 ) + 4 f ( x 1 ) + f ( x 2 )]
3
L(x)
f(x)
x0 h x1 h x2 58 x
29
Ch 12 - Integral Calculus 5/29/2013
Simpson’s 1/3-Rule
• Lagrange interpolation
( x − x 1 )( x − x 2 ) ( x − x 0 )( x − x 2 )
L( x ) = f ( x0 ) + f ( x1 )
( x 0 − x 1 )( x 0 − x 2 ) ( x 1 − x 0 )( x 1 − x 2 )
( x − x 0 )( x − x 1 )
+ f ( x2 )
( x 2 − x 0 )( x 2 − x 1 )
a+b
let x0 = a , x2 = b, x1 =
2
b−a x − x1 dx
h= ,ξ = , dξ =
2 h h
⎧ x = x 0 ⇒ ξ = −1
⎪
⎨ x = x1 ⇒ ξ = 0
⎪x = x ⇒ ξ = 1
⎩ 2
ξ (ξ − 1 ) ξ (ξ + 1 )
L( ξ ) = f ( x0 ) + ( 1 − ξ 2 ) f ( x1 ) + f ( x2 )
2 2 59
Simpson’s 1/3-Rule
• Integrate the Lagrange interpolation
b 1 h 1
∫
a
f(x)dx ≈ h∫ L( ξ )dξ = f(x 0 )
−1 2 ∫− 1
ξ(ξ − 1 )dξ
1 h 1
+ f(x 1 )h∫ ( 1 − ξ 2 )dξ + f(x 2 ) ∫ ξ(ξ + 1 )dξ
0 2 −1
1 1
h ξ3 ξ2 ξ3
= f(x 0 ) ( − ) + f(x 1 )h(ξ − )
2 3 2 −1 3 −1
1
h ξ3 ξ2
+ f(x
f( 2 ) ( + )
2 3 2 −1
h
[ f(x0 ) + 4f(x 1 ) + f(x 2 )]
b
∫
a
f(x)dx =
3 60
30
Ch 12 - Integral Calculus 5/29/2013
Simpson’s 3/8-Rule
• Approximate by a cubic polynomial
b 3
L(x) f(x)
x0 h x1 h x2 h x3 61 x
Simpson’s 3/8-Rule
• Lagrange interpolation
( x − x 1 )( x − x 2 )( x − x 3 )
L( x ) = f ( x0 )
( x 0 − x 1 )( x 0 − x 2 )( x 0 − x 3 )
( x − x 0 )( x − x 2 )( x − x 3 )
+ f ( x1 )
( x 1 − x 0 )( x 1 − x 2 )( x 1 − x 3 )
( x − x 0 )( x − x 1 )( x − x 3 )
+ f ( x2 )
( x 2 − x 0 )( x 2 − x 1 )( x 2 − x 3 )
( x − x 0 )( x − x 1 )( x − x 2 )
+ f ( x3 )
( x 3 − x 0 )( x 3 − x 1 )( x 3 − x 2 )
• Integrate to obtain the rule
b b b-a
∫ a
f(x)dx ≈ ∫a
L(x)dx ; h=
3
3h
= [ f ( x 0 ) + 3 f ( x 1 ) + 3 f ( x 2 ) + f ( x 3 )] 62
8
31
Ch 12 - Integral Calculus 5/29/2013
• Simpson’s 1/3-Rule
h
[ f (0 ) + 4 f (2) + f (4)]
4
I = ∫ 0
xe 2 xdx ≈
3
2
⎡ 0 + 4 ( 2 e 4 ) + 4 e 8 ⎤⎦ = 8 2 4 0 .4 1 1
=
3 ⎣
5 2 1 6 .9 2 6 − 8 2 4 0 .4 1 1
ε = = − 5 7 .9 6 %
5 2 1 6 .9 2 6 63
64
32
Ch 12 - Integral Calculus 5/29/2013
Midpoint Rule
• Newton-Cotes Open Formula
b
∫
a
f ( x )dx ≈ ( b − a ) f ( x m )
a+b ( b − a )3
= (b − a )f ( )+ f ′′( η )
2 24
f(x)
a xm b 65 x
b−a
[ f ( x 1 ) + f ( x 2 )] + ( b − a ) f ′′( η )
3
b
∫a
f ( x )dx ≈
2 108
f(x)
x0 h x1 h x2 h x3 66 x
33
Ch 12 - Integral Calculus 5/29/2013
x0 h x1 h x2 h x3 h x467 x
68
34
Ch 12 - Integral Calculus 5/29/2013
6 6
5 5
4 4
3 3
2 2
1 1
0 0
3 5 7 9 11 13 15 3 5 7 9 11 13 15
7
Four segments 7
Many segments
6 6
5 5
4 4
3 3
2 2
1 1 69
0 0
3 5 7 9 11 13 15 3 5 7 9 11 13 15
b−a
h=
n
x0 h x1 h x2 h x3 h x470 x
35
Ch 12 - Integral Calculus 5/29/2013
h
n = 1, h = 4 ⇒ I = [ f ( 0 ) + f ( 4 )] = 23847.66 ε = −357.12%
2
h
n = 2 , h = 2 ⇒ I = [ f ( 0 ) + 2 f ( 2 ) + f ( 4 )] = 12142.23 ε = −132.75%
2
h
n = 4 ,h = 1 ⇒ I = [ f ( 0 ) + 2 f ( 1 ) + 2 f ( 2 )
2
+ 2 f ( 3 ) + f ( 4 )] = 7288.79 ε = −39.71%
h
n = 8 , h = 0.5 ⇒ I = [ f ( 0 ) + 2 f ( 0.5 ) + 2 f ( 1 )
2
+ 2 f ( 1.5 ) + 2 f ( 2 ) + 2 f ( 2.5 ) + 2 f ( 3 )
+ 2 f ( 3.5 ) + f ( 4 )] = 5764.76 ε = −10.50%
h
n = 16 , h = 0.25 ⇒ I = [ f ( 0 ) + 2 f ( 0.25 ) + 2 f ( 0.5 ) + L
2
+ 2 f ( 3.5 ) + 2 f ( 3.75 ) + f ( 4 )]
= 5355.95 ε = −2.66% 71
2 3 3.5 4
I = ∫ f ( x)dx + ∫ f ( x)dx + ∫ f ( x)dx + ∫ f ( x)dx
0 2 3 3 .5
=
h1
[ f (0) + f (2)] + h2 [ f (2) + f (3)]
2 2
+ 3 [ f (3) + f (3.5)] + 4 [ f (3.5) + f (4)]
h h
2 2
2
2
[ ] [
1
= 0 + 2e 4 + 2e 4 + 3e 6 +
2
]0.5 6
2
[
3e + 3.5e 7 ]
+
0.5
2
[ ]
3.5e 7 + 4e8 = 5971.58 ⇒ ε = −14.45%
72
36
Ch 12 - Integral Calculus 5/29/2013
b−a
h=
n
f(x)
…...
h
I= [ f ( 0 ) + 4 f ( 1 ) + 2 f ( 2 ) + 4 f ( 3 ) + f ( 4 )]
3
1
[
= 0 + 4 ( e 2 ) + 2( 2 e 4 ) + 4 ( 3e 6 ) + 4 e 8
3
]
= 5670.975 ⇒ ε = −8.70%
74
37
Ch 12 - Integral Calculus 5/29/2013
3 4
I = ∫ f ( x)dx + ∫ f ( x)dx
0 3
=
h1
[ f (0) + 4 f (1.5) + 2 f (3)]
3
+ 2 [ f (3) + 4 f (3.5) + 2 f (4)]
h
3
=
1.5
3
[ ]
0 + 4(1.5e 3 ) + 3e 6 +
0. 5 6
3
[
3e + 4(3.5e 7 ) + 4e8 ]
= 5413.23 ⇒ ε = −3.76% 75
Gaussian Quadratures
• Newton-Cotes Formulae
– use evenly-spaced functional values
• Gaussian Quadratures
– Select functional values at non-uniformly distributed points
to achieve higher accuracy. The values are not
predetermined, but unknowns to be determined.
– Changeg of variables => the interval of integration
g is [-1,1].
[ , ]
– Gauss-Legendre formulae
– Rule is stated as
1 n
∫ f(x)dx ≈ ∑c
i =1
i f ( xi ) 76
−1
38
Ch 12 - Integral Calculus 5/29/2013
Gaussian Quadratures
• The Gauss-Legendre quadrature formula is stated as
1 n
f( )d ≈ ∑ c
∫ f(x)dx i f ( xi )
−1 i =1
the ci's are called the weights, the xi's are called the quadrature
nodes. The approximation error term, ε, is called the truncation
error for integration.
For Gauss
Gauss-Legendre
Legendre quadrature
quadrature, the nodes are chosen to be zeros
of certain Legendre polynomials.
77
39
Ch 12 - Integral Calculus 5/29/2013
1
n = 2: ∫
−1
f(x)dx
= c1f(x1 ) + c 2 f(x 2 )
-1 x1 x2 1
• For n=2, we have four unknowns (c1, c2, x1, x2). These are found
by assuming that the formula gives exact results for integrating a
general 3rd order polynomial. It can also be done by choosing (c791,
c2, x1, x2) such that it yields “exact integral” for f(x) = x0, x1, x2, x3.
⎧f 1
= 1 ⇒ ∫ 1dx = 2 = c 1 + c 2 ⎧c 1 = 1
⎪ −1
⎪c = 1
⎪ 1
⎪ 2
⎪f = x ⇒ ∫ xdx = 0 = c 1 x 1 + c 2 x 2 −1
−1 ⎪
⎨ 1 2 ⇒ ⎨ x1 =
⎪f = x 2 ⇒ ∫ x 2 dx = = c 1 x 12 + c 2 x 22 ⎪ 3
⎪ −1 3 ⎪ 1
⎪f 1
= x 3 ⇒ ∫ x 3 dx = 0 = c 1 x 13 + c 2 x 23 ⎪ x2 = 3
⎩ −1
⎩
1 1 1
I = ∫ f ( x )dx = f ( − )+ f ( )
−1
3 3 80
40
Ch 12 - Integral Calculus 5/29/2013
-1 x1 x2 x3 1
• Now, choose (c1, c2, c3, x1, x2, x3) such that the method yields
“exact integral” for f(x) = x0, x1, x2, x3,x4, x5. (Again, (c1, c2, c3,
x1, x2, x3) are calculated by assuming the formula gives exact
expressions for integrating a fifth order polynomial). 81
−1
⎪ x2 = 0
⎪
⎪⎩ x3 = 3 / 5
1
2
f = x 4 ⇒ ∫ x 4 dx = = c1 x14 + c2 x24 + c3 x34
−1
5
1
f = x 5 ⇒ ∫ x 5 dx = 0 = c1 x15 + c2 x25 + c3 x35
82
−1
41
Ch 12 - Integral Calculus 5/29/2013
1 5 3 8 5 3
I = ∫ f ( x )dx = f(− )+ f (0 )+ f ( )
−1 9 5 9 9 5
83
Coordinate transformation
b−a b+a
t= x+ = 2 x + 2 ; dt = 2dx
2 2
4 1 1
I = ∫ 0
te 2 t dt = ∫
−1
( 4 x + 4 )e 4 x + 4 dx = ∫
−1
f ( x )dx
42
Ch 12 - Integral Calculus 5/29/2013
Coordinate transformation
b−a b+a
t= x+ = .82 x + .82 = .82(1 + x); dt = .82dx
2 2
t2 1
1.64 − 1 − [.82 (1+ x )]2 1
∫ ∫ ∫
1 .82 .82
I= e 2 dt = e 2 dx = f ( x)dx
2π 0 2π −1 2π −1 86
43
Ch 12 - Integral Calculus 5/29/2013
= e + e + e ⎟
2π ⎜⎝ 9 9 9 ⎟
⎠
= .32713267 * (0.5461465 9 + 0.63509351 + 0.19271450 )
= 0.44946544 (ε = 0 .007 %) 87
44