]> Change of variables

Math Animated™
Mathematical Introduction for Physics and Engineering
by Samuel Dagan (Copyright © 2007-2020)

Chapter 3: Many Variables; Section 1: Differentiation; page 4

Home | Table of Contents | A-Z Index | Help

Previous topic: page 3 Derivatives of Higher Order

Next topic: page 5 Stationary Points


Change of Variables

Two variables

For functions with a single variable f( x ) , the change of the variable x by a new variable u can be written by a functional relation between the variables

x=x( u ) f( x )=f[ x( u ) ] } (3.1.4.1)

and the derivative with respect to the new variable is given by the chain rule:

df du = df dx dx du (3.1.4.2)

In the case of a function of two variables f( x,y ) , the change of the pair of variables (x,y) by a new pair (u,v), can be also expressed by a functional relation of the variables

{ x=x( u,v ) y=y( u,v ) f( x,y )=f[ x( u,v ),y( u,v ) ] } (3.1.4.3)

The derivatives of the function with respect to the new variables can be obtained from the definition of partial derivatives, yielding the following chain rules:

( f u ) v = ( f x ) y ( x u ) v + ( f y ) x ( y u ) v ( f v ) u = ( f x ) y ( x v ) u + ( f y ) x ( y v ) u } (3.1.4.4)

The relations (3.1.4.4) contain partial derivatives, indexed by the variable that is kept constant during the differentiation. This notation is introduced just for clarity. It is not necessary, and will be usually omitted, except for a few particular cases. Since the first derivatives are also functions of two variables, the chain rules (3.1.4.4) can be reused, in order to obtain second order derivatives, and so on, up to any order of differentiation. It should be clear, without saying, that (3.1.4.4) requires differentiability of f, with respect to x and to y.

Matrix notation

The expression (3.1.4.4) can be written in a more compact matrix form:

( f u f v )=( x u y u x v y v )( f x f y ) (3.1.4.5)

The matrix notation is borrowed from the linear algebra. We don't need to know algebra, but can use this notation by following a simple rule. The following expression corresponds to a n dimensional space

( w 1 w 2 ... w n )=( a 11 a 12 ... a 1n a 21 a 22 ... a 2n ... ... ... ... a n1 a n2 ... a nn )( v 1 v 2 ... v n ) (3.1.4.6)

The two columns of n values each, denoted by w and v are called vectors, and the square form of n² values, denoted by a, is called a matrix. The term aij of the matrix means the value at row i and column j. The expression (3.1.4.6) obeys the following rule

w i = j=1 n ( a ij v j ) where   i=1,2,...n } (3.1.4.7)

Transformations in two dimensions

A relation between the pair of variables (3.1.4.3), can be interpreted geometrically, as the relation between the two systems of coordinates in a two dimensional space. One point in such a space is defined as a pair of the coordinate values. If there is one to one correspondence between each point of the one coordinate system, with a point of the other system, then the relation (3.1.4.3) defines the transformation of the coordinates.

We already know that a coordinate system displayed with rectangular coordinate axes, is called Cartesian. Other systems, for example the polar coordinates, use a different display, and are called by the general name curvilinear coordinates. In order to understand better the transformation of coordinates, we are going to study few examples. We'll start with the translation and the rotation of Cartesian coordinates. The translation and rotation of a geometrical object in a plane is already known from chapter 1. But the translation and rotation of the coordinate system, is equivalent to the translation and rotation of an object in the opposite direction, which we'll have to keep in mind. This is graphically explained at Fig.  Translation of coordinates and Fig.  Rotation of coordinates

The simplest example is a translation of the Cartesian coordinates by the constant increments Δx and Δy. From the translation of an object (1.2.5.11), one obtains the translation of the coordinate system:

x=x'+Δx y=y'+Δy } (3.1.4.8)

After substituting u by x' and v by y' in (3.1.4.5), one obtains

( f x' f y' )=( x x' y x' x y' y y' )( f x f y )=( 1 0 0 1 )( f x f y ) (3.1.4.9)

yielding

f x' = f x f y' = f y } (3.1.4.10)

Was this expected? The derivative with respect to one of the coordinate axes, is obtained by incrementing the coordinate in the direction of the axis. The new coordinates' axes remain parallel to the previous ones, and therefore the derivative is unaffected.

On the other hand, the rotation of the coordinates should have effect on the derivatives, as shown in the next example. The rotation of coordinates about the origin by an angle Δφ according to (1.2.5.35) is expressed by

x=x'cosΔφy'sinΔφ y=x'sinΔφ+y'cosΔφ } (3.1.4.11)

yielding this time a different result, in comparison with (3.1.4.9)

( f x' f y' )=( x x' y x' x y' y y' )( f x f y )=( cosΔφ sinΔφ sinΔφ cosΔφ )( f x f y ) (3.1.4.12)

and finally

f x' =cosΔφ f x +sinΔφ f y f y' =sinΔφ f x +cosΔφ f y } (3.1.4.13)

The relation of the polar with the Cartesian coordinates was given in chapter 1. It is reproduced here

{ x=rcosφ y=rsinφ restrictions: r0 0φ<2π } (3.1.4.14)

and will be used as another example of transformation. The substitution of (3.1.4.14) into (3.1.4.5) yields

( f r f φ )=( x r y r x φ y φ )( f x f y )=( cosφ sinφ rsinφ rcosφ )( f x f y ) (3.1.4.15)

and finally

f r =cosφ f x +sinφ f y f φ =rsinφ f x +rcosφ f y } (3.1.4.16)

Transformations in three dimensions

We learned previously how to use a three dimensional right-handed Cartesian coordinate system, for displaying a function of two variables. The same system allows us also to display any point of a function with three variables. As in the case of a planar coordinate system, one can define curvilinear coordinates. We are now going to study here two examples, which are the most common: the cylindrical and the spherical coordinates, and their relations with the Cartesian.

As a first example we'll study the cylindrical coordinate system. It uses the the polar coordinates for the (x,y) plane, and the z coordinate, as it is defined in the Cartesian coordinate system.

Notice that a constant r, defines a cylinder with radius=r. A graphical display of the cylindrical coordinates is given in Fig. Cylindrical coordinates.

The relation with the Cartesian coordinates is

x=rcosφ y=rsinφ z=z restrictions: r0 0φ<2π } (3.1.4.17)

The transformation of the first derivatives of a function with three variables

f=f( x,y,z ) (3.1.4.18)

is according to the matrix notation (3.1.4.6),

( f r f φ f z )=( cosφ sinφ 0 rsinφ rcosφ 0 0 0 1 )( f x f y f z ) (3.1.4.19)

The four terms from the upper left corner of the matrix correspond to the matrix of (3.1.4.15), and therefore (3.1.4.16) holds also here. The vanishing terms are due to the independence of z from r and φ.

The spherical coordinates serve as the second example of curvilinear coordinates in three dimensions. The relation with the Cartesian coordinates is

x=Rsinθcosφ y=Rsinθsinφ z=Rcosθ restrictions: R0 0θπ 0φ<2π } (3.1.4.20)

The coordinate φ is the same, as the one used in the cylindrical system. R is the distance of a point from the origin

R 2 = r 2 + z 2 = x 2 + y 2 + z 2 (3.1.4.21)

where r is borrowed here from the cylindrical coordinates. Notice the difference between R and r. Sometimes the Greek letter ρ is used instead of r, in order to stress the difference. The angle θ is between the positive direction of the z axis and the straight segment connecting the point with the origin. Notice the difference in the span of φ and θ.

A constant value of θ defines a dual conic surface with an opening angle of θ. A constant value of R defines a spherical surface with radius R. A graphical display of the spherical coordinates is given at Fig. Spherical coordinates.

The transformation of the first derivatives of (3.1.4.18) is

( f R f θ f φ )=( x R y R z R x θ y θ z θ x φ y φ z φ )( f x f y f z )= =( sinθcosφ sinθsinφ cosθ Rcosθcosφ Rcosθsinφ Rsinθ Rsinθsinφ Rsinθcosφ 0 )( f x f y f z ) } (3.1.4.22)

Physical dimensions

Since a transformation of coordinates is defined by functional relations, in the case of variables with physical dimensions, one should take care to obey the appropriate rules. In the examples given already on this page, if the Cartesian coordinates correspond to a metric system, these rules are obeyed.

Let's consider (3.1.4.20) as an example. A metric system would have the following relations of the physical dimensions:

[ x ]=[ y ]=[ z ]=[ R ] [ θ ]=[ φ ]=   none } (3.1.4.23)

On the other hand, if the Cartesian coordinate system is not metric, then the relation (3.1.4.21) is senseless.

The following example (exercise 1) is a legitimate transformation of two variables:

x=uexp( w ) y=wexp( u ) } (3.1.4.24)

But in the case of physical variables, and since the argument of an exponential function should be dimensionless, it follows that x and y should also be dimensionless. If x and y have physical dimensions, then one could use, for example, the following transformation:

x=uexp( k 1 w ) y=wexp( k 2 u ) k 1 and k 2 areconstants } (3.1.4.25)

with the following relations of the physical dimensions

[ x ]=[ u ]= [ k 2 ] 1 [ y ]=[ w ]= [ k 1 ] 1 } (3.1.4.26)

Legendre transformation

The Legendre transformation, commonly used in theoretical physics, is of a different kind. This transformation uses a physical function, in order to transform a derivative into a new variable. The transformation obeys the rules of physical dimensions, and modifies the function.

The transformation shown here is for a function of two variables, but can be easily extended to more variables. The total differential of  f(x,y)  is

df=udx+vdy { u= f x v= f y } (3.1.4.27)

In order to use u as a variable instead of x, we'll define a new function g as

g=fxu (3.1.4.28)

With the assistance of (3.1.4.27) one obtains

dg=dfudxxdu= =udx+vdyudxxdu= =vdyxdu } (3.1.4.29)

with

g=g( u,y ) { x= g u v= g y } (3.1.4.30)

Notice that f and g are different functions, but have the same physical dimensions. The procedure can be similarly applied for the transformation   yv .

As a physical example of the Legendre transformation, we'll use again the main law of thermodynamics (3.1.2.12/14), where the internal energy U is a function of two variables: the entropy S and the volume V, and the total differential is

U=U( S,V ) { dU= ( U S ) V dS+ ( U V ) S dV= =TdSpdV } (3.1.4.31)

where T is temperature and p is pressure.

The following application of the Legendre transformation (3.1.4.28/30) yields a new function H( S,p ) , which is called Enthalpy:

H=U+pV { dH=dU+pdV+Vdp= =TdSpdV+pdV+Vdp= =TdS+Vdp= = ( H S ) p dS+ ( H p ) S dp } (3.1.4.32)

Since the differentiation of H( S,p ) is independent of the order, we obtain in addition to (3.1.3.11), another Maxwell equation of thermodynamics:

( T p ) S = ( V S ) p (3.1.4.33)

Exercises

Exercise 1.

f=f( x,y )

is a function of two variables. Calculate

f u and f w

for the transformation of variables (3.1.4.24) :

x=uexp( w ) y=wexp( u ) }

Exercise 2. Obtain the general expression of the second order derivatives

2 f τ 2 , 2 f σ 2 and 2 f τσ

for the function of two variables

f=f( x,y )

after applying the transformation

x=x( τ,σ ) y=y( τ,σ ) }

Exercise 3. The Cartesian coordinate system (x', y') is obtained by rotating the system (xy) by an angle β about the origin. For a given function

f=f( x,y )

Calculate


  1. ( f x' ) 2 + ( f y' ) 2

  2. 2 f x ' 2 + 2 f y ' 2

Exercise 4. The function f=f( x,y ) undergoes the transformation x=x y=y( x,z ) } Use the expressions ( y x ) z and ( y z ) x ( f x ) y and ( f y ) x } in order to obtain


  1. ( f x ) z

  2. ( f z ) x

  3. ( f y ) z

  4. ( f z ) y
Notice: The first two questions of this exercise are simple, but the last two require a good understanding of the change of variables, and of the partial derivatives.

Exercise 5. As a continuation of the example (3.1.4.31/33)

  1. Obtain the total differential of the thermodynamic function F( T,V ) called "Helmholtz free energy" by the use of the Legendre transformation!
  2. Obtain the total differential of the thermodynamic function G( T,p ) called "Gibbs free energy" by the use of the Legendre transformation!
  3. From the total differentials, deduce the corresponding thermodynamic Maxwell equations!

Previous topic: page 3 Derivatives of Higher Order

Next topic: page 5 Stationary Points

Home | Table of Contents | A-Z Index | Help