P1 Calculus II Partial Differentiation & Multiple Integrationdwm/Courses/1PD_2017/1PD-L1.pdf · P1...
Transcript of P1 Calculus II Partial Differentiation & Multiple Integrationdwm/Courses/1PD_2017/1PD-L1.pdf · P1...
P1 2017 1 / 39
P1 Calculus II
Partial Differentiation & Multiple Integration
Prof David Murray
[email protected]/∼dwm/Courses/1PD
4 lectures, MT 2017
P1 2017 2 / 39
MotivationSo far in your explorations of the differential and integral calculus,you have considered only functions of one variableThis comes naturally to you ...
ddx
(ln(cosh
(sin−1 (1− 1
x))))
: x > 1 and∫
x(x2 + 1)n
dx .
But you do not have to look too hard to find quantities whichdepend on more than one independent variable
P1 2017 3 / 39
News, good and ...
This lecture course explains how to extend the calculus to tomultiple independent variables.
There’s good newsMost changes kick in going from one to two independant variables ...
... so usually two will do f = f (x , y).
And even better newsWhereas calculus in 1 variable can feel somewhat mechanistic ...
... now you really have to think!
P1 2017 4 / 39
Course ContentsThe material splits into four topics to be covered over the four lectureslots.
é Partial differentiation and differentialsé Relationships arising from the nature of the functioné Changing variables from one set to anotheré Multiple integration
The tutorial sheet directly associated with this course is
é 1P1H Calculus II: Partial Differentiation & Multiple Integrals
But, as ever, the sheet is not enough.• You must read, mark, learn and inwardly digest
— and not just these notes.• You must try worked examples from books.
P1 2017 5 / 39
Reading
James, G. (2001) Modern Engineering Mathematics, Prentice-Hall,3rd Ed., ISBN: 0-13-018319-9 (paperback).
Stephenson, G. (1973) Mathematical Methods for Science Students,Longman Scientific & Technical, 2nd Ed., ISBN: 0-582-44416-0(paperback).
Kreyszig, E. (1999) Advanced Engineering Mathematics, John Wiley& Sons, 8th Ed., ISBN: 0-471-15496-2 (paperback).
P1 2017 6 / 39
Course WWW Pages
Pdf copies of the notes, copies of the lecture slides, the tutorial sheets,corrections, answers to FAQs etc, will be accessible from
www.robots.ox.ac.uk/∼dwm/Courses
Only the notes and the tute sheets get put on weblearn.www.weblearn.ox.ac.uk
P1 2017 7 / 39
1 Partial Derivatives & Differentials
P1 2017 8 / 39
Lecture contents
In this lecture we are concerned with ...
1.1 Continuity/limits for functions of more than one variable1.2 Partial derivatives1.3 A cautionary tale: partial derivatives are not fractions1.4 The total or perfect differential
P1 2017 9 / 39
1.1 Continuity and limits
P1 2017 10 / 39
Revision of single variable continuity
Function y = f (x) is continuous atx = a if, for every positive number ε(however small), one can find aneighbourhood
|x − a| < η
in which
|f (x) − f (a)| < ε .
f(x)
x
f(a)
a
ηη
<ε
<ε
Two useful facts about continuous functions are:The sum, difference and product of two continuous functions iscontinuous.The quotient of two continuous functions is continous at every pointwhere the denominator is not zero.
P1 2017 11 / 39
Revision of single variable derivative
The total derivative isdefined as
dfdx
= limδx→0
[f (x + δx) − f (x)
δx
].
f (x) is differentiable if thislimit exists, and existsindependent of how δx → 0.
x+ δx
f(x+ δx)
f(x+ δx)
δx
δxas tends to zeroTends to tangent
f(x)
x
f=δ − f(x)
Note thatA differentiable function is continuous.A continuous function is not necessarily differentiable. f (x) = |x | isan example of a function which is continous but not differentiable(at x = 0).
P1 2017 12 / 39
Moving to more than one variable
The big changes take place in going from n = 1 variables to n > 1variables. So for much of the time we can deal with functions of only twovariables — eg, f (x , y).
f (x , y) is conveniently represented as a surface, as opposed to a planecurve for a one variable function.
−4−2
02
4
−5
0
5−20
−10
0
10
20
xy
f(x,y
)
−4−2
02
4
−5
0
5−1
−0.5
0
0.5
1
xy
f(x,y
)
(x + y)(x − y) exp[−(x2 + y2)/10] sin(2x) cos(4y)
P1 2017 13 / 39
Continuity for functions of several variablesFunction f (x , y) iscontinuous at a point(a, b) in R if, for everypositive number ε(however small), it ispossible to find a positiveη such that
project onto
surface
circle, radius
at (x,y)=(a,b)x
y
ε
ε
f(x,y)
f(a,b)
η
|f (x , y) − f (a, b)| < ε for all points (x − a)2 + (y − b)2 < η2
Thenlim
(x ,y)→(a,b)f (x , y) = f (a, b).
Note that for functions of more variables f (x1, x2, x3, ...) theneighbourhood would be defined by
(x1 − a)2 + (x2 − b)2 + (x3 − c)2 + . . . < η2 .
P1 2017 14 / 39
1.2 The partial derivative
P1 2017 15 / 39
The partial derivative
Problem!
The slope of the f (x , y) surface at(x , y) depends on which directionyou move off in!
We have to think about slope in aparticular direction.
The obvious directions are thosealong the x− and y−axes.
Solution! To move off from (x , y) in the x direction, keep y fixed.
Define the partial derivative wrt x :
fx =
(∂f∂x
)y= limδx→0
[f (x + δx , y) − f (x , y)
δx
]
P1 2017 16 / 39
More than two independent variables
If we are dealing with a function of more variables ...
... simply keep all but the one variable constant.
Eg for f (x1, x2, x3, ...) we have
The partial derivative again ...(∂f∂x3
)x1x2x4...
= limδx3→0
[f (x1, x2, x3 + δx3, x4, ...) − f (x1, x2, x3, x4, ...)
δx3
]
Given that you know the list of the variables, and know the one beingvaried, the “held constant” subscripts are superfluous and are oftenomitted.
P1 2017 17 / 39
Geometrical interpretation of the partial derivative
plane
= constantyf(x,y)
yx
x
fSlope is
fx y
plane
= constantxf(x,y)
yx
fSlope is
y
fy x
P1 2017 18 / 39
The mechanics of evaluating partial derivatives
Operationally, partial differentiation is exactly the same as normaldifferentiation with respect to one variable, with all the others treatedas constants.
♣ ExampleSuppose
f (x , y) = x2y3 − 2y2
First assume y is a constant:
∂f∂x
= 2xy3
Then x is a constant:∂f∂y
= 3x2y2 − 4y
P1 2017 19 / 39
Examples♣ ExampleFind the 1st partial derivatives of f (x , y) = e−(x2+y2) sin(xy2)
∂f∂x
= e−(x2+y2)[−2x sin(xy2) + y2 cos(xy2)]
∂f∂y
= e−(x2+y2)[−2y sin(xy2) + 2xy cos(xy2)]
♣ Example
If f (x , y) = ln(xy), find the product(∂f∂x
)(∂f∂y
)in terms of f .
f (x , y) = ln(x) + ln(y)
⇒∂f∂x
= 1/x and∂f∂y
= 1/y
⇒(∂f∂x
)(∂f∂y
)= 1/xy = e−f (x ,y) .
P1 2017 20 / 39
Higher partial derivatives∂f /∂x and ∂f /∂y are probably perfectly good functions of (x , y), so wecan differentiate again.
∂2f∂x2 =
∂
∂xfx = fxx
♣ Example.
f (x , y) = x2y3 − 2y2
∂f /∂x = 2xy3
∂f /∂y = 3x2y2 − 4y
Hence
∂2f /∂x2 = 2y3
∂2f /∂y2 = 6x2y − 4 .
But we should also consider∂
∂y
(∂f∂x
)=
∂2f∂y∂x
= 6xy2 and∂
∂x
(∂f∂y
)=
∂2f∂x∂y
= 6xy2.
P1 2017 21 / 39
Higher partial derivatives∂f /∂x and ∂f /∂y are probably perfectly good functions of (x , y), so wecan differentiate again.
∂2f∂x2 =
∂
∂xfx = fxx
♣ Example.
f (x , y) = x2y3 − 2y2
∂f /∂x = 2xy3
∂f /∂y = 3x2y2 − 4y
Hence
∂2f /∂x2 = 2y3
∂2f /∂y2 = 6x2y − 4 .
But we should also consider∂
∂y
(∂f∂x
)=
∂2f∂y∂x
= 6xy2 and∂
∂x
(∂f∂y
)=
∂2f∂x∂y
= 6xy2.
Oooo!∂2f∂x∂y
=∂2f∂y∂x
— is that always true?
P1 2017 22 / 39
♣ A more complicated random example
f (x , y) = e−(x2+y2) sin(xy2)
∂f∂x
= e−(x2+y2)[−2x sin(xy2) + y2 cos(xy2)]
∂f∂y
= e−(x2+y2)[−2y sin(xy2) + 2xy cos(xy2)]
⇒ fyx = e−(x2+y2)[−4x2y cos() + 2y cos() − 2y3x sin()− 2y [−2x sin() + y2 cos()]]
= e−(x2+y2)[sin()[−2y3x + 4xy ] + cos()[−4x2y + 2y − 2y3]]
and fxy = e−(x2+y2)[−2y3 cos() + 2y cos() − 2xy3 sin()− 2x [−2y sin() + 2xy cos()]]
= e−(x2+y2)[sin()[−2xy3 + 4xy ] + cos()[−2y3 + 2y − 4x2y ]]
So they are equal in this case too.
P1 2017 23 / 39
Yes, they are equal
When both sides exist, and are continuous at the point of interest,
∂2
∂x∂y≡ ∂2
∂y∂x
Although the order is unimportant — a little thought can save time!♣ Example.Q: Find
∂3
∂t∂y∂x[(y5 + xy) cosh(cosh(x2 + 1/x)) + y2tx
].
A: You have three seconds ...
P1 2017 24 / 39
1.3 Partial derivatives are not fraction-like
A severe warning
P1 2017 25 / 39
Partial derivatives are not fractions
You know from the chain rule that total derivatives have fraction-likequalities ...
♣ Example.Given y = u1/3, u = v3 and v = x2, find dy/dx .
dydx
=dydu· dudv· dvdx
=13u−2/3 3v2 2x = 2x =
131v2 3v2 2x = 2x
which you can check by finding y = x2 explicitly.
P1 2017 26 / 39
This is NOT the case for partials
♣ Example.Given the perfect gas law pV = RT , determine the product(
∂p∂V
)T
(∂V∂T
)p
(∂T∂p
)V
Of course those tempted to divide would guess the answer = 1
But you’d be DEAD WRONG!
P1 2017 27 / 39
If pV = RT then p =RTV
, V =RTp
, and T =VpR
.
Thus(∂p∂V
)(∂V∂T
)(∂T∂p
)=
(−RTV 2
)(Rp
)(VR
)=
−RTpV
= −1.
In fact if we have any function f (x , y , z) = 0, then(∂x∂y
)(∂y∂z
)(∂z∂x
)= −1
Partial derivatives do not behave as fractions.Although we can write down expressions like df = . . .
We can NEVER write down ∂f = . . ..
P1 2017 28 / 39
1.4 Total and partial differentials
P1 2017 29 / 39
The total differential
A differential is a different from a derivative.
Suppose that we have a continuous function f (x , y) in some region, andboth (∂f /∂x) and (∂f /∂y) are continuous in that region.
The differential tells one by how much the value of the function changesas one moves infinitesimal amounts dx and dy in the x- and y -directions.
The total or perfect differential of f (x , y)
df =∂f∂x
dx +∂f∂y
dy
P1 2017 30 / 39
Explanation (Proof in the notes)
For changes δx and δy the smallchange in f is
δf = f (x +δx , y +δy)− f (x , y) .
Make the move in two steps —one keeping y fixed, the otherkeeping x fixed.
Function surface
dxfx
dyfy
x x+dx
y
y
x
f
f
f+df
y+dy
The small change in f along x is (∂f /∂x)δx .But! The step over δy is made at x + δx not x .In the limit the correction becomes negligible.
The total or perfect differential sums the partial differentials
df =∂f∂x
dx +∂f∂y
dy
P1 2017 31 / 39
[**] Taylor’s expansion in 2 variables to 1st order
Note that our expression for df is EXACT in the limit as dx and dytend to zero.
If δx and δy are just small rather than infinitesimally small then
δf ≈ ∂f∂xδx +
∂f∂yδy .
Recalling the expression for Taylor’s series in one variable, you may spotthat this is a Taylor’s expansion to 1st order in two variables.In other words
f (x + δx , y + δy) ≈ f (x , y) +∂f∂xδx +
∂f∂yδy .
P1 2017 32 / 39
[**] Taylor expansion in 2 variable to higher order
We might as well see how it continues!f (x + δx , y + δy)
≈ f (x , y)
1st order: +∂f∂xδx +
∂f∂yδy
2nd order: +12!
[(∂2f∂x2
)(δx)2 + 2
(∂2f∂x∂y
)(δx)(δy) +
(∂2f∂y2
)(δy)2
]higher orders: + . . . think binomial . . .
P1 2017 33 / 39
♣ Example
Q: A material with a temperature coefficient of α is made into a block ofsides x , y , z measured at some temperature T . The temperature israised by a finite δT . (a) Derive the new volume of the block.A:
V + δV = x(1+ αδT )y(1+ αδT )z(1+ αδT ) = V (1+ αδT )3 .
Q: (b) Now let δT → dT and find the change using the total differential.A: The volume of the block is V = xyz .
dV = yzdx + xzdy + xydz= yzx(αdT ) + xzy(αdT ) + xyz(αdT )
= 3VαdT⇒V + dV = V (1+ 3αdT ) .
This is exact in the limit as dT tends to zero.
P1 2017 34 / 39
When is an expression a total differential?Suppose we are given some expression p(x , y)dx + q(x , y)dy .Is it total differential of some function f (x , y)?Now, if it is,
df = p(x , y)dx + q(x , y)dy .
But then we must have that
p(x , y) =∂f∂x
and q(x , y) =∂f∂y
and using fxy = fyx
∂
∂yp(x , y) =
∂2f∂y∂x
=∂
∂xq(x , y) =
∂2f∂x∂y
The t.d. test: p(x , y)dx + q(x , y)dy is a total differential when
∂p∂y
=∂q∂x
.
P1 2017 35 / 39
Example
♣ Example.Q: Show that there is NO function having continous second partialderivatives whose total differential is xydx + 2x2dy .
A: We know that p(x , y)dx + q(x , y)dy is a total differential iff
∂p∂y
=∂q∂x
.
Set p = xy and q = 2x2. Then
∂p∂y
= x 6= ∂q∂x
= 4x .
Clang.
P1 2017 36 / 39
Recovering the function from its total differential
Suppose we found p(x , y)dx + q(x , y)dy to be total differential using theabove test. Could we recover the function f ?
To recover f we must perform the reverse of partial differentiation.As ∂f /∂x = p(x , y):
f =
∫p(x , y)dx + g(y) + K1
where g is a function of y alone and K1 is a constant.
Similarly,
f =
∫q(x , y)dy + h(x) + K2
We now need to resolve the two expressions for f , and this is possible, upto a constant K , as the following example shows.
P1 2017 37 / 39
♣ Eg: f is xy3 + sin x sin y + 6y + 10 — but pretend we don’t know it.
Q: Is this a perfect differential, and if so of what function f (x , y)?
(y3 + cos x sin y)dx + (3xy2 + sin x cos y + 6)dy
A: Using the ∂p/∂y = ∂q/∂x test ...∂
∂y(y3 + cos x sin y) = 3y2 + cos x cos y
∂
∂x(3xy2 + sin x cos y + 6) = 3y2 + cos x cos y
SAME! so it is a perfect differential. Integrating and resolving:
From∂f /∂x : f = y3x + sin x sin y + + g(y) + K1l l l l
From∂f /∂y : f = xy3 + sin x sin y + h(x) + 6y + K2
Sof = xy3 + sin x sin y + 6y + K1 .
We’d need an extra piece of info to recover K1.
P1 2017 38 / 39
Round-up
The differentialdf =
∂f∂x
dx +∂f∂y
dy
is the value through which a function changes as one moves infinitesimalamounts dx and dy in the x− and y−directions.
Given p(x , y)dx + q(x , y)dyTest whether: ∂p/∂y = ∂q/∂x . If good:Integrate p(x , y) wrt x , remembering g(y) is a const ofintegrationIntegrate q(x , y) wrt y , remembering h(x) is a const ofintegrationResolve the two expressions.
P1 2017 39 / 39
Summary
In this lecture we have1.1 Extended notions of Continuity and limits to functions of more than
one variable1.2 Defined Partial derivatives and discussed higher partial derivatives1.3 Been told in no uncertain terms that partial derivatives are not
fractions1.4 Introduced the total or perfect differential as the sum of partial
differentials
Please noteDerivatives are different from differentials.That δ is different from d is different from ∂. Use them properly!