<<

Vector Fields Which Are

Learning Goals: students can identify vector fields which are the of some , and reconstruct such a function.

Let’s say we have a vector G: Rn → Rn. When is it the gradient of some function f(x)?

It turns out that the easiest way to tell if G is a gradient is to try to “ungradient” it. If you can, it was a gradient and if you can’t it wasn’t. Let’s try:

Example: find a function whose gradient is (2xy, x2 – w, z + sin(w), –y + z cos(w) + 4). Solution: if there is such a function f, we know ∂f / ∂x = 2xy. So antidifferentiating with respect to x yields x2y + C. Don’t forget your +C! Especially because this C isn’t really a constant. We need something whose with respect to x is zero, but that might include y, z, and w as 2 variables. So really we should write f(x, y, z, w) = x y + C1(y, z, w). Now C1 is still an unknown function, but we have a lot of other things that have to . For example, ∂f / ∂y = x2 – w. So 2 2 differentiating our function we get x + ∂C1/ ∂y = x – w. Thus ∂C1 / ∂y = –w. Sure am glad we didn’t make that +C a constant! Antidifferentiating, we get C1(y, z, w) = –yw + C2(z, w). Note that it can’t have any x’s in it, because C1 doesn’t depend on x—it is a function of y, z, and w 2 only. So now we have f(x, y, z, w) = x y – yw + C2(z, w).

We still have to match the z and w . So differentiate with respect to z and we learn 2 that ∂C2 / ∂z = z + sin(w). Antidifferentiating this gives C2(z, w) = z / 2 + z sin(w) + C3(w). So 2 2 we add this in: f(x, y, z, w) = x y – yw + z / 2 + z sin(w) + C3(w). Our final step is to check that this matches the w derivative: ∂f / ∂w = –y + z cos(w) + ∂C3 / ∂w = –y + z cos(w) + 4. So obviously ∂C3 / ∂w = 4 and C3(w) = 4w + C—it really is a constant this time since we’ve run out of variables!—and our final f is f(x, y, z, w) = x2y – yw + z2 / 2 + z sin(w) + 4w + C.

Though tedious, this methodical approach is probably the best way to determine whether or not a vector field is a gradient. We will investigate the theory behind when it works, but this is one case where the brute technique gets you the answer faster than going through the theoretical concepts.

So is every vector field a gradient?

Example: Consider G(x, y, z) = (–y, x, 0). What is this the gradient of? Solution: Let’s start the same way. ∂f / ∂x = –y, so f = –yx + C1(y, z). Differentiating this with respect to y gives ∂f / ∂y = –x + ∂C1 / ∂y = x or ∂C1(y, z) / ∂y = 2x. This is a problem, because the left side does not depend on x, which the right side does. That is, there is no function of just y and z whose derivative is 2x. We can actually stop here. Since there is no way to match both the x and y derivatives simultaneously, it doesn’t really matter if we can get z to work or not. This vector field is not the gradient of any function.

Geometrically, this makes perfect sense. This vector field is just a three-dimensional version of the uniform circular motion, so lines are circles. Think about that for a moment. If there was a function f whose gradient was G, as you move around the circular flow line you are always moving in the direction of ∇f. That means as you move, f is constantly increasing—including when you move all the way around the circle back to where you started. That can’t be possible, that you kept increasing f and ended up back where you started, so there can’t be any such f—G is not a gradient.

Is there a simple way we can know in advance, without having to do all the antidifferentiations in the middle, that some long complicated vector will or won’t be a gradient? Yes and no. As I said, in general the best way to find out if something is a gradient is to try to find f and either you succeed or your fail. The theoretical way to tell takes more effort than just trying it. But here it is: mixed partials must be equal.

2 That is, let G = ∇f. So G = (g1, g2, …, gn). Now ∂g1 / ∂x2 = ∂ / ∂x2 (∂f / ∂x1) = ∂ f / ∂x2∂x1. But 2 as long as f is nice, its mixed partials are equal, so this must equal ∂ f / ∂x1∂x2 = ∂ / ∂x1 (∂f / ∂x2) = ∂g2 / ∂x1.

Example: For the problem in the second example, we see that ∂g1 / ∂y = –1, while ∂g2 / ∂x = 1. since these aren’t equal, these couldn’t have been two of the first partial derivatives of any f, so this vector field can’t be a gradient.

Example: for the first example, we check all the various partials: ∂g1 / ∂y = 2x = ∂g2 / ∂x, ∂g1 / ∂z = 0 = ∂g3 / ∂x, ∂g1 / ∂w = 0 = ∂g4 / ∂x. Then ∂g2 / ∂z = 0 = ∂g3 / ∂y while both ∂g2 / ∂w and ∂g4 / ∂y = –1. Finally, ∂g3 / ∂w = cos(w) = ∂g4 / ∂z. So this one does work out.

Now you see the disadvantage to the theoretical way of checking: it takes a lot longer. Here we had to check six ( = 4 choose 2) pairs of derivatives, instead of just working through four antiderivative problems. The theoretical way has the slight advantage of telling you exactly which pieces of the function are causing the problems, but has the disadvantages that it takes more work (n2 – n derivatives to check in pairs) and if they all match properly you still don’t have the actual function unless you do the antiderivative problems anyway. The antiderivatives won’t tell you exactly which pieces are giving you a problem (though the first time you can’t solve because a variable shows up on one side of the equation and not the other indicates that the piece you are working on, together with at least one of the earlier pieces, is what is causing the problem).

Question: did I ever actually say that if all the pairs of mixed partials match up, then the vector field actually is a gradient—that is, if you check the theoretical way and it doesn’t appear to have a problem, then it really doesn’t have one? Answer: no, I did not! But I might as well:

Theorem: a vector field G = (g1, g2, …, gn) is a gradient of some function if and only each pair of derivatives ∂gi / ∂xj = ∂gj / ∂xi.

Proof: the “only if” part is obvious—if G = ∇f then the mixed partials of f are equal. The ‘if” part of the proof will have to wait for about seven weeks. So we’re back to me owing you a proof.