Week 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Math S21a: Multivariable calculus

Oliver Knill, Summer 2012

Lecture 9: Partial derivatives


If f (x, y) is a function of two variables, then x f (x, y) is dened as the derivative of the function g(x) = f (x, y), where y is considered a constant. It is called partial derivative of f with respect to x. The partial derivative with respect to y is dened similarly.

We also use the short hand notation fx (x, y) = similar: for example fxy = x y f .

f (x, y). x

For iterated derivatives, the notation is

The notation for partial derivatives x f, y f were introduced by Carl Gustav Jacobi. Josef Lagrange had used the term partial dierences. Partial derivatives fx and fy measure the rate of change of the function in the x or y directions. For functions of more variables, the partial derivatives are dened in a similar way.

For f (x, y) = x4 6x2 y 2 + y 4 , we have fx (x, y) = 4x3 12xy 2, fxx = 12x2 12y 2, fy (x, y) = 12x2 y + 4y 3, fyy = 12x2 + 12y 2 and see that fxx + fyy = 0. A function which satises this equation is also called harmonic. The equation fxx + fyy = 0 is an example of a partial dierential equation: it is an equation for an unknown function f (x, y) which involves partial derivatives with respect to more than one variables. Clairots theorem If fxy and fyx are both continuous, then fxy = fyx .

Proof: we look at the equations without taking limits rst. We extend the denition and say that a background Planck constant h is positive, then fx (x, y) = [f (x + h, y) f (x, y)]/h. For h = 0 we dene fx as before. Compare the two sides for xed h > 0: hfx (x, y) = f (x + h, y) f (x, y) dyfy (x, y) = f (x, y + h) f (x, y). 2 h fxy (x, y) = f (x + h, y + h) f (x + h, y + h2 fyx (x, y) = f (x + h, y + h) f (x + h, y) (f (x, y + h) f (x, y)) h) (f (x + h, y) f (x, y)) We have not taken any limits in this proof but established an identity which holds for all h > 0, the discrete derivatives fx , fy satisfy the relation fxy = fyx . We could fancy the identity obtained in the proof as a quantum Clairot theorem. If the classical derivatives fxy , fyx are both continuous, we can take the limit h 0 to get the classical Clairots theorem as a classical limit. Note that the quantum Clairot theorem shown rst in this proof holds for any functions f (x, y) of two variables. We do not even need continuity.

2 3

Find fxxxxxyxxxxx for f (x) = sin(x) + x6 y 10 cos(y). Answer: Do not compute, but think. The continuity assumption for fxy is necessary. The example f (x, y) = contradicts Clairauts theorem: x3 y xy 3 x2 + y 2

fx (x, y) = (3x2 y y 3)/(x2 + y 2) 2x(x3 y xy 3 )/(x2 +y 2 )2 , fx (0, y) = y, fxy (0, 0) = 1,

fy (x, y) = (x3 3xy 2 )/(x2 + y 2) 2y(x3 y xy 3 )/(x2 + y 2 )2 , fy (x, 0) = x, fy,x (0, 0) = 1.

An equation for an unknown function f (x, y) which involves partial derivatives with respect to at least two dierent variables is called a partial dierential equation. If only the derivative with respect to one variable appears, it is called an ordinary dierential equation. Here are some examples of partial dierential equations. You should know the rst 4 well.

4 5 6 7 8 9

The wave equation ftt (t, x) = fxx (t, x) governs the motion of light or sound. The function f (t, x) = sin(x t) + sin(x + t) satises the wave equation. The heat equation ft (t, x) = fxx (t, x)
1 e t x2 /(4t)

describes diusion of heat or spread of an episatises the heat equation.

demic. The function f (t, x) =

The Laplace equation fxx + fyy = 0 determines the shape of a membrane. The function f (x, y) = x3 3xy 2 is an example satisfying the Laplace equation. The advection equation f (t, x) = e
(x+t)2

ft = fx is used to model transport in a wire. The function

satisfy the advection equation.

2 2 The eiconal equation fx + fy = 1 is used to see the evolution of wave fronts in optics.

The function f (x, y) = cos(x) + sin(y) satises the eiconal equation. The Burgers equation ft + f fx = fxx describes waves at the beach which break. The 1 x2 /(4t) e t function f (t, x) = x 1 x2 /(4t) satises the Burgers equation. t
1+
t

10 11

The KdV equation The function f (t, x) =

ft + 6f fx + fxxx = 0
a2 2

models water waves in a narrow channel.

cosh2 ( a (x a2 t)) satises the KdV equation. 2


i h f 2m xx
2

The Schrdinger equation ft = o


h

is used to describe a quantum particle of mass

Here are the graphs of the solutions of the equations. Can you match them with the PDEs?

o m. The function f (t, x) = ei(kx 2m k t) solves the Schrdinger equation. [Here i2 = 1 is 34 the imaginary i and h is the Planck constant h 10 Js.]

Notice that in all these examples, we have just given one possible solution to the partial dierential equation. There are in general many solutions and only additional conditions like initial or boundary conditions determine the solution uniquely. If we know f (0, x) for the Burgers equation, then the solution f (t, x) is determined. A course on partial dierential equations would show you how to get the solution. Paul Dirac once said: A great deal of my work is just playing with equations and seeing what they give. I dont suppose that applies so much to other physicists; I think its a peculiarity of myself that I like to play about with equations, just looking for beautiful mathematical relations which maybe dont have any physical meaning at all. Sometimes they do. Dirac discovered a PDE describing the electron which is consistent both with quantum theory and special relativity. This won him the Nobel Prize in 1933. Diracs equation could have two solutions, one for an electron with positive energy, and one for an electron with negative energy. Dirac interpreted the later as an antiparticle: the existence of antiparticles was later conrmed. We will not learn here to nd solutions to partial dierential equations. But you should be able to verify that a given function is a solution of the equation.

Homework
1 Verify that f (t, x) = cos(cos(t + x)) is a solution of the transport equation ft(t, x) = fx (t, x). 2 Verify that f (x, y) = 6y 2 + 2x3 satises the Euler-Tricomi partial dierential equation uxx = xuyy . This PDE is useful in describing transonic ow. Can you nd an other solution which is not a multiple of the solution given in this problem?

3 Verify that f (x, t) = ert sin(x + ct) satises the driven transport equation ft (x, t) = cfx(x, t) rf (x, t) It is sometimes also called the advection equation. 4 The partial dierential equation fxx + fyy = ftt is called the wave equation in two dimensions. It describes waves in a pool for example. a) Show that if f (x, y, t) = sin(nx+my) sin( n2 + m2t) satises the wave equation. It describes waves in a square where x [0, ] and y [0, ]. The waves are zero at the boundary of the pool. b) Verify that if we have two such solutions with dierent n, m then also the sum is a solution. c) For which k is f (x, y, t) = sin(nx) cos(nt) + sin(mx) cos(mt) + sin(nx + my) cos(kt) a solution of the wave equation? Verify that the wave is periodic in time f (x, y, t + 2) = f (x, y, t) if m2 + n2 = k 2 is a Pythagorean triple.

5 The partial dierential equation ft +f fx = fxx is called Burgers equation and describes waves at the beach. In higher dimensions, it leads to the Navier Stokes equation which are used to describe the weather. Verify that the function

f (t, x)

2 1 3/2 x 4t xe t 2 1 x e 4t + 1 t

is a solution of the Burgers equation. Remark. This calculation needs perseverance, when done by hand. You are welcome to use technology if you should get stuck. Here is an example on how to check that a function is a solution of a partial dierential equation in Mathematica: f[t_,x_]:=(1/Sqrt[t])*Exp[-x^2/(4t)]; Simplify[ D[f[t,x],t] == D[f[t,x],{x,2}]] and here is the function

f[t, x] := (1/t)^(3/2)*x*Exp[-(x^2)/(4 t)]/((1/t)^(1/2)*

Math S21a: Multivariable calculus

Oliver Knill, Summer 2012

Lecture 10: Linearization


In single variable calculus, you have seen the following denition: The linear approximation of f (x) at a point a is the linear function L(x) = f (a) + f (a)(x a) .

y Lx

y f x

The graph of the function L is close to the graph of f at a. We generalize this now to higher dimensions: The linear approximation of f (x, y) at (a, b) is the linear function L(x, y) = f (a, b) + fx (a, b)(x a) + fy (a, b)(y b) . The linear approximation of a function f (x, y, z) at (a, b, c) is L(x, y, z) = f (a, b, c) + fx (a, b, c)(x a) + fy (a, b, c)(y b) + fz (a, b, c)(z c) . Using the gradient f (x, y) = fx , fy , f (x, y, z) = fx , fy , fz ,

the linearization can be written more compactly as L(x) = f (x0 ) + f (a) (x a) . How do we justify the linearization? If the second variable y = b is xed, we have a one-dimensional situation, where the only variable is x. Now f (x, b) = f (a, b) + fx (a, b)(x a) is the linear approximation. Similarly, if x = x0 is xed y is the single variable, then f (x0 , y) = f (x0 , y0 ) + fy (x0 , y0 )(y y0 ). Knowing the linear approximations in both the x and y variables, we can get the general linear approximation by f (x, y) = f (x0 , y0 ) + fx (x0 , y0 )(x x0 ) + fy (x0 , y0 )(y y0 ).

1 2

What is the linear approximation of the function f (x, y) = sin(xy 2) at the point (1, 1)? We have (fx (x, y), yf (x, y) = (y 2 cos(xy 2 ), 2y cos(xy 2 )) which is at the point (1, 1) equal to f (1, 1) = cos(), 2 cos() = , 2 . Linearization can be used to estimate functions near a point. In the previous example, 0.00943 = f (1+0.01, 1+0.01) L(1+0.01, 1+0.01) = 0.0120.01+3 = 0.00942 .

Here is an example in three dimensions: nd the linear approximation to f (x, y, z) = xy + yz + zx at the point (1, 1, 1). Since f (1, 1, 1) = 3, and f (x, y, z) = (y + z, x + z, y + x), f (1, 1, 1) = (2, 2, 2). we have L(x, y, z) = f (1, 1, 1) + (2, 2, 2) (x 1, y 1, z 1) = 3 + 2(x 1) + 2(y 1) + 2(z 1) = 2x + 2y + 2z 3. Estimate f (0.01, 24.8, 1.02) for f (x, y, z) = ex yz. Solution: take (x0 , y0 , z0 ) = (0, 25, 1), where f (x0 , y0 , z0 ) = 5. The gradient is f (x, y, z) = (ex yz, ex z/(2 y), ex y). At the point (x0 , y0 , z0 ) = (0, 25, 1) the gradient is the vector (5, 1/10, 5). The linear approximation is L(x, y, z) = f (x0 , y0 , z0 ) + f (x0 , y0 , z0 )(x x0 , y y0 , z z0 ) = 5 + (5, 1/10, 5)(x 0, y 25, z 1) = 5x + y/10 + 5z 2.5. We can approximate f (0.01, 24.8, 1.02) by 5 + (5, 1/10, 5) (0.01, 0.2, 0.02) = 5 + 0.05 0.02 + 0.10 = 5.13. The actual value is f (0.01, 24.8, 1.02) = 5.1306, very close to the estimate. Find the tangent line to the graph of the function g(x) = x2 at the point (2, 4). Solution: the level curve f (x, y) = y x2 = 0 is the graph of a function g(x) = x2 and the tangent at a point (2, g(2)) = (2, 4) is obtained by computing the gradient a, b = f (2, 4) = g (2), 1 = 4, 1 and forming 4x + y = d, where d = 4 2 + 1 4 = 4. The answer is 4x + y = 4 which is the line y = 4x 4 of slope 4. The Barth surface is dened as the level surface f = 0 of f (x, y, z) = (3 + 5t)(1 + x2 + y 2 + z 2 )2 (2 + t + x2 + y 2 + z 2 )2 + 8(x2 t4 y 2 )((t4 x2 ) + z 2 )(y 2 t4 z 2 )(x4 2x2 y 2 + y 4 2x2 z 2 2y 2z 2 + z 4 ) , where t = ( 5 + 1)/2 is a constant called the golden ratio. If we replace t with 1/t = ( 5 1)/2 we see the surface to the middle. For t = 1, we see to the right the surface f (x, y, z) = 8. Find the tangent plane of the later surface at the point (1, 1, 0). Answer: We have f (1, 1, 0) = 64, 64, 0 . The surface is x + y = d for some constant d. By plugging in (1, 1, 0) we see that x + y = 2.

The quartic surface f (x, y, z) = x4 x3 + y 2 + z 2 = 0 is called the piriform. What is the equation for the tangent plane at the point P = (2, 2, 2) of this pair shaped surface? We get a, b, c = 20, 4, 4 and so the equation of the plane 20x + 4y + 4z = 56, where we have obtained the constant to the right by plugging in the point (x, y, z) = (2, 2, 2).

Remark: some books use dierentials etc to describe linearizations. This is 19 century notation and terminology and should be avoided by all means. For us, the linearlization of a function at a point is a linear function in the same number of variables. 20th century mathematics has invented the notion of dierential forms which is a valuable mathematical notion, but it is a concept which becomes only useful in follow-up courses which build on multivariable calculus like Riemannian geometry. The notion of dierentials comes from a time when calculus was still foggy in some areas. Unfortunately it has survived and appears even in some calculus books.

Homework
1 If 2x+3y +2z = 9 is the tangent plane to the graph of z = f (x, y) at the point (1, 1, 2). Extimate f (1.01, 0.98). 2 Estimate 10001/5 using linear approximation 3 Find f (0.01, 0.999) for f (x, y) = cos(xy)y + sin(x + y). 4 Find the linear approximation L(x, y) of the function

f (x, y) = 10 x2 5y 2 at (2, 1) and use it to estimate f (1.95, 1.04).


5 Sketch a contour map of the function

f (x, y) = x2 + 9y 2 nd the gradient vector f = fx , fy of f at the point (1, 1). Draw it together with the tangent line ax + by = d to the curve at (1, 1).

Math S21a: Multivariable calculus

Oliver Knill, Summer 2012

Lecture 11: Chain rule


If f and g are functions of one variable t, the single variable chain rule tells us that d/dtf (g(t)) = f (g(t))g (t). For example, d/dt sin(log(t)) = cos(log(t))/t. It can be proven by linearizing the functions f and g and verifying the chain rule in the linear case. The chain rule is also useful: For example, to nd arccos (x), we write 1 = d/dx cos(arccos(x)) = sin(arccos(x)) arccos (x) = 1 sin2 (arccos(x)) arccos (x) = 1 x2 arccos (x) so that arccos (x) = 1/ 1 x2 . Dene the gradient f (x, y) fx (x, y, z), fy (x, y, z), fz (x, y, z) . = fx (x, y), fy (x, y) or f (x, y, z) =

If r(t) is curve and f is a function of several variables we can build a function t f (r(t)) of one variable. Similarly, If r(t) is a parametrization of a curve in the plane and f is a function of two variables, then t f (r(t)) is a function of one variable. The multivariable chain rule is
d f (r(t)) dt

= f (r(t)) r (t).

Proof. When written out in two dimensions, it is d f (x(t), y(t)) = fx (x(t), y(t))x (t) + fy (x(t), y(t))y (t) . dt Now, the identity
f (x(t+h),y(t+h))f (x(t),y(t)) h f (x(t+h),y(t+h))f (x(t),y(t+h)) h f (x(t),y(t+h))f (x(t),y(t)) h

d holds for every h > 0. The left hand side converges to dt f (x(t), y(t)) in the limit h 0 and the right hand side to fx (x(t), y(t))x (t) + fy (x(t), y(t))y (t) using the single variable chain rule twice. Here is the proof of the later, when we dierentiate f with respect to t and y is treated as a constant:

f ( x(t+h) ) f (x(t)) h

[f ( x(t) + (x(t+h)-x(t)) ) f (x(t))] [x(t+h)-x(t)]

[x(t+h)-x(t)] h

Write H(t) = x(t+h)-x(t) in the rst part on the right hand side. [f (x(t) + H) f (x(t))] x(t + h) x(t) f (x(t + h)) f (x(t)) = . h H h As h 0, we also have H 0 and the rst part goes to f (x(t)) and the second factor to x (t).

We move on a circle r(t) = cos(t), sin(t) on a table with temperature distribution f (x, y) = x2 y 3. Find the rate of change of the temperature f (x, y) = (2x, 3y 2 ), r (t) = ( sin(t), cos(t)) d/dtf (r(t)) = T (r(t)) r (t) = (2 cos(t), 3 sin(t)2 ) ( sin(t), cos(t)) = 2 cos(t) sin(t) 3 sin2 (t) cos(t).

From f (x, y) = 0 one can express y as a function of x. From d/df (x, y(x)) = f (1, y (x)) = fx +fy y = 0, we obtain y = fx /fy . Even so, we do not know y(x), we can compute its derivative! Implicit dierentiation works also in three variables. The equation f (x, y, z) = c denes a surface. Near a point where fz is not zero, the surface can be described as a graph z = z(x, y). We can compute the derivative zx without actually knowing the function z(x, y). To do so, we consider y a xed parameter and compute using the chain rule fx (x, y, z(x, y))1 + fz (x, y)zx (x, y) = 0 so that zx (x, y) = fx (x, y, z)/fz (x, y, z).

The surface f (x, y, z) = x2 + y 2/4 + z 2 /9 = 6 is an ellipsoid. Compute zx (x, y) at the point (x, y, z) = (2, 1, 1). Solution: zx (x, y) = fx (2, 1, 1)/fz (2, 1, 1) = 4/(2/9) = 18.

The chain rule is powerful because it implies other dierentation rules like the addition, product and quotient rule in one dimensions: f (x, y) = x+y, x = u(t), y = v(t), d/dt(x+y) = fx u +fy v = u + v . f (x, y) = xy, x = u(t), y = v(t), d/dt(xy) = fx u + fy v = vu + uv . f (x, y) = x/y, x = u(t), y = v(t), d/dt(x/y) = fx u + fy v = u /y v u/v 2. As in one dimensions, the chain rule follows from linearization. If f is a linear function f (x, y) = d ax + by c and if the curve r(t) = x0 + tu, y0 + tv parametrizes a line. Then dt f (r(t)) = d (a(x0 + tu) + b(y0 + tv)) = au + bv and this is the dot product of f = (a, b) with r (t) = (u, v). dt Since the chain rule only refers to the derivatives of the functions which agree at the point, the chain rule is also true for general functions.

Homework
1 You know that d/dtf (r(t)) = 2 if r(t) = t, t and d/dtf (r(t)) = 3 if r(t) = t, t . Find the gradient of f at (0, 0). 2 The pressure in the space at the position (x, y, z) is p(x, y, z) = x2 + y 2 z 3 and the trajectory of an observer is the curve r(t) = t, t, 1/t . Using the chain rule, compute the rate of change of the pressure the observer measures at time t = 2. 3 Mechanical systems can be described by the energy H(x, y), a function of position x and momentum y. The curve r(t) = x(t), y(t) is described by the Hamilton equations.

a) Using the chain rule to verify that the energy of a Hamiltonian system is preserved: for everyr(t) = x(t), y(t) we have H(x(t), y(t)) = const. b) Check the case of the pendulum, where H(x, y) = y 2 /2 sin(x).
4 Derive using implicit dierentiation the derivative d/dx arctanh(x), where tanh(x) = sinh(x)/ cosh(x) .

x(t) = Hy (x, y) y (t) = Hx(x, y)

5 The equation f (x, y, z) = exyz + z = 1 + e implicitly denes z as a function z = g(x, y) of x and y. Find formulas (in terms of x,y and z) for gx(x, y) and gy (x, y). Estimate g(1.01, 0.99) using linear approximation.

The hyperbolic sine and hyperbolic cosine are dened as are sinh(x) = (ex ex )/2 and cosh(x) = (ex + ex)/2. We have sinh = cosh and cosh = sinh and cosh2(x) sinh2(x) = 1.

Math S21a: Multivariable calculus

Oliver Knill, Summer 2012

Lecture 12: Gradient


The gradient of a function f (x, y) is dened as f (x, y) = fx (x, y), fy (x, y) . For functions of three dimensions, we dene f (x, y, z) = fx (x, y, z), fy (x, y, z), fz (x, y, z) . The symbol is spelled Nabla and named after an Egyptian harp. Here is a very important fact: Gradients are orthogonal to level curves and level surfaces.
d Proof. Every curve r(t) on the level curve or level surface satises dt f (r(t)) = 0. By the chain rule, f (r(t)) is perpendicular to the tangent vector r (t). Because n = f (p, q) = a, b is perpendicular to the level curve f (x, y) = c through (p, q), the equation for the tangent line is ax + by = d, a = fx (p, q), b = fy (p, q), d = ap + bq. Compactly written, this is f (x0 ) (x x0 ) = 0

and means that the gradient of f is perpendicular to any vector (x x0 ) in the plane. It is one of the most important statements in multivariable calculus. since it provides a crucial link between calculus and geometry. The just mentioned gradient theorem is also useful. We can immediately compute tangent planes and tangent lines:

Compute the tangent plane to the surface 3x2 y + z 2 4 = 0 at the point (1, 1, 1). Solution: f (x, y, z) = 6xy, 3x2 , 2z . And f (1, 1, 1) = 6, 3, 2 . The plane is 6x+ 3y + 2z = d where d is a constant. We can nd the constant d by plugging in a point and get 6x+3y+2z = 11.

Problem: reect the ray r(t) = 1 t, t, 1 at the surface x4 + y 2 + z 6 = 6 . Solution: r(t) hits the surface at the time t = 2 in the point (1, 2, 1). The velocity vector in that ray is v = 1, 1, 0 The normal vector at this point is f (1, 2, 1) = 4, 4, 6 = n. The reected vector is R(v = 2Projn (v) v . We have Projn (v) = 8/68 4, 4, 6 . Therefore, the reected ray is w = (4/17) 4, 4, 6 1, 1, 0 .

If f is a function of several variables and v is a unit vector then Dv f = f v is called the directional derivative of f in the direction v. The name directional derivative is related to the fact that every unit vector gives a direction. If d d v is a unit vector, then the chain rule tells us dt Dv f = dt f (x + tv).

The directional derivative tells us how the function changes when we move in a given direction. Assume for example that T (x, y, z) is the temperature at position (x, y, z). If we move with velocity v through space, then Dv T tells us at which rate the temperature changes for us. If we move with velocity v on a hilly surface of height h(x, y), then Dv h(x, y) gives us the slope we drive on.

3 4

If r(t) is a curve with velocity r (t) and the speed is 1, then Dr (t) f = f (r(t)) r (t) is the temperature change, one measures at r(t). The chain rule told us that this is d/dtf (r(t)). For v = (1, 0, 0), then Dv f = f v = fx , the directional derivative is a generalization of the partial derivatives. It measures the rate of change of f , if we walk with unit speed into that direction. But as with partial derivatives, it is a scalar. The directional derivative satises |f ||v|| cos()| |f ||v|. |Dv f | |f ||v| because f v =

The direction v = f /|f | is the direction, where f increases most. It is the direction of steepest ascent. If v = f /|f |, then the directional derivative is f f /|f | = |f |. This means f increases, if we move into the direction of the gradient. The slope in that direction is |f |.

You are on a trip in a air-ship over Cambridge at (1, 2) and you want to avoid a thunderstorm, a region of low pressure. The pressure is given by a function p(x, y) = x2 + 2y 2. In which direction do you have to y so that the pressure change is largest? Solution: The gradient p(x, y) = 2x, 4y at the point (1, 2) is 2, 8 . Normalize to get the direction 1, 4 / 17. The directional derivative has the same properties than any derivative: Dv (f ) = Dv (f ), Dv (f + g) = Dv (f ) + Dv (g) and Dv (f g) = Dv (f )g + f Dv (g).

We will see later that points with f = 0 are candidates for local maxima or minima of f . Points (x, y), where f (x, y) = (0, 0) are called critical points and help to understand the function f .

The Matterhorn is a 4478 meter high mountain in Switzerland. It is quite easy to climb with a guide because there are ropes and ladders at dicult places. Evenso there are quite many climbing accidents at the Matterhorn, this does not stop you from trying an ascent. In suitable units on the ground, the height f (x, y) of the Matterhorn is approximated by the function f (x, y) = 4000 x2 y 2. At height f (10, 10) = 3800, at the point (10, 10, 3800), you rest. The climbing route continues into the south-east direction v = 1, 1 / 2. Calculate the rate of change in that direction. We have f (x, y) = 2x, 2y , so that 20, 20 1, 1 / 2 = 40/ 2. This is a place, with a ladder, where you climb 40/ 2 meters up when advancing 1m forward. The rate of change in all directions is zero if and only if f (x, y) = 0: if f = 0, we can choose v = f /|f | and get Df f = |f |.

Assume we know Dv f (1, 1) = 3/ 5 and Dw f (1, 1) = 5/ 5, where v = 1, 2 / 5 and w = 2, 1 / 5. Find the gradient of f . Note that we do not know anything else about the function f . Solution: Let f (1, 1) = a, b . We know a + 2b = 3 and 2a + b = 5. This allows us to get a = 7/3, b = 1/3.

Homework
1 A surface x2+y 2 z = 1 radiates light away. It can be parametrized as r(x, y) = x, y, x2 + y 2 1 . Find the parametrization of the wave front which is distance 1 from the surface. 2 Find the directional derivative Dv f (2, 1) = f (2, 1) v into the direction v = 3, 4 /5 for the function f (x, y) = x5y + y 3 + x + y. 3 Assume f (x, y) = 1 x2 + y 2. Compute the directional derivative Dv (x, y) at (0, 0) where v = cos(t), sin(t) is a unit vector. Now compute Dv Dv f (x, y)

at (0, 0), for any unit vector. For which directions is this second directional derivative positive?
4 The Kitchen-Rosenberg formula gives the curvature of a level curve f (x, y) = c as
2 2 fxx fy 2fxy fx fy + fyy fx = 2 2 (fx + fy )3/2

Use this formula to nd the curvature of the ellipsoid f (x, y) = x2 + 2y 2 = 1 at the point (1, 0). P.S. This formula is known since a hundred years at least but got revived in computer vision. If you want to derive the formula, you can check that the angle g(x, y) = arctan(fy /fx)

of the gradient vector has as the directional derivative in the 2 2 direction v = fy , fx / fx + fy tangent to the curve.
5 One numerical method to nd the maximum of a function of two variables is to move in the direction of the gradient. This is called the steepest ascent method. You start at a point (x0 , y0 ) then move in the direction of the gradient for some time c to be at (x1 , y1 ) = (x0 , y0 ) + cf (x0, y0). Now you continue to get to (x2, y2 ) = (x1, y1) + cf (x1, y1). This works well in many cases like the function f (x, y) = 1 x2 y 2 . It can have problems if the function has a at ridge like in the Rosenbrock function

f (x, y) = 1 (1 x)2 100(y x2)2 . Plot the Contour map of this function on 0.6 x 1, 0.1 y 1.1 and nd the directional derivative at (1/5, 0) in the direc tion (1, 1)/ 2. Why is it also called the banana function?

Math S21a: Multivariable calculus

Oliver Knill, Summer 2012

First hourly: Checklist


The exam starts on Thursday at 8:30 AM sharp in Science Center E. The material is slightly tilted towards the last two weeks but is comprehensive. Look at the previous exams to get an idea. Geometry of Space coordinates in the plane A = (1, 1), B = (2, 4) and in space C = (1, 2, 3), D = (3, 1, 3) vectors in the plane AB = 1, 3 and vectors in space CD = 2, 1, 0 v = v1 , v2 , v3 , w = w1 , w2, w3 , v + w = v1 + w1 , v2 + w2 , v3 + w3 dot product v.w = v1 w1 + v2 w2 + v3 w3 = |v| |w| cos() angle computation cross product, v.(v w) = 0, w.(v w) = 0, |v w| = |v||w| sin() area parallelogram triple scalar product u (v w), volume of parallelepiped parallel vectors v w = 0, orthogonal vectors v w = 0 scalar projection compw (v) = v w/|w| vector projection projw (v) = (v w)w/|w|2 completion of square: example x2 4x + y 2 = 1 is equivalent to (x 2)2 + y 2 = 5 distance d(P, Q) = |P Q| = orthogonal v w = 0, parallel v w = 0 Lines, Planes, Functions parametric equation for plane x = x0 + tv + sw plane ax + by + cz = d parametric equation for line x = x0 + tv symmetric equation of line (xx0 ) = (yy0 ) = zz0 a b c domain and range of functions f (x, y) graph G = {(x, y, f (x, y)) |(x, y) in the domain } intercepts: intersections of G with coordinate axis traces: intersections with coordinate planes generalized traces: intersections with {x = c }, {y = c } or {z = c } quadric: ellipsoid, paraboloid, hyperboloids, cylinder, cone, hyperboloid, paraboloid plane ax + by + cz = d has normal n = a, b, c line (xx0 ) = yy0 = zz0 contains v = (a, b, c) a b c sets g(x, y, z) = c describe surfaces. Examples are graphs g(x, y, z) = z f (x, y) linear equation like 2x + 3y + 5z = 7 denes plane quadratic equation like x2 2y 2 + 3z 2 = 4 denes quadric surface distance point-plane: d(P, ) = |(P Q) n|/|n| distance point-line: d(P, L) = |(P Q) u|/|u| distance line-line: d(L, M) = |(P Q) (u v)|/|u v| (P1 Q1 )2 + (P2 Q2 )2 + (P3 Q3 )2

plane ax + by + cz d through A, B, C: nd normal vector a, b, c = AB CB Curves plane and space curves r(t) line: ax + by = d, r(t) = t, d/b ta/b

circle: x2 + y 2 = r 2 , r(t) = r cos t, r sin t ellipse: x2 /a2 + y 2 /b2 = 1 , r(t) = a cos t, b sin t g(r, ) = 0 polar curve, especially r = f (), polar graphs velocity r (t), acceleration r (t) unit tangent vector T (t) = r (t)/|r (t)| integration: compute r(t) from acceleration r (t) as well as r (0) and r(0) r (t) is tangent to the curve v = r then r = 0t v dt + c, do twice: free fall r(t) = f (t) cos(t), f (t) sin(t) polar curve to polar graph r = f () 0
b a

N(t) = T (t)/|T (t)| normal vector, is perpendicular to T (t) B(t) = T (t) N(t) bi-normal vector, is perpendicular to T and N (t) = |T (t)|/|r (t)| = |r r |/|r |3 curvature Surfaces traces: intersections with coordinate planes, useful to understand g(x, y, z) = c grid curves: keep 1 parameter constant, useful to see parameterizations r(u, v) polar coordinates (x, y) = (r cos(), r sin()) with r 0, 0 2 cylindrical coordinates (x, y, z) = (r cos(), r sin(), z) with r 0 spherical coordinates (x, y, z) = ( cos() sin(), sin() sin(), cos()) with 0 g(r, , z) = 0 cylindrical surface, especially r = f (z, ) or r = f (z), surface of revolution g(, , ) = 0 spherical surface, especially = f (, ) f (x, y) = c level curves of f (x, y), normal vector: a, b = f (x0 , y0) g(x, y, z) = c level surfaces of g(x, y, z), normal vector a, b, c = f (x0 , y0, z0 ) g(x, y, z) = z f (x, y) = 0 write graph as level surface, useful to get normal vector to surface sphere: x2 + y 2 + z 2 = r 2 , r(u, v) = cos u sin v, sin u sin v, cos v ellipsoid: x2 /a2 + y 2 /b2 + z 2 /c2 = 1, r(u, v) = a cos u sin v, b sin u sin v, c cos v cylinder: x2 /a2 + y 2 /b2 = 1, r(u, v) = a cos(u), b sin(u), v plane: ax + by + cz = d , r(u, v) = r0 + uv + v w, a, b, c = v w surface of revolution: x2 + y 2 = f (z)2 , r(u, v) = f (v) cos(u), f (v) sin(u), v example paraboloid: x2 + y 2 = z, r(u, v) = v cos(u), v sin(u), v example cone: x2 + y 2 = z 2 , r(u, v) = v cos(u), v sin(u), v graph: g(x, y, z) = z f (x, y) = 0, r(u, v) = u, v, f (u, v) torus: (r 2)2 + z 2 = 1, r(s, t) = (2 + cos(s)) cos(t), (2 + cos(s)) sin(t), sin(s)

|r (t)| dt arc length of parameterized curve

Homework 3 Coversheet Name:

Maths 21a, Summer 2012

The second week homework is due July 17, 2012. Start working early on the homework! At the end, please copy your HW answers to this cover sheet. This will allow Alex to spend more time reading your arguments and provide feedback.

Homework 3.1
1 2 3 4 5

Homework 3.2
1 2 3 4 5

Homework 3.3
1 2 3 4 5

Homework 3.4
1 2 3 4 5

You might also like