Changing Variables and Jacobians
Changing Variables and Jacobians
Changing Variables and Jacobians
3.1 Introduction
The slope of the f = f (x, y ) surface depends on the direction in which one moves from
the point (x, y ), and in Lecture 1 we learnt that the partial derivative must be defined
in terms of the change along a particular direction or axis.
For a function f (x, y ) we decided that the obvious directions to choose are along the
x and y axes, keeping y and x fixed, respectively.
The question now is are these really the obvious directions?
For example, consider the function
2
+y 2 )
f (x, y ) = e −(x cos(4(x 2 + y 2 ))
shown in Figure 3.1. Does it really make sense to impose a square “x-constant, y -
constant” cake-rack mesh onto this function? Probably not! It would be in more
sympathy with the function to use a mesh with radial symmetry as in Figure 3.2.
0.5
f(x,y)
−0.5
5
4
0 2
0
−2
y −5 −4
x
1
3/2 LECTURE 3. CHANGING VARIABLES & JACOBIANS
φ
lines of
constant y
f (x , y ) F (u , v )
(a) (b)
Figure 3.3: (a) Surface f (x, y ) above a set of x-constant and y -constant lines. (b) Surface F (u, v )
above a set of u-constant and v -constant curves but plotted in the x, y frame. The surface has exactly
the same shape.
3.2. REWRITING THE FUNCTION AND FINDING THE DERIVATIVES 3/3
Case 1A:
If we know what the function f (x, y ) is explicitly, we can replace x and y in the function
to get the new function as
Then one can work out the partial derivatives with respect to u and v directly from the
new function F (u, v ).
3/4 LECTURE 3. CHANGING VARIABLES & JACOBIANS
Case 1B: In this case we don’t have an explicit form for f (x, y ), and, therefore, cannot
find an explicit form for function F (u, v ).
But we can still write expressions for the partial derivatives using the Chain Rule for
partials from Lecture 2:
Case 1B: Use the Chain Rule for partials to obtain the derivatives
∂f ∂f ∂x ∂f ∂y
= + (3.6)
∂u ∂x ∂u ∂y ∂u
∂f ∂f ∂x ∂f ∂y
= + (3.7)
∂v ∂x ∂v ∂y ∂v
♣ Example of Case 1B.
We are told f = f (x, y ), and x = u and y = u/v .
Given this transformation, the best we can do is to write for any function f (x, y )
∂f ∂f ∂f 1 ∂f ∂f 1
= (1) + = + (3.8)
∂u ∂x ∂y v ∂x ∂y v
∂f ∂f ∂f u ∂f u
= (0) + − 2 =− . (3.9)
∂v ∂x ∂y v ∂y v 2
To check this result, let’s use (as in the example of Case 1A) f (x, y ) = x/y . Then
2
∂f 1 x 1 v u v v v
= (1) + − 2 = − = − = 0 (3.10)
∂u y y v u v u2 u u
x u u 2v
∂f 1
= (0) + − 2 − 2 = 2 =1 (3.11)
∂v y y v u v
But notice that the chain rule for partials seems to deliver an expression for ∂f /∂u and
∂f /∂v .
But you might complain that f is a function of (x, y ) NOT (u, v ), and so we should
have written ∂F/∂u and ∂F/∂v . You are correct. So how are we getting away with it?
We are using f as a “go-between” value f = f (x, y ) and f = F (u, v ). This is correct
because at corresponding values of (x, y ) and (u, v ) the functions do return exactly
the same value. (Look back at Figure 3.3.)
Some books introduce another symbol (z, say) as the “go-between”. They write z =
f (x, y ) and z = F (u, v ) and then write
∂z ∂z ∂x ∂z ∂y ∂z ∂z ∂x ∂z ∂y
= + , = + , (3.12)
∂u ∂x ∂u ∂y ∂u ∂v ∂x ∂v ∂y ∂v
and so on — but this seems over-fussy.
One’s first thought is that this should be the better way of defining a transformation,
but it turns out to be really inconvenient!
New-ito-Old prevents us from finding either F (u, v ) or using the Chain Rule for Partials.
We cannot immediately work out ∂x/∂u, etc.
We proceed in one of two ways.
Case 2A: Try to invert the transformation.
Use u = u(x, y ) and v = v (x, y ) as simultaneous equations from which to find x =
x(u, v ) and y = y (u, v ).
If you can invert, the problem becomes a Case 1 problem.
♣ Example of Case 2A
Suppose you are told that
Case 2B: When the transformation is not invertible Write down the Chain Rule for
Partials the “wrong” way round! That is, we want ∂f /∂u, so start with ∂f /∂x.
∂f ∂f ∂u ∂f ∂v
= + (3.16)
∂x ∂u ∂x ∂v ∂x
∂f ∂f ∂u ∂f ∂v
= + (3.17)
∂y ∂u ∂y ∂v ∂y
Treat these as simultaneous equations in the unknown ∂f /∂u and ∂f /∂v and re-
arrange. Ie:
∂f ∂f ∂v ∂f ∂v ∂u ∂v ∂u ∂v
= − / − (3.18)
∂u ∂x ∂y ∂y ∂x ∂x ∂y ∂y ∂x
∂f ∂f ∂u ∂f ∂u ∂u ∂v ∂u ∂v
= − / − (3.19)
∂v ∂y ∂x ∂x ∂y ∂x ∂y ∂y ∂x
So we can recover the partial derivatives with respect to the new variables without an
explicit expression for the function in the new variables.
3.2.4 SUMMARY
To summarize:
1: If you have the transformation as OLD variables in terms of NEW
either
1A: find the function explicity and find the partials from it directly, or
1B: find just the partials using the Chain-rule-for-partials directly.
2: If you have the transformation as NEW variables in terms of OLD
either
2A: invert the given transformation to get OLD variables in terms of NEW, and
then go to CASE 1, or
2B: use the Chain-rule-for-partials for the OLD variables to give simultaneous
equations for the partial derivatives with respect to to the NEW variables.
3.2. REWRITING THE FUNCTION AND FINDING THE DERIVATIVES 3/7
♣ Example #1
Q: The elevation of a hill is described by
z = z(x, y ) = exp −(x 2 + y 2 ) .
(3.20)
By deriving the function in plane polars, find ∂z/∂r and ∂z/∂φ and comment on their
values. Determine the value of r where the hill is steepest.
A: Plane polars are (r, φ) where x = r cos φ, y = r sin φ.
This is old in terms of new, and we know the function, ⇒CASE 1A.
The hill is therefore
z = exp −r 2 .
(3.21)
So
∂z ∂z
= −2r exp −r 2
and =0. (3.22)
∂r ∂φ
The change of height is all in the radial direction. ∂z/∂φ = 0 means that if you move
at constant r (that is, “round” the hill) you will not change height at all.
The gradient is a function of r alone, so we can find the total derivative
d d
Slope = (−2r exp −r 2 ) = (−2 + 4r 2 ) exp −r 2
(3.23)
dr dr
√ √
This is zero when r = 1/ 2 and Slope = − 2 exp {−1/2}.
♣ Example #2.
Here is one that can be solved using all approaches.
Q: Find the partial derivatives ∂f /∂u and ∂f /∂v when
f = f (x, y ) = x 2 − y 2 and u = (x + y ) v = (x − y ) . (3.24)
Now pretend that we did not (or could not) invert the transformation. We could still
find the derivative using Case 2B.
Write the chain rule for partials the other way around:
∂f ∂f ∂u ∂f ∂v
= + (3.30)
∂x ∂u ∂x ∂v ∂x
∂f ∂f ∂u ∂f ∂v
= + (3.31)
∂y ∂u ∂y ∂v ∂y
∂ 2V ∂ 2V
+ =0. (3.36)
∂x 2 ∂y 2
Express this equation in plane polar coordinates (r, φ) where x = r cos φ, y = r sin φ.
A: We want first to write down expressions for ∂V /∂x and ∂V /∂y which will involve
∂r /∂x, ∂r /∂y , ∂φ/∂x, and ∂φ/∂y . This is the wrong way round for the transformation.
So
• Write the CRfP the “other way round” (Case 2B) and use sim eqs.
∂V ∂V ∂x ∂V ∂y ∂V ∂V
= + = cos φ + sin φ (3.37)
∂r ∂x ∂r ∂y ∂r ∂x ∂y
∂V ∂V ∂x ∂V ∂y ∂V ∂V
= + = (−r sin φ) + (r cos φ) (3.38)
∂φ ∂x ∂φ ∂y ∂φ ∂x ∂y
∂V ∂V sin φ ∂V
= cos φ − (3.39)
∂x ∂r r ∂φ
∂V ∂V cos φ ∂V
= sin φ + (3.40)
∂y ∂r r ∂φ
∂
We can drop the V and consider ∂x as an operator
∂ ∂ sin φ ∂
= cos φ − (3.41)
∂x ∂r r ∂φ
∂ ∂ cos φ ∂
= sin φ + (3.42)
∂y ∂r r ∂φ
3/10 LECTURE 3. CHANGING VARIABLES & JACOBIANS
So the operator
∂2
∂ sin φ ∂ ∂ sin φ ∂
= cos φ − cos φ − (3.43)
∂x 2 ∂r r ∂φ ∂r r ∂φ
2 2
∂ 1 ∂ 1 ∂
= cos2 φ 2 − cos φsin φ − 2 + (3.44)
∂r r ∂φ r ∂φ∂r
∂2 sin φ ∂ 2
1 ∂ −sin φ cos φ ∂
− sin φ −sin φ + cos φ + − −
r ∂r ∂φ∂r r r ∂φ r ∂φ2
which can be tidied up a little. Note how the operators move through to the right,
operating as they go.
Let’s follow through a couple of terms. The following is straightforward:
∂2
∂ ∂ 2
cos φ cos φ = cos φ 2 (3.45)
∂r ∂r ∂r
but this requires the product rule
2
∂ sin φ ∂ 1 ∂ 1 ∂
cos φ − = −cos φ sin φ − 2 − cos φ sin φ (3.46)
∂r r ∂φ r ∂φ r ∂r ∂φ
∂2 2
1 ∂2
2 ∂ 2 ∂
= sin φ − cos φsin φ 2 − (3.47)
∂y 2 ∂r 2 r ∂φ r ∂φ∂r
∂2 2
1 ∂ 1 2 ∂
+ cos φ cos φ + sin φ + 2 cos φ (3.48)
r ∂r ∂φ∂r r ∂φ2
As we shall see later, the Jacobian is especially useful when changing variables from
(x, y ) to (u, v ) in multiple integrals.
We shall gain an intuitive understanding of why this must be so when we come to use
Jacobians in multiple integration. However it is quite easy to prove using the Jacobian
matrix. This is not on the syllabus.
3/12 LECTURE 3. CHANGING VARIABLES & JACOBIANS
Now repeat with the Chain Rule around the other way. You will arrive at the following
∂/∂x ∂u/∂x ∂v /∂x ∂/∂u ∂/∂u
= = J u,v (3.62)
∂/∂y ∂u/∂y ∂v /∂y ∂/∂v x,y ∂/∂v
But it follows that
∂/∂u ∂/∂x ∂/∂u
= J u,v
x,y x,y J u,v
= J u,v (3.63)
∂/∂v ∂/∂y x,y ∂/∂v
so that
h i−1
J u,v
x,y J u,v = I
x,y
⇒ J u,v
x,y = J u,v
x,y
. (3.64)
But a result from linear algebra tells us that, if A and B are square, |AB| = |A||B|,
and hence |A||A−1 | = 1. The result for Jacobian determinants follows immediately.
y (x,y) (r, φ )
r
φ
x
Figure 3.4: Cartesian to plane polars. Many texts use θ rather than φ.
The transformation is
x = r cos φ, y = r sin φ (3.65)
∂x ∂x ∂y ∂y
⇒ = cos φ; = −r sin φ; = sin φ; = r cos φ (3.66)
∂r ∂φ ∂r ∂φ
Writing the CRfP in operator form gives
∂ ∂x ∂ ∂y ∂ ∂ ∂
= + = cos φ + sin φ (3.67)
∂r ∂r ∂x ∂r ∂y ∂x ∂y
∂ ∂x ∂ ∂y ∂ ∂ ∂
= + = −r sin φ + r cos φ . (3.68)
∂φ ∂φ ∂x ∂φ ∂y ∂x ∂y
Using these are simutaneous equations gives
∂ ∂ sin φ ∂ ∂ ∂ cos φ ∂
= cos φ − and = sin φ + . (3.69)
∂x ∂r r ∂φ ∂y ∂r r ∂φ
(You could also find these by inverting the transformation.)
The Jacobian
∂x ∂x
∂(x, y ) ∂r ∂φ
= ∂y ∂y = r cos2 φ + r sin2 φ = r . (3.70)
∂(r, φ)
∂r ∂φ
and
∂r ∂r
∂(r, φ) ∂x ∂y cos φ sin φ 1
= ∂φ ∂φ = (cos φ)( ) − (sin φ)(− )= . (3.71)
∂(x, y ) r r r
∂x ∂y
3/14 LECTURE 3. CHANGING VARIABLES & JACOBIANS
y
φ
x
Figure 3.5: Cartesian x, y , z to cylindrical polars r, φ, z
The transformation is
x = r cos φ; y = r sin φ; z = z. (3.72)
So
∂ ∂ ∂
= cos φ + sin φ (3.73)
∂r ∂x ∂y
∂ ∂ ∂ ∂ ∂
= −r sin φ + r cos φ and = (3.74)
∂φ ∂x ∂y ∂z ∂z
and using these as simultaneous equations (or inverting the transformation):
∂ ∂ sin φ ∂
= cos φ − (3.75)
∂x ∂r r ∂φ
∂ ∂ cos φ ∂ ∂ ∂
= sin φ + and = (3.76)
∂y ∂r r ∂φ ∂z ∂z
x φ
Azimuthal angle
(3.86)
y v
x u
y φ
π/2
x r
a a
Figure 3.7: Useful transformations tend to take an awkward region shape in Oxy into a rectangle in
Ouv .
3.5. A “GOOD” TRANSFORMATION 3/17
The proof is straightforward. If u(x, y ) and v (x, y ) are functionally dependent, then
u = u(v ), which in turn means that a function z = z(u, v ) = 0 exists. Differentiating
z with respect to x and y gives:
∂z ∂u ∂z ∂v
+ = 0 (3.89)
∂u ∂x ∂v ∂x
∂z ∂u ∂z ∂v
+ = 0 (3.90)
∂u ∂y ∂v ∂y
For consistency between these two equations we must have ux = βuy and vx = βvy ,
where β is some constant. Thus
∂(u, v ) ux vx
= = (ux vy − vx uy ) = (βuy vy − βvy uy ) = 0 . (3.91)
∂(x, y ) uy vy
♣ Example
Q: Test whether there is a functional dependence between the variables (u, v ) if
u = x 2 + y + 1 and v = x 4 + 2x 2 y + y 2 + x 2 − y . (3.92)
A:
∂(u, v )
= (ux vy − vx uy ) (3.93)
∂(x, y )
= (2x)(2x 2 + 2y − 1) − (4x 3 + 4xy + 2x)(1)
= (4x 3 + 4xy − 2x) − (4x 3 + 4xy + 2x)
= 0
So, yes the variables are not independent. With a little work you’ll spot that the
dependence is v = u 2 − 3u + 2.