Chapter(7-8)

advertisement
Math 116 Calculus II
Contents
7
8
Additional topics in Integration
2
7.1
Integration by parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
7.4
Numerical Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7
7.5
Improper Integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
Calculus of Several Variables
14
8.1
Functions of several variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
8.2
Partial Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
8.3
Maxima and minima of functions of several variables . . . . . . . . . . . . . . . . . . .
17
8.4
Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
8.5
Constrained Optimization and Lagrange multipliers . . . . . . . . . . . . . . . . . . . .
21
8.6
Constrained Optimization and Lagrange Multipliers(continued) . . . . . . . . . . . . . .
22
8.7
Total Differentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
8.8
Multiple Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
8.9
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
1
Chapter 7
Additional topics in Integration
7.1
Integration by parts
Derivation:
• u = u(x).
• du = u0 dx, ex. d sin x = cos xdx
• Especially, d[uv] = udv + vdu = uv 0 dx + vu0 dx = [uv 0 + vu0 ]dx = [vu]0 dx (product rule).
• Ex. d[cos x sin x] = cos xd sin x + sin xd cos x = cos2 xdx − sin2 xdx = [cos2 x − sin2 x]dx =
[sin x cos x]0 dx.
Z
Z
Z
Z
Z
•
duv = udv + vdu, ⇒ uv = udv + vdu + C
Z
•
Z
udv = uv −
Z
vdu + C, or
Z
0
uv dx = uv −
vu0 dx + C
Note: We should choose u,v such that u0 v is simpler than uv 0 .
Examples:
Z
1.
xex dx.
• Choose u and dv, using try-and-test
• Case 1:
– u = ex ,
dv = xdx
2
Z
x
– du = e dx,
v=
Z
dv =
xdx =
x2
2
v
Z
–
z}|{ Z
du
2
z}|{
x2 zx}| {
x
x x
e xdx = |{z}
−
e dx
e
|{z}
2
2
|{z}
=u
u
=dv
v
• Case 2:
dv = exZdx
– du = dx, v = ex dx = ex
Z
Z
x
x
–
xe dx = xe − ex dx = xex − ex + C
– u = x,
Z
2.
x4 ln xdx.
u = ln x, dv = x4 dx
x5
1
du = dx, v =
x
5
Z
Z
x5
1 x5
x4 ln xdx = ln(x) ·
−
· dx
5
x 5
Z
3.
(x + 2)(x − 5)5 dx
u = (x + 2), dv = (x − 5)5 dx
(x − 5)6
du = dx, v =
6
Z
Z
(x − 5)6
(x − 5)6
5
(x + 2)(x − 5) dx = (x + 2) ·
−
dx
6
6
Z
4.
√
x x + 1dx.
u = x,
dv =
√
x+1
Z
√
2
x + 1dx = (x + 1)3/2
du = dx, v =
3
Z
Z
√
2
2
2
4
x x + 1 = x · (x + 1)3/2 −
(x + 1)3/2 dx = x(x + 1)3/2 − (x + 1)5/2 + C
3
3
3
15
Z
Rewrite it as
x(x + 1)1/2 dx, then refer to example 4.
3
Z
ln xdx
5.
u = ln x, dv = dx
1
du = dx, v = x
x
Z
Z
ln xdx = ln(x) · x −
Z
6.
1
· xdx.
x
(ln x)2 dx (repeated use by part)
u = (ln x)2 , dv = dx
1
du = ln(x) · , v = x
x
Z
Z
Z
1
2
2
2
ln(x)dx .
(ln x) dx = (ln x) x − ln(x) · · xdx = (ln x) x −
x
u = ln(x), dv = dx
1
du = dx, v = x
x
Z
Z
1
· xdx = ln(x)x − x
ln(x)dx = ln(x)x −
x
Z
⇒ (ln x)2 dx = (ln x)2 x − ln(x)x + x.
Some tricks
Z
1.
xf (x)dx, usually we choose u = x,
f (x)dx,
u = x,
dv = f (x)dx
Z
du = dx, v = f (x)dx = F (x)
Z
Z
xf (x)dx = xF (x) − F (x)dx
Examples
Z
Z
Z
Z
(a)
x sin xdx: F (x) = sin xdx = − cos x,
F (x) = − cos xdx = − sin x
Z
(b)
x cos xdx:
Z
Z
Z
Z
(c)
xex dx: F (x) = ex dx = ex ,
F (x)dx = ex dx = ex
4
Z
Z
n
x(x+1) dx: F (x) =
(d)
(x + 1)n+1
(x+1) dx =
,
n+1
n
Z
(x + 1)n+1
(x + 1)n+2
dx =
n+1
(n + 2)(n + 1)
Z
x ln xdx
(e)
u = lnx,
dv = xdx
Z
x2
1
du = , v = xdx =
x
2
Z
Z
2
2
x
1x
x2
x
x2
x2
=
ln x −
dx =
ln x −
dx =
ln x −
+C
2
x 2
2
2
2
4
Z
2.
x2 f (x)dx: using integration-by-part two times
Z
(a)
x2 cos xdx
1st time:
u = x2 ,
dv = cos xdx
du = 2xdx,
v = sin x
Z
= x2 sin x − 2x sin xdx
Z
2nd time: Calculate
u = 2x,
2x sin xdx
dv = sin xdx
v = − cos x
Z
= −2x cos x − 2(− cos x)dx = −x cos x + 2 sin x
du = 2dx,
Z
x2 cos xdx = x2 sin x + 2x cos x − 2 sin x + C
Z
x2 cos xdx
Z
x2 ex dx
(b)
(c)
1st time:
u = x2 ,
dv = ex dx
du = 2xdx, v = ex
Z
2 x
= x e − 2xex dx
5
Z
2nd time: Calculate
u = 2x,
dv = ex dx
v = ex
du = 2dx,
= 2xex −
2xex dx
Z
2ex dx = 2xex − 2ex
Z
x2 ex dx = x2 ex − 2xex + 2ex
Z
x2 (2x + 3)1 0dx
Z
x2 ln xdx
(d)
(e)
dv = x2 dx
u = ln x,
du =
(f)
x3
3
x3
=
3
Z
x2 ln xdx =
Z
(ln x)2
dx
x3
x3
v=
3
Z
1 x3
ln x −
dx
x 3
Z 2
x
ln x −
dx
3
1
dx,
x
Need to use 2 times of integration by part.
1st time:
u = (ln x)2 ,
dv = x−2 dx
1
,
x
v = −x−1
Z
2 −1
= −(ln x) x + 2 ln xx−2 dx
du = 2 ln x ·
Z
2nd time: calculate
u = ln x,
ln xx−2 dx
dv = x−2 dx
du = x−1 dx,
v = −x−1
Z
2
−1
= − ln xx + x−2 dx = − ln xx−1 −
x
6
Example 7: A politician can raise campaign funds at the rate of 50te−0.1t thousand dollars per week
during the first t weeks of a campaign. Find the average amount raised during the first 5 weeks.
Z 5
50te−0.1t dt
average =
0
u = 50t, dv = e−0.1t dt
du = 50dt, v =
Z
5
50te
−0.1t
0
7.4
e−0.1t
−0.1
5 Z 5
e−0.1t e−0.1t
dt = 50t ·
−
50
·
dt
−0.1 0
−0.1
0
5
e−0.1t −0.1t 5
= −500t · e
+ 500
0
−0.1 0
Numerical Integration
Integration Techniques:
• from integration rules;
• by substitution;
• by parts.
But we may not be able to find the closed form of many integrals. For example
Z 1
Z 2
sin(x)
−x2
e dx =?,
dx =?
x
0
1
Approximation: (Riemann Sum)
Z
b
f (x)dx. Given an integer n > 0, divide [a, b] into n subintervals. Then
Consider
a
∆x =
b−a
, x1 = a, x2 = x1 + ∆x, ..., xn+1 = xn + ∆x = b.
n
The Rectangle Rule:
Rn = ∆xf (x1 ) + ∆xf (x2 ) + · · · + ∆xf (xn )
Z b
def
f (x)dx = lim Rn
n→∞
a
The following figures show how Reimann Sum approximates integral when n = 1, 2, 3, 6, 10, 20.
7
4
4
4
2
2
2
−3−2−1
01 2 3 4 5 6 7
−3−2−1
01 2 3 4 5 6 7
−3−2−1
−2
−2
−2
4
4
4
2
2
2
−3−2−1
01 2 3 4 5 6 7
−3−2−1
−2
01 2 3 4 5 6 7
−3−2−1
−2
01 2 3 4 5 6 7
01 2 3 4 5 6 7
−2
It can be proved (in Numerical analysis) that
Z
|
b
f (x)dx − Rn | ≤
a
M1 (b − a)2
−→ 0
n
The Trapezoidal Rule:
1
1
Tn = ∆x f (x1 ) + f (x2 ) + · · · + f (xn ) + f (xn+1 )
2
2
Z b
M2 (b − a)3
f
(x)dx
−
T
−→ 0
n ≤
n2
a
Simpson’s Rule: (Just mention)
Sn =
∆x
[f (x1 ) + 4f (x2 ) + 2f (x3 ) + 4f (x4 ) + · · · + 4f (xn ) + f (xn−1 )]
3
Z b
M3 (b − a)5
f
(x)dx
−
S
−→ 0
n ≤
n4
a
These rules can be easily programmed on computer (including your graphic calculator).
Z 3
1
dx with n = 4.
Example 1: Use the rectangular and the trapezoidal rules to approximate
1 x
Soln: ∆x =
3−1
1
= .
4
2
8
x
1
3/2
2
5/2
3
Rectangular Rule
f (x) = 1/x
1
2/3
1/2
2/5
1/3
sum= 2.5667
1
s = 2.567 × = 1.283
2
3
Z
1
x
1
3/2
2
5/2
3
Trapezoidal Rule
f (x) = 1/x
1 → 1/2
2/3
1/2
2/5
1/3 → 1/6
sum= 2.233
1
s = 2.233 × = 1.1167
2
1
dx = ln(x)|31 = ln 3
x
Error for rectangular approximation:
Z
3
1
dx − S4 = 0.184
x
Z
3
1
dx − T4 = 0.018
x
1
Error for Trapezoidal approximation:
1
Trapezoidal approximation is much more accurate than rectangular approximation.
7.5
Improper Integral
Z
b
f (x)dx means the area of the region bounded by y = f (x), x = a, x = b and the
It is known that
a
x-axis (if f (x) ≥ 0, ∀x ∈ [a, b]).
How can we find the area of the region bounded by y = e−x , x = 0, and x-axis?
Z ∞
A=
e−x dx
0
This is not an ordinary integral. How to calculate it?
Idea: Approximation: let b is constant and large.
Z
b
−x
e
0
ex b
= 1 − e−b .
dx =
−1 0
9
Taking limit on both sides,
b
Z
lim
e−x dx = lim (1 − e−b ) = 1
b→∞
b→∞ 0
It is reasonable to regard
∞
Z
e
−x
dx = lim
b→∞ 0
0
∞
Z
b
Z
e−x dx.
f (x)dx is defined as
Definition: The improper integral
0
∞
Z
b
Z
f (x)dx.
f (x)dx = lim
a
b→∞ a
b
Z
Similarly
Z
f (x)dx = lim
a→−∞ a
−∞
Z
∞
b
Z
0
f (x)dx =
Z
f (x)dx +
−∞
−∞
f (x)dx,
∞
f (x)dx
0
Z
0
= lim
Z
f (x)dx + lim
a→−∞ a
b→∞ 0
b
f (x)dx
An improper integral is said to be convergent if the limit (or limits) exists and to be divergent if the limit
(or limits) does not exist.
L’Hôpital’s rule
• lim f (x) = lim g(x) = 0, or ± ∞
x→c
x→c
f 0 (x)
exists, and g 0 (x) 6= 0 for all x 6= c.
x→c g 0 (x)
• lim
f (x)
f 0 (x)
= lim 0
x→c g(x)
x→c g (x)
• then lim
Examples
x
1
= lim x = 0
x
x→∞ e
x→∞ e
1. lim
x2
2x
2
= lim x = lim x = 0
x→∞ ex
x→∞ e
x→∞ e
2. lim
cos x
sin x
= lim
= cos(0) = 1
x→0 x
x→0 1
3. lim
10
ex
ex
= lim
= lim xex = ∞.
x→∞ ln x
x→∞ 1/x
x→∞
4. lim
Limits of some special functions
−∞
e
∞
e
x
= lim e
=
0
x→−∞
lim ex
x→∞
∞
ln(∞) = lim ln x
∞
ln(0) = lim ln x
−∞
x→∞
x→0
n
lim 1/x
x→∞
n
lim 1/x
n>0
0
∞
n>0
x→0
lim xe−x
x→∞
0
n −x
lim x e
x→∞
,
n > 0,
0
Examples
Z
∞
1.
0
Z
1
dx = ln(|x + 1|)|∞
0 = ∞ (divergent).
x+1
2
2.
−∞
(x2
x
dx.
+ 1)2
Using method of substitution. Let u = x2 + 1, then du = 2xdx, xdx =
Z
2
−∞
Z
−∞
5
du
1
= ln(|u|)
= −∞
2u
2
+∞
∞
√
1
√ dx = 2 x|∞
1 = ∞.
x
4.
1
5.
2
1
1
1
dx = −x−1 |∞
] − [− ] = −0 + 1 = 1.
1 = [−
2
x
∞
1
1
Z
Z
∞
3.
Z
x
dx =
2
(x + 1)2
∞
xe−x dxdx
0
• using integration by parts
• u = x,
dv = e−x dx
• du = dx, v = −e−x
Z
Z
•
xe−x dx = −xe−x + e−x dx = −xe−x − e−x
Z ∞
•
xe−x dxdx = −xe−x − e−x |∞
0
0
11
du
2
x
=0
ex
− e−x = 0,
• lim −xe−x = lim −
x→∞
• ∞ → x,
−xe
x→∞
−x
0 → x,
−xe−x − e−x = −1
• Soln= 0 − (−1) = 1
Z
∞
f (x)dx
Improper Integral:
−∞
Let c be any real number and suppose both the improper integrals
Z ∞
Z ∞
f (x)dx
f (x)dx and
c
c
are convergent. Then the improper integral
Z
Z ∞
f (x)dx =
c
Z
−∞
−∞
−∞
f (x)dx
f (x)dx +
c
Examples
Z
∞
1.
2
xe−x dx
−∞
Z
∞
•
xe
−∞
−x2
Z
0
dx =
xe
−x2
−∞
∞
Z
dxdx +
2
xe−x dxdx
0
• using method of substitution
• u = −x2 , du = −2xdx
Z
Z
1
1
1
2
2
•
xe−x dx = −
eu du = − eu = − e−x
2
2
2
1
2
• −∞ → x, − e−x = 0
2
1
1 −x2
=−
• 0 → x, − e
2
2
Z 0
1
1
2
2
•
xe−x dxdx = − e−x |0−∞ = −
2
2
−∞
1 −x2
• ∞ → x, − e
=0
2
Z ∞
1
1
1
2
2
•
xe−x dxdx = − e−x |∞
0 = 0 − (− ) =
2
2
2
Z0 ∞
1 1
2
•
xe−x dx = − + = 0
2
2
−∞
12
Review of Chapter 7
Integration by parts:
Z
Z
0
uv dx =
Z
∞
Z
udv = uv −
b
Z
−∞
a
vdu = uv −
vu0 dx
∞
f (x)dx, inf f (x)dx,
Improper integrals:
Z
f (x)dx.
−∞
Numerical integration:
• Rectangular rule.
• trapezoidal rule.
• Simpson’s rule*.
Examples:
Z
1. Integration by parts.
ln(t)
√ dt.
t
1
u = ln(t), dv = √ dt = t−1/2 dt
t
1
1/2
du = dt, v = 2t
t
Z
Z
√
ln(t)
1
√ dt = ln(t)2 t −
· 2t1/2 dt
t
t
Z
2. Integration by parts.
(x + 3)(x − 1)4 dx
u = (x + 1), dv = (x − 1)4 dx
(x − 1)5
du = dx, v =
5
Z
Z
(x + 1)(x − 1)5
(x + 3)(x − 1)4 dx =
− (x − 1)4 dx
5
Z
∞
3. Substitution.
−∞
e−x
.
(1 + e−x )3
u = 1 + e−x , du = −e−x dx.
1
Z ∞
Z 1
e−x
1
u−2 1
=
du =
= −2 − 0
−x )3
3
(1
+
e
u
−2
−∞
∞
∞
13
Chapter 8
Calculus of Several Variables
8.1
Functions of several variables
Definition(function):(y = f (x))
A function is a rule such that to each value x in the domain, there corresponds one and only one number
y.
What to know for y = f (x):
• find the domain: set of all x for which f (x) is defined.
natural domain: largest set of all x for which f (x) is defined.
• Range: the set of all resulting values of the function
• sketch the graph (range, domain, special points, behavior as x → ∞.
• differentiate f (x).
• integrate f (x).
√
Example: f (x) = x
domain: x ≥ 0 or {x|x ≥ 0} = [0, +∞).
range: {y|y ≥ 0} = [0, +∞).
x
0
1
2
4
∞
√
y= x
2
0
1
2
3
4
5
14
√
y= x
0
1
1.414
2
∞
Functions of Several Variables :
Motivation: temperature depends on place (latitude, longitude, and elevation) and time
T = T (t, θ, φ, h)
Def: A function f of two variables is a rule such that to each ordered pair (x, y) in the domain of f , there
corresponds one and only one number f (x, y).
(x, y) −→ z = f (x, y)
or z = f (x, y).
√
x
Example 1: f (x, y) = √
y
Domain: D = {(x, y)|x ≥ 0, y > 0}
Range: z ≥ 0
x
, f (1, e), f (e, 1)?
ln(y)
p
Example 3: f (x, y) = 100 − x2 − y 2 , f (x, y) = ln(x2 + y 2 ).
Example 2: f (x, y) =
Example 4: z = 18 − x2 − y 2
Example 5: z = y 2 − x2
8.2
Partial Derivatives
Def (Using partial derivatives): the rate of change of a function with respect to one variable while holding all other variables constant.
Consider differentiating f (x)
f (x + h) − f (x)
df
= lim
dx h→0
h
f (x) = cx3 ,
c is a constant
df
d
=
(cx3 ) = 3cx2
dx
dx
What about two variables (x, y)
f (x, y) = x4 + y 2
d 4
2 (x + y )
= 4x3
dx
y held constant
d 4
2 (x + y )
= 2y
dy
x held constant
15
Notations:
∂
d
∂f
(x, y) =
f (x, y) =
f (x, y)
fx =
∂x
∂x
dx
y held constant
∂f
∂
d
fy =
(x, y) =
f (x, y) =
f (x, y)
∂y
∂y
dy
x held constant
∂f
f (x + h, y) − f (x, y)
(x, y) = lim
h→0
∂x
h
∂f
f (x, y + h) − f (x, y)
(x, y) = lim
h→0
∂x
h
Examples:
• f (x, y) = x3 + 3x2 y 2 − 2y 3 − x + y
fx = 3x2 + 6xy 2 − 0 − 1 + 0
fy = 0 + 6x2 y − 6y − 0 + 1
• f (x, y) = ln(
p
x2 + y 2 )
1
fx = p
x2 + y 2
1
fy = p
2
x + y2
1
· p
· (2x)
2 x2 + y 2
1
· p
· (2y)
2
2 x + y2
• w = (u − v)3
∂w
= 3(u − v)2
∂u
∂w
= 3(u − v)2 (−1)
∂v
• f (x, y) = ex
2 +y 2
, find fx (0, 1), fy (0, 1)
2 +y 2
(2x), fx (0, 1) = e1 (2 × 0) = 0
2 +y 2
(2y), fy (0, 1) = e1 (2 × 1) = 2e
fx = ex
fy = ex
Higher Order Derivatives:
∂ ∂f
f = f (x, y), fxy =
. Similar rules are applied to fxx , fxy , fyx
∂y ∂x
Example: Second-order derivatives of
f (x, y) = 5x3 − 2x2 y 3 + 3y 4
16
Soln:
fx = 15x2 − 4xy 3 , fy = −6x2 y 2 + 12y 3
fxx =
∂
∂
(15x2 − 4xy 3 ) = 30x − 4y 3 , fyx = fxy =
(15x2 − 4xy 3 ) = −12xy 2
∂x
∂y
fyy =
8.3
∂
(−6x2 y 2 + 12y 3 ) = −12x2 y + 36y 2
∂y
Maxima and minima of functions of several variables
Introduction: minimum points, maximum points, saddle points. How to define or characterize them?
Critical points (Def): (a, b) is a critical point of f (x, y) if
fx (a, b) = 0, and fy (a, b) = 0
• Relative maximum and minimum values can occur only at critical points.
• relative maximum , minimum and saddle points are critical points.
Example 1: find critical points of f (x, y) = 3x2 + 2y 2 + 2xy + 8x + 4y.
Soln:
fx (x, y) = 6x + 2y + 8 = 0;
fy (x, y) = 4y + 2x + 4 = 0
6
x=− ,
5
y=−
2
5
Second Derivative test for functions f (x, y) – The D-test:
(a, b) is a critical point of f (x, y). Let D = fxx (a, b) · fyy (a, b) − [fxy (a, b)]2 ,
(i) if D > 0 and fxx (a, b) > 0, f (x, y) has a relative (local) minimum at (a, b);
(ii) if D > 0 and fxx (a, b) < 0, f (x, y) has a relative (local) maximum at (a, b);
(iii) if D < 0, f (x, y) has a saddle point at (a, b).
(iv) if D = 0, inconclusive. (a, b) can be either a relative maximum, a relative minimum or a saddle
point.
17
Def: (Saddle Point): a saddle point is a stationary point (critical point) but not a local extremum. A critical
point is either a local minimum, a local maximum or a saddle point.
Example 2: f (x, y) = 3x2 + 2y 2 + 2xy + 8x + 4y, fxx = 6, fxy = 2, fyy = 4.
2
D = fxx fyy − fxy
= 24 − 4 = 20 > 0, fxx > 0, relative minimum
Example 3: find the relative extreme values of f (x, y) = e5(x
fx (x, y) = 10xe5(x
fy (x, y) = 10ye5(x
fxx (x, y) = 10e5(x
Critical Points:
(
2
.
2 +y 2 )
2 +y 2 )
2 +y 2 )+100x2 e5(x2 +y 2 )
fxy (x, y) = 100xye5(x
fyy (x, y) = 10e5(x
2 +y 2 )
2 +y 2 )
2 +y 2 )
+ 100y 2 e5(x
2 +y 2 )
2
10xe5(x +y ) = 0
⇒ x = 0, y = 0.
2
10ye5(x +y62) = 0
fxx (0, 0) = 10 > 0
fxy (0, 0) = 0
fyy (0, 0) = 10
D = 10 × 10 − 02 = 100 > 0
(a, b) = (0, 0), minimum points
f (0, 0) = 1.
Example 4 f (x, y) = x3 − y 3 − 3x + 6y.
18
8.4
Least Squares
We want to find a straight line to fit these data.
E
E
G
G
5
5
F
0
5
H
F
0
10
5
H
10
Example 1 We try to find a line y = ax + b to best fit the following 4 given points.
x
2
6
10
12
y
6
2
5
2
ax+b
2a+b
6a+b
10a+b
12a+b
error=ax+b-y
2a+b-6
6a+b-2
10a+b-5
12a+b-2
Let
S(a, b) = (2a + b − 6)2 + (6a + b − 2)2 + (10a + b − 5)2 + (12a + b − 2)2
We find a, b by
min S(a, b)
a,b
General Case: fit a straight line to data
x
x1
x2
..
.
y
y1
y2
..
.
xy
x1 y1
x2 y2
..
.
x2
x21
x22
..
.
x
Pn
x
y
Pn
y
x y
Pn n
xy
x2
Pn 2
x
the least square line is y = ax + b
P
P
xy − ( x)( y)
P
P
a=
n x2 − ( x)2
X
1 X
b= (
y−a
x)
n
n
P
Example 1: n = 3.
19
x
1
2
3
P
x=6
y
10
12
25
P
y = 47
xy
10
24
75
xy = 109
x2
1
4
9
P 2
x = 14
P
P
xy − ( x)( y)
P
P
a=
n x2 − ( x)2
3 × 109 − 6 × 47
=
3 × 14 − 62
= 7.5
n
b=
P
X
1 X
1
(
y−a
x) = (47 − 7.5 × 6) = 0.667
n
3
fitting line: y = 7.5x + 0.67
C
20
B
A
10
0
1
2
3
Example 2 Fit a straight line to
x
1.0
(a) 1.5
2
2.5
y
30
35
38
40
x
0
(b) 1
2
3
20
y
5
8
8
12
8.5
Constrained Optimization and Lagrange multipliers
Review: unconstrained Optimization:
z = f (x, y) = x2 + y 2
∂f
∂f
= 2x,
= 2y
∂x
∂y
∂f
=0
∂x
∂f
=0
∂y



⇒ (x, y) = (0, 0) (Critical point and minimum point)


Constrained Optimization
Find the minimum of the intersection curve between z = x2 + y 2 and y = 2 plane, which is equivalent to
minimize x2 + y 2 , subject to y = 2.
missing graph here
Method 1:
f (x, y) = x2 + y 2 , f (x, 2) = x2 + 4
minimize(x2 + 4) ⇒ x = 0
∴ (x, y) = (0, 2)
is the minimum point, and the corresponding
minimum function value is 4
Method 2: Let
F (x, y, λ) = x2 + y 2 + λ(y − 2)

∂F

= 2x,
x=0



∂x
 ∂F
= 2y + λ, 2y + λ = 0

∂y



 ∂F = y − 2, y − 2 = 0
∂λ
x = 0, y = 2, λ = −4
∴ (x, y) = (0, 2) is the minimum point with minimum value f (0, 2) = 4.
Method of Lagrange multipliers
minimize f (x, y)
subject to g(x, y) = 0 (constraint)
(i) define F (x, y, λ) = f (x, y) + λg(x, y).
21
(ii) Find critical points (x, y, λ) of F :
∂F
∂F
∂F
= 0,
= 0,
= 0.
∂x
∂y
∂λ
(iii) The solutions found in step 2 are candidates for the extrema of f .
Note: Of the method of Lagrange multipliers, there is no criterion to determine whether a critical point of
a function of two or more variables leads to a relative maximum or relative minimum.
Example 2 f (x, y, z) = 2xy + 6yz + 8xz, constraint: xyz = 12, 000.
8.6
Constrained Optimization and Lagrange Multipliers(continued)
Example 1: A container company wants to design and aluminum can requiring the least amount of
aluminum, but that contains exactly 16π cubic inches. Find the radius and the height of the can.
A = 2πr2 + 2πr · h
V = πr2 · h
min 2πr2 + 2πr · h
r,h
subject to πr2 · h = 16π
Soln: Using method of Lagrange multiplier
F (r, h, λ) = 2πr2 + 2πrh + λ(πr2 h − 32π)

 Fr = 4πr + 2πh + 2πrhλ = 0 (1)
F = 2πr + λπr2 = 0
(2)
 h
2
Fλ = πr h − 16π
(3)
From (2) λr = −2
− 2 → λr in (1),
2r → h in (3),
r = 2,
4πr − 2πh = 0,
3
2πr − 16π = 0,
2r = h
r=2
h=4
The minimum amount of aluminum needed is 2π(2)2 + 2π(2)(4) = 24π, when r = 2, h = 4.
22
Example 2:Minimize or maximize f (x, y) = 2xy, subject to x2 + y 2 = 18.
F (x, y, λ) = 2xy + λ(x2 + y 2 − 18).

(1)
 Fx = 2y + 2xλ = 0;
Fy = 2x + 2yλ = 0;
(2)

Fλ = x2 + y 2 − 18 = 0. (3)
y(2y + 2xλ) = 0 (3)
x(2x + 2yλ) = 0 (4)
(3) − (4) ⇒ 2y 2 − 2x2 = 0.
y 2 − x2 = 0
⇒ y = ±3 x = ±3
x2 + y 2 − 18 = 0
Critical points:
(−3, −3) (−3, 3) (3, −3) (3, 3)
f (−3, −3) = 18; f (−3, 3) = −18;
f (3, −3) = −18; f (3, 3) = 18;
minimum: −18, maximum: 18.
More Examples: Maximize and minimize f (x, y) = 12x + 30y, subject to x2 + 5y 2 = 81.
8.7
Total Differentials
One-variable function f (x), change in x: dx.
x → x + dx
f (x) → f (x + dx)
∆f = f (x + dx) − f (x) ' f 0 (x)dx.
Two-variable function f (x), change in x: dx, change in y: dy.
∆f = f (x + dx, y + dy) − f (x, y)
= f (x + dx, y + dy) − f (x, y + dy) + f (x, y + dy) − f (x, y)
' fx (x, y + dy)dx + fy (x, y)dy
' fx dx + fy dy.
df ≡ fx dx + fy dy ' ∆f
Approximate change of f
Example: f (x, y) = e3x−2y
df = e3x−2y · 3dx + e3x−2y · (−2)dy
23
Example 1: f (x, y) = ln(1 + x2 + y 2 ). df =?
Example 2: f (x, y) =
x−y
, find ∆f when (x, y) changes from (−3, −2) to (−3.02, −1.98)
x+y
dx = −3.02 − (−3) = −0.02,
dy = −1.98 − (−2) = 0.02
y)0x (x
+ y) − (x +
− y)
2y
=
2
(x + y)
(x + y)2
0
0
(x − y)y (x + y) − (x + y)y (x − y)
−2x
fy =
=
(x + y)2
(x + y)2
∆f ' df = fx dx + fy dy|x=−3,y=−2,dx=−0.02,dy=0.02
fx =
(x −
y)0x (x
= 0.08/25 + 0.12/25 = 0.2/25 = 0.008
Applied Example: (Approximating Changes) Find the approximate change in the volume of a cylinder
when the radius is increased from 5 to 6 and the height is decreased from 4 to 2.
V = πr2 h
∂V
∂V dx +
dh
r = 5, h = 4
∂r
∂h
dr = 1, dh = −2
= (2πrh)dr + (πr2 )dh
r = 5, h = 4
dr = 1, dh = −2
dV =
= 40π − 50π = −2π
8.8
Multiple Integrals
Definition:(Double integral) The double integral of a continuous function f (x, y) on a rectangular region
R is
ZZ
X
f (x, y)dxdy = lim
f (xi , yj )∆x∆y
∆x,∆y→0
R
(The sum is over all rectangles in R)
If f (x, y) is non-negative on R, then the double integral gives the volume under f over R.
Definition: (Iterated integrals) R is the rectangle defined by a ≤ x ≤ b, c ≤ y ≤ d and
Z d Z b
Z b Z d
f (x, y)dx dy,
f (x, y)dy dx
c
a
a
are called iterated integrals.
24
c
Example 1:
2Z 1
Z
Z
2 Z 1
8xydy dx
8xydydx =
0
0
0
0
Example 2:
4Z 1
Z
0
(x2 + y 2 )dxdy
0
Rule 1:
Z
d Z b
c
Z b Z
f (x, y)dx dy =
a
a
d
f (x, y)dy dx
c
Rule 2: Let R = {(x, y) | a ≤ x ≤ b, c ≤ y ≤ d}
Z bZ
Z dZ b
ZZ
f (x, y)dxdy =
f (x, y)dxdy =
c
R
a
a
Example 4: R : −2 ≤ x ≤ 2, 0 ≤ y ≤ 1, f (x, y) =
d
f (x, y)dydx
c
xy
.
1 + y2
Example 5: R = {(x, y) | 0 ≤ x ≤ 1, 1 ≤ y ≤ 2}
ZZ
6x2 ydxdy.
R
Double integral over non-rectangular region
Example 6 R = {(x, y) | 0 ≤ x ≤ 1, 0 ≤ y ≤ ex }, f (x, y) = xy
Z 1 Z ex
xydydx
0
0
Slon:
Z
ex
x
xydy = 1/2xy 2 |e0 = 1/2x(ex )2 − 1/2x02 = 1/2xe2x
0
Z
1
1/2xe2x dx,
Using integration by parts
0
dv = e2x dx
Z
du = 1/2dx, v = e2x dx = 1/2e2x .
Z
Z
F (x) = 1/2xe2x dx = (1/2x)(1/2e2x ) − 1/4e2x dx = 1/4xe2x − 1/8e2x
u = 1/2x,
F (1) − F (0) = 1/4e2 − 1/8.
Note: since the region of y depends on x, the order of the integral is NOT exchangeable, that is, we can
not calculate
Z x Z
e
1
xydx dy.
0
0
25
Example 2: f (x, y) =
√
2y
; R is the region bounded by y = x, y = 0, and x = 4.
2
1+x
Region R
4
3
B
2
R
1
A
−1
0
1
2
3
4
5
6
−1
−2
4Z
Z
Soln:
0
0
√
x
2y
dydx
1 + x2
√
Z
0
Z
x
√x
2
y2
2 x
y·
dx =
·
=
1 + x2
2 1 + x2 0
1 + x2
4
x
dx, Using method substitution
1
+
x2
0
u = (1 + x2 ), du = 2xdx
Z 4
Z
x
1
dx
=
1/2 du = 1/2 ln |u| = 1/2 ln(1 + x2 )|40 = 1/2 ln 5
2
1
+
x
u
0
8.9
Applications
Average:
1
Average value
=
of f over R
area of R
ZZ
f (x, y)dxdy
R
Example 4: f (x, y) = 20 + 6x2 y
R = {(x, y) | 0 ≤ x ≤ 2, 0 ≤ y ≤ 3}
26
Example 1 Suppose the population of a certain city is
f (x, y) = 10, 000e−0.2x−0.1y /mile2
Let (0, 0) gives the location of the city hall, what is the population inside the rectangular area described
by
R = {(x, y) | 0 ≤ x ≤ 10; 0 ≤ y ≤ 5}
Z 1 Z 5
Soln: The population is
0
10, 000e−0.2x−0.1y dydx
0
Z
5
0
10, 000e−0.2x−0.1y dy = −100, 000e−0.2x−0.1y |50 = −100, 000[e−0.2x−0.5 − e−0.2x ]
0
Z
1
0(−100, 000)[e−0.2x−0.5 − e−0.2x ]dx = 500, 000[e−0.2x−0.5 − e−0.2x ]|10 0
0
= 500, 000[e−2.5 − e−2 − e−0.5 + 1] = 170109.5
Review of Chapter 8
• functions of several variables:
definition, domain, natural domain, range, three dimensional coordinate system.
• partial derivative (fx , fy , fxx , fyy , ...)
• Optimization problem:
Critical points (relative minimum points, relative maximum points, saddle points)
D-test
• Constrained Optimization problem:
Lagrange multiplier method.
• Least squares: straight line fitting
• total differentials
• double integration:
iterated integrals, average over a domain.
Example 1: Find all relative extreme values: and tell if they are minimum or maximum.
f (x, y) = 2xy − x2 − 5y 2 + 2x − 10y + 3
Example 2: Straight line fitting
x
1
2
4
5
y
7
4
2
-1
27
a=
n
P
P
P
X
1 X
xy − ( x)( y)
P 2
P 2 , b= (
y−a
x)
n x − ( x)
n
Example 3:
maximize f (x, y) = 4xy − x2 − y 2
subject to x + 2y = 26
Example 4:A company’s profit is p = 300x2/3 y 1/3 , where x and y are respectively, the amounts spent
on production and advertising. The company has a total 60, 000 dollars to spend. find the amounts for
production and advertising that maximizing the profit.
28
Download