]> 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 ) ] } (

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

df du = df dx dx du (

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 ) ] } (

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 } (

The relations ( 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 ( 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 ( requires differentiability of f, with respect to x and to y.

Matrix notation

The expression ( 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 ) (

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 ) (

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 ( obeys the following rule

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

Transformations in two dimensions

A relation between the pair of variables (, 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 ( 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 (, one obtains the translation of the coordinate system:

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

After substituting u by x' and v by y' in (, 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 ) (


f x' = f x f y' = f y } (

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 ( is expressed by

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

yielding this time a different result, in comparison with (

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

and finally

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

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π } (

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

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

and finally

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

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π } (

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

f=f( x,y,z ) (

is according to the matrix notation (,

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

The four terms from the upper left corner of the matrix correspond to the matrix of (, and therefore ( 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π } (

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 (

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 ( 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 ) } (

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 ( as an example. A metric system would have the following relations of the physical dimensions:

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

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

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

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

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 } (

with the following relations of the physical dimensions

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

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 } (

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

g=fxu (

With the assistance of ( one obtains

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


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

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 (, 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 } (

where T is temperature and p is pressure.

The following application of the Legendre transformation ( 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 } (

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

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


Exercise 1.

f=f( x,y )

is a function of two variables. Calculate

f u and f w

for the transformation of variables ( :

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 )


  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 (

  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