R T 7 R (T) (X (T), y (T), Z (T) )
R T 7 R (T) (X (T), y (T), Z (T) )
E. L. Lady
R2 −
→R
(x, y) 7→f (x, y).
There are also applications, however, where both the argument and the value
of a function are two or three-dimensional. Mostly commonly, we think of the
argument of such a function as representing a point and the value as being a
vector.
F
R2 −→ R2
(x, y) 7→ P (x, y) i + Q(x, y) j.
∂f ∂f
In order to have ∇f = P i + Q j , we need = P and = Q . If we look at
∂x ∂y
only the first of these conditions, it seems fairly obvious that the only answer is to
choose Z
f (x, y) = P (x, y) dx.
Here, the integral has to be interpreted as what ought to be (but is usually not)
called a partial integral, which is to say that in doing the integration, y is treated
as a constant.
Since this approach ignores Q altogether, it seems unlikely that it could give
the right answer. And in fact, in most cases it will not. For instance, if we have
then we get Z
f (x, y) = y dx = xy + C
∂f
(since y is treated as a constant when integrating). Testing this, we get =P,
∂x
as required. (In fact, this part could not have failed, since we obtained f by
∂f
integrating P with respect to x .) On the other hand, = x but Q = −x , so
∂y
f (x, y) does not work in this respect.
In fact, for this particular example, as we shall see, it is impossible to find any
function f (x, y) that works for both x and y . And, when one thinks about it,
this is not surprising. Because in looking for f (x, y) such that
∂f ∂f
= P, =Q
∂x ∂y
we are attempting to solve two equations for only one unknown f . Now these
equations involve functions rather than numbers, so we can’t automatically
assume that the usual rules of algebra apply. Nonetheless, when we have more
equations than unknowns it’s not surprising that we are unable to find a solution.
An obvious thing to do at this point is to simply give up on this kind of
problem. A more intelligent approach, though, is to realize that some of these
problems are solvable and some are not, and we need a way of deciding which is
the case.
∂f ∂f
P (x, y) = = 2xy cos x2 y, Q(x, y) = = x2 cos x2 y.
∂x ∂y
If we momentarily forget the known answer and use the method above, we get
Z
f (x, y) = 2xy cos x2 y = sin x2 y + C.
answer whenever any answer exists. (In fact, we shall see that this is almost true.
We need to add one more refinement.)
So there is one clear approach to the problem of finding an integral for a
vector field P (x, y) i + Q(x, y) j . Namely, solve for f (x, y) by integrating P , and
if this doesn’t work (after trying a minor adjustment to be described below), then
there is no answer.
This is actually a fairly workable approach. It’s just that it’s a bit inelegant.
To get an even better answer, go back to the example P = 2xy cos x2 y ,
Q = x2 cos x2 y , and compare what one might (but seldom does) refer to as the
∂P ∂Q
“cross derivatives,” namely and . We get (by applying the product rule)
∂y ∂x
∂P ∂
= (2xy cos x2 y) = 2x cos x2 y − 2x3 y sin x2 y
∂y ∂y
∂Q ∂ 2
= (x cos x2 y) = 2x cos x2 y − 2x3 y sin x2 y.
∂x ∂x
Trying a few more examples will convince you that this is apparently not a
coincidence. This following principle seems to be true.
∂P ∂Q
If there exists a function f (x, y) such that ∇f = P i + Q j , then = .
∂y ∂x
∂f
It’s easy to see why this must be true. In fact, if ∇f = P i + Q j then P =
∂x
∂f
and Q = and so
∂y
∂P ∂ ∂f ∂ 2f
= =
∂y ∂y ∂x ∂y ∂x
∂Q ∂ ∂f ∂2f
= = .
∂y ∂x ∂y ∂x ∂y
It is known that if these mixed partials here are continuous (as is almost always
the case at points where they exist), then they will be equal.
∂P ∂Q
In other words, it might be possible for = to be true and yet for
∂y ∂x
there not to exist any function f (x, y) with ∇f = P i + Q j . But in fact, the
condition we have found is (more or less) sufficient as well. We just have to give a
different explanation of this fact (as well as explaining what the “more or less”
means.)
This involves considering the question:
Z
∂P ∂Q ∂f
If f (x, y) = P dx and = , why should = Q ? (There should be
∂y ∂x ∂y
∂f
no doubt about why = P .)
∂x
Z
This is not so hard to see. If f = P dx then
Z
∂f ∂
= P dx
∂y ∂y
Z
∂P
= dx
∂y
Z
∂Q
= dx.
∂x
Z
∂Q
At this point, it is tempting to finish the problem by writing dx = Q ,
∂x
∂f
showing that = Q and thus finishing the proof. This step is slightly shaky,
∂y
however, for the reason that integration involves an arbitrary constant. What we
∂f
really seem to have shown is that and Q differ by a constant.
∂y
At this point, it seems that only a technicality stands in the way of what we
want, and many students will be willing to take the rest of the proof on faith.
However, this technicality is actually a little bit bigger than it appears, and it
brings up an important point that needs to be considered in solving problems in
practice.
Consider what happens if we make a slight change to the problem considered
above. Let
The reason that this new solution works is that the change made to the old
∂f
solution only involved y and hence did not affect .
∂x
To understand this better, we need to think about the integral
Z
f (x, y) = P (x, y) dx
more carefully. As already mentioned, this is a partial integral, where during the
integration y is treated as if it were a constant. But since this is true, when we
do the integral we need to add not an arbitrary constant, as one would normally
do, but an arbitrary function of y . For instance, in the problem in question, one
needs to write Z
f (x, y) = 2xy cos x2 y dx = sin x2 y + ϕ(y).
∂f
One then needs to choose ϕ(y) in such a way that the desired condition =Q
∂y
will be true.
For practical purposes, this is usually not hard to do, provided that one
starts out with functions P (x, y) and Q(x, y) which have reasonable formulas.
However it brings up an important theoretical point, and it is in fact this fine
point which accounts for the rather arcane proof one finds in books for the fact
∂P ∂Q
that a function f (x, y) exists whenever = .
∂y ∂x
Z
The point is that writing f = P dx doesn’t really make sense, because
Z
P dx isn’t actually a well defined function, since integration involves an
arbitrary constant. Usually this is not a problem, but in this case the “constant”
7
The theorem one finds in books also says something about working in a
“simply connected” region. Basically, a region in the plane is simply connected if
it doesn’t have any holes in it. In other words, the requirement is that whenever
you draw a closed curve (not crossiong itself) in the region, everything inside that
curve is still in the region. (The definition of “simply connected” is not quite this
simple for a region in three-space. Most regions that one encounters in practice in
three space are simply connected, even when they have holes in them.)
For instance, if we delete the origin from the xy-plane then the resulting
region is no longer simply connected, since if we draw a circle around the origin,
then the entire curve lies in the given region, but one of the points inside (i. e. the
origin) does not.
Now the explanation given above doesn’t suggest any reason why the
geometry of the domain of a vector field should cause problems in solving for a
function that has that field as its gradient. This is, in fact, one indication that
the explanation given above is overly simplistic. And yet that explanation is
almost correct.
−y x
P = , Q= .
x2+ y2 x2 + y2
Notice that the domain of the vector field P i + Q j consists of the whole plane
except the origin (where the denominator becomes 0) and is thus not simply
∂P ∂Q
connected. Computing and is unpleasant, but an application of the
∂y ∂x
quotient rule shows that
∂P y 2 − x2 ∂Q
= 2 = .
∂y x + y2 ∂x
Therefore it makes sense to try to find a function f such that ∇f = P i + Q j .
In order to make the answer slightly nicer I will compute f in this case by
8
integrating Q rather than P , although the same difficulty arises in either case.
Thus we write Z Z
x dy
f (x, y) = Q dy = .
x + y2
2
Now this example was chosen because it has a zinger, showing how the
geometry of the domain of a vector field can screw up the calculation of a
potential function. And yet when we check the function f (x, y) , we see that it
does in fact work.
∂f ∂ −1 y −y 1 −y
= tan = 2 2
= 2 =P
∂x ∂x x x 1 + (y/x) x + y2
∂f 1 1 x
= 2
= 2 = Q.
∂y x 1 + (y/x) x + y2
This seems just fine, and in fact it is just fine, as far as it goes. Except that
it doesn’t really deal with the special case x = 0 . In fact, we decided to choose
f (0, y) = 0 . But this makes the function f (x, y) discontinuous, since for points
y
close to the y-axis, tan−1 is not close to 0. In fact, assuming that y and x are
x
both positive, and that x approaches 0 but y does not, then y/x approaches
+∞ , and it’s not hard to see that tan−1 (y/x) approaches π/2 . (We don’t need
to worry about x and y simultaneously approaching 0, because we knew from the
beginning that the origin was a singularity for the vector field, so it’s unrealistic
to expect things to work well there.)
9
What this shows is that the problem of doing the indefinite integral in a
consistent way to produce a function that is nice with respect to both x and y is
not always completely trivial. What we have just seen suggests that to get the
function to be continuous, we need to compute
Z
π
f (0, y) = 0 dy = .
2
This is not a serious problem, though. It’s just a matter of choosing a different
constant of integration.
What is serious, though, is that this fix doesn’t work. If we choose
f (0, y) = π/2 , then we have a problem when we look at points (x, y) in the
second quadrant close to the y axis. In this case, y is positive and x is negative
and close to 0, so that y/x is close to −∞ , and tan−1 (y/x) is close to −π/2 .
In other words the function f (x, y) as we have defined it is discontinuous when
(x, y) cross the y-axis from the first quadrant into the second quadrant, since it
jumps from π/2 to −π/2 . (The same thing happens when (x, y) crosses from the
third quadrant into the fourth.)
This is a serious problem, but there is still a possible fix. In fact, if one defines
y
tan−1 if x > 0
x
π
f (x, y) = if x = 0
2
π + tan−1 y if x < 0
x
then, weird as this definition may seem, the resulting function is actually
continuous on the positive part of the y-axis, since for points near the y-axis,
π
either to the left or to the right of it, with y-positive, f (x, y) is close to .
2
This fix fails, though, on the negative y-axis (although it works just fine
everywhere else). For if x is positive and approaches 0 and y is negative, then
y/x approaches −∞ and f (x, y) = tan−1 (y/x) approaches −π/2 . But if x is
negative, then by definition f (x, y) = π + tan−1 (y/x) , and as x approaches
0, y/x approaches +∞ (both x and y are negative), and f (x, y) approaches
π + π/2 = 3π/2 . Thus we get different limits when we approach the negative
y-axis from the right and from the left. (Furthermore, the actual value of f (0, y)
has been assigned as π/2 , which is not the same as either of these two limits!) (It
helps a whole lot to draw a picture here. Unfortunately, I haven’t yet discovered
how to do that in TeX.)
10
There is no completely happy ending to this story. No matter what one tries,
there is no way of defining a function f (x, y) in the entire plane (even with the
origin deleted) that satisfied the conditions ∂P/∂x = P and ∂Q/∂y = Q .
In fact, if one thinks in terms of polar coordinates, one can see is that
basically what one wants is to set f (x, y) = θ . But of course there is no way of
defining θ as a continuous well-defined variable in the whole plane. If one circles
the origin, then either there must be a jump somewhere in the value of θ , or one
winds up with an inconsistency — trying to give θ two different values at the
same point.
One could have predicted these behavior by looking at the original vector
field. If one thinks in terms of polar coordinates, one has
−y i xj −1
P i+Qj = 2 2
+ 2 2
= (− sin θ i + cos θ j).
x +y x +y r
Now if r = x i + y j is the radius vector, one sees that P i + Q j is perpendicular
to r. And if one draws the vector field, one sees that the drawing seems to
describe a flow moving in circles around the origin counter-clockwise. In fact, if
one moves around a circle with radius one centered at the origin, one will observe
that the field P i + Q j = − sin θ i + cos θ j (since r = 1 on this circle) is the
same as the tangent vector to this circle. This means that if there were a function
f (x, y) such that ∇f (x, y) = P i + Q j , then this function would be strictly
increasing all the way around the circle. But this is not possible, since when one
had gone all the way around the circle and returned to the original point, the
function would no longer have the same value.
The correct theorem (which we have not actually proved) is as follows:
If Ω is a simply connected region in the plane and P (x, y) and Q(x, y) are
functions which have continuous partial derivatives in all of Ω , then there exists a
function f (x, y) such that ∇f = P i + Q j if and only if
∂P ∂Q
=
∂y ∂x
at all points in Ω .
Even the region Ω is not simply connected, there cannot exist such a function
∂P ∂Q
f (x, y) if 6= at any point in Ω .
∂y ∂x