P1 2017 1 / 39 P1 Calculus II Partial Differentiation & Multiple Integration Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/1pd 4 lectures, MT 2017
P1 2017 2 / 39 Motivation So far in your explorations of the differential and integral calculus, you have considered only functions of one variable This comes naturally to you... d dx ( ln ( cosh ( sin 1 ( 1 1 x )))) : x > 1 and x (x 2 + 1) n dx. But you do not have to look too hard to find quantities which depend on more than one independent variable
P1 2017 3 / 39 News, good and... This lecture course explains how to extend the calculus to to multiple independent variables. There s good news Most changes kick in going from one to two independant variables...... so usually two will do f = f (x, y). And even better news Whereas calculus in 1 variable can feel somewhat mechanistic...... now you really have to think!
P1 2017 4 / 39 Course Contents The material splits into four topics to be covered over the four lecture slots. 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 variable 1.2 Partial derivatives 1.3 A cautionary tale: partial derivatives are not fractions 1.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 at x = a if, for every positive number ɛ (however small), one can find a neighbourhood x a < η f(a) f(x) <ε <ε in which η η x f (x) f (a) < ɛ. a Two useful facts about continuous functions are: The sum, difference and product of two continuous functions is continuous. The quotient of two continuous functions is continous at every point where the denominator is not zero.
P1 2017 11 / 39 Revision of single variable derivative The total derivative is defined as f(x+ δx) [ ] df f (x + δx) f (x) dx = lim. δx 0 δx f(x) f (x) is differentiable if this limit exists, and exists independent of how δx 0. x δx x+ δx Tends to tangent as δx tends to zero δf= f(x+ δx) f(x) Note that A differentiable function is continuous. A continuous function is not necessarily differentiable. f (x) = x is an 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 > 1 variables. So for much of the time we can deal with functions of only two variables eg, f (x, y). f (x, y) is conveniently represented as a surface, as opposed to a plane curve for a one variable function. 20 1 10 0.5 f(x,y) 0 f(x,y) 0 10 0.5 20 5 0 y 5 4 2 x 0 2 4 1 5 0 5 4 (x + y)(x y) exp[ (x 2 + y 2 )/10] sin(2x) cos(4y) y 2 x 0 2 4
P1 2017 13 / 39 Continuity for functions of several variables Function f (x, y) is continuous at a point (a, b) in R if, for every positive number ɛ (however small), it is possible to find a positive η such that Then f(x,y) f(a,b) x ε ε y project onto surface circle, radius at (x,y)=(a,b) f (x, y) f (a, b) < ɛ for all points (x a) 2 + (y b) 2 < η 2 lim f (x, y) = f (a, b). (x,y) (a,b) Note that for functions of more variables f (x 1, x 2, x 3,...) the neighbourhood would be defined by (x 1 a) 2 + (x 2 b) 2 + (x 3 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 direction you move off in! We have to think about slope in a particular direction. The obvious directions are those along 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: ( ) [ ] f f (x + δx, y) f (x, y) f x = = lim x δx 0 δx y
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 (x 1, x 2, x 3,...) we have The partial derivative again... ( ) [ ] f f (x1, x 2, x 3 + δx 3, x 4,...) f (x 1, x 2, x 3, x 4,...) = lim x 3 δx 3 0 δx 3 x 1 x 2 x 4... Given that you know the list of the variables, and know the one being varied, the held constant subscripts are superfluous and are often omitted.
P1 2017 17 / 39 Geometrical interpretation of the partial derivative f(x,y) y = constant plane f Slope is f x y x y x f(x,y) x = constant plane f Slope is f y x x y y
P1 2017 18 / 39 The mechanics of evaluating partial derivatives Operationally, partial differentiation is exactly the same as normal differentiation with respect to one variable, with all the others treated as constants. Example Suppose First assume y is a constant: f (x, y) = x 2 y 3 2y 2 Then x is a constant: f x = 2xy 3 f y = 3x 2 y 2 4y
P1 2017 19 / 39 Examples Example Find the 1st partial derivatives of f (x, y) = e (x 2 +y 2) sin(xy 2 ) f x f y = e (x 2 +y 2) [ 2x sin(xy 2 ) + y 2 cos(xy 2 )] = e (x 2 +y 2) [ 2y sin(xy 2 ) + 2xy cos(xy 2 )] Example If f (x, y) = ln(xy), find the product ( ) ( ) f f in terms of f. x y f (x, y) = ln(x) + ln(y) f x = 1/x and f y = 1/y ( ) ( ) f f = 1/xy = e f (x,y). x y
P1 2017 20 / 39 Higher partial derivatives f / x and f / y are probably perfectly good functions of (x, y), so we can differentiate again. Example. f (x, y) = x 2 y 3 2y 2 f / x = 2xy 3 f / y = 3x 2 y 2 4y 2 f x 2 = x f x = f xx Hence 2 f / x 2 = 2y 3 2 f / y 2 = 6x 2 y 4. But we should also consider ( ) f = 2 f y x y x = 6xy 2 and ( ) f = 2 f x y x y = 6xy 2.
P1 2017 21 / 39 Higher partial derivatives f / x and f / y are probably perfectly good functions of (x, y), so we can differentiate again. Example. f (x, y) = x 2 y 3 2y 2 f / x = 2xy 3 f / y = 3x 2 y 2 4y 2 f x 2 = x f x = f xx Hence 2 f / x 2 = 2y 3 2 f / y 2 = 6x 2 y 4. But we should also consider ( ) f = 2 f y x y x = 6xy 2 and ( ) f = 2 f x y x y = 6xy 2. Oooo! 2 f x y = 2 f is that always true? y x
P1 2017 22 / 39 A more complicated random example f (x, y) = e (x 2 +y 2) sin(xy 2 ) f x = e (x 2 +y 2) [ 2x sin(xy 2 ) + y 2 cos(xy 2 )] f y = e (x 2 +y 2) [ 2y sin(xy 2 ) + 2xy cos(xy 2 )] f yx = e (x 2 +y 2) [ 4x 2 y cos() + 2y cos() 2y 3 x sin() 2y[ 2x sin() + y 2 cos()]] = e (x 2 +y 2) [sin()[ 2y 3 x + 4xy] + cos()[ 4x 2 y + 2y 2y 3 ]] and f xy = e (x 2 +y 2) [ 2y 3 cos() + 2y cos() 2xy 3 sin() 2x[ 2y sin() + 2xy cos()]] = e (x 2 +y 2) [sin()[ 2xy 3 + 4xy] + cos()[ 2y 3 + 2y 4x 2 y]] 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 [ (y 5 + xy) cosh(cosh(x 2 + 1/x)) + y 2 tx ]. t y x 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-like qualities... Example. Given y = u 1/3, u = v 3 and v = x 2, find dy/dx. dy dx = dy du du dv dv dx = 1 3 u 2/3 3v 2 2x = 2x = 1 3 which you can check by finding y = x 2 explicitly. 1 v 2 3v 2 2x = 2x
P1 2017 26 / 39 This is NOT the case for partials Example. Given the perfect gas law pv = RT, determine the product ( ) p V ( ) V T ( ) 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 = RT V, V = RT p Thus ( ) ( ) ( ) ( p V T RT = V T p V 2, and T = Vp R. ) ( ) ( ) R V = RT p R pv = 1. In fact if we have any function f (x, y, z) = 0, then ( ) ( ) ( ) x y z = 1 y z x 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, and both ( f / x) and ( f / y) are continuous in that region. The differential tells one by how much the value of the function changes as one moves infinitesimal amounts dx and dy in the x- and y-directions. The total or perfect differential of f (x, y) df = f f dx + x y dy
P1 2017 30 / 39 Explanation (Proof in the notes) For changes δx and δy the small change in f is f Function surface y δf = f (x + δx, y + δy) f (x, y). Make the move in two steps one keeping y fixed, the other keeping x fixed. f+df f y+dy y f y f x dy dx 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. x x+dx x The total or perfect differential sums the partial differentials df = f f dx + x 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 dy tend to zero. If δx and δy are just small rather than infinitesimally small then δf f f δx + x y δy. Recalling the expression for Taylor s series in one variable, you may spot that this is a Taylor s expansion to 1st order in two variables. In other words f (x + δx, y + δy) f (x, y) + f f δx + x 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 f δx + x y δy [( 2 f x 2 2nd order: + 1 2! ) (δx) 2 + 2 higher orders: +... think binomial... ( 2 ) ( f 2 ) ] f (δx)(δy) + x y y 2 (δy) 2
P1 2017 33 / 39 Example Q: A material with a temperature coefficient of α is made into a block of sides x, y, z measured at some temperature T. The temperature is raised 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 f xy = f yx p(x, y) = 2 f y y x = q(x, y) = 2 f x 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 partial derivatives whose total differential is xydx + 2x 2 dy. 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 = 2x 2. Then Clang. p y = x q x = 4x.
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 the above 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) + K 1 where g is a function of y alone and K 1 is a constant. Similarly, f = q(x, y)dy + h(x) + K 2 We now need to resolve the two expressions for f, and this is possible, up to a constant K, as the following example shows.
P1 2017 37 / 39 Eg: f is xy 3 + 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)? (y 3 + cos x sin y)dx + (3xy 2 + sin x cos y + 6)dy A: Using the p/ y = q/ x test... y (y 3 + cos x sin y) = 3y 2 + cos x cos y x (3xy 2 + sin x cos y + 6) = 3y 2 + cos x cos y SAME! so it is a perfect differential. Integrating and resolving: From f / x : f = y 3 x + sin x sin y + + g(y) + K 1 From f / y : f = xy 3 + sin x sin y + h(x) + 6y + K 2 So f = xy 3 + sin x sin y + 6y + K 1. We d need an extra piece of info to recover K 1.
P1 2017 38 / 39 Round-up The differential df = f f dx + x y dy is the value through which a function changes as one moves infinitesimal amounts dx and dy in the x and y directions. Given p(x, y)dx + q(x, y)dy Test whether: p/ y = q/ x. If good: Integrate p(x, y) wrt x, remembering g(y) is a const of integration Integrate q(x, y) wrt y, remembering h(x) is a const of integration Resolve the two expressions.
P1 2017 39 / 39 Summary In this lecture we have 1.1 Extended notions of Continuity and limits to functions of more than one variable 1.2 Defined Partial derivatives and discussed higher partial derivatives 1.3 Been told in no uncertain terms that partial derivatives are not fractions 1.4 Introduced the total or perfect differential as the sum of partial differentials Please note Derivatives are different from differentials. That δ is different from d is different from. Use them properly!