# Change of variables

{{ safesubst:#invoke:Unsubst||$N=Unreferenced |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }} {{#invoke: Sidebar | collapsible }}

In mathematics, the operation of substitution consists in replacing all the occurrences of a free variable appearing in an expression or a formula by a number or another expression. In other words, an expression involving free variables may be considered as defining a function, and substituting values to the variables in the expression is equivalent to apply the function defined by the expression to these values.

A change of variables is commonly a particular type of substitution, where the substituted values are expressions that depend on other variables. This is a standard technique used to reduce a difficult problem to a simpler one. A change of coordinates is a common type of change of variables. However, if the expression in which the variables are changed involves derivatives or integrals, the change of variable does not reduce to a substitution.

A very simple example of a useful variable change can be seen in the problem of finding the roots of the sixth order polynomial:

${\displaystyle x^{6}-9x^{3}+8=0.\,}$

Sixth order polynomial equations are generally impossible to solve in terms of radicals (see Abel–Ruffini theorem). This particular equation, however, may be simplified by defining a new variable x3 = u. Substituting x by ${\displaystyle {\sqrt[{3}]{u}}}$ into the polynomial gives

${\displaystyle u^{2}-9u+8=0,}$

which is just a quadratic equation with solutions:

${\displaystyle u=1\quad {\text{and}}\quad u=8.}$

The solution in terms of the original variable is obtained by substituting back u by x3 in this solution:

${\displaystyle x^{3}=1\quad {\text{and}}\quad x^{3}=8\quad \Rightarrow \qquad x=(1)^{1/3}=1\quad {\text{and}}\quad x=(8)^{1/3}=2.}$

## Simple example

Consider the system of equations

${\displaystyle xy+x+y=71}$
${\displaystyle x^{2}y+xy^{2}=880}$

where ${\displaystyle x}$ and ${\displaystyle y}$ are positive integers with ${\displaystyle x>y}$. (Source: 1991 AIME)

Solving this normally is not terrible, but it may get a little tedious. However, we can rewrite the second equation as ${\displaystyle xy(x+y)=880}$. Making the substitution ${\displaystyle s=x+y,t=xy}$ reduces the system to ${\displaystyle s+t=71,st=880.}$ Solving this gives ${\displaystyle (s,t)=(16,55)}$ or ${\displaystyle (s,t)=(55,16).}$ Back-substituting the first ordered pair gives us ${\displaystyle x+y=16,xy=55}$, which easily gives the solution ${\displaystyle (x,y)=(11,5).}$ Back-substituting the second ordered pair gives us ${\displaystyle x+y=55,xy=16}$, which gives no solutions. Hence the solution that solves the system is ${\displaystyle (x,y)=(11,5)}$.

## Formal introduction

The map ${\displaystyle \Phi }$ is called a regular coordinate transformation or regular variable substitution, where regular refers to the ${\displaystyle C^{r}}$-ness of ${\displaystyle \Phi }$. Usually one will write ${\displaystyle x=\Phi (y)}$ to indicate the replacement of the variable ${\displaystyle x}$ by the variable ${\displaystyle y}$ by substituting the value of ${\displaystyle \Phi }$ in ${\displaystyle y}$ for every occurrence of ${\displaystyle x}$.

## Other examples

### Coordinate transformation

Some systems can be more easily solved when switching to cylindrical coordinates. Consider for example the equation

${\displaystyle U(x,y,z):=(x^{2}+y^{2}){\sqrt {1-{\frac {x^{2}}{x^{2}+y^{2}}}}}=0.}$

This may be a potential energy function for some physical problem. If one does not immediately see a solution, one might try the substitution

${\displaystyle \displaystyle (x,y,z)=\Phi (r,\theta ,z)}$ given by ${\displaystyle \displaystyle \Phi (r,\theta ,z)=(r\cos(\theta ),r\sin(\theta ),z)}$.

Note that if ${\displaystyle \theta }$ runs outside a ${\displaystyle 2\pi }$-length interval, for example, ${\displaystyle [0,2\pi ]}$, the map ${\displaystyle \Phi }$ is no longer bijective. Therefore ${\displaystyle \Phi }$ should be limited to, for example ${\displaystyle (0,\infty ]\times [0,2\pi )\times [-\infty ,\infty ]}$. Notice how ${\displaystyle r=0}$ is excluded, for ${\displaystyle \Phi }$ is not bijective in the origin (${\displaystyle \theta }$ can take any value, the point will be mapped to (0, 0, z)). Then, replacing all occurrences of the original variables by the new expressions prescribed by ${\displaystyle \Phi }$ and using the identity ${\displaystyle \sin ^{2}x+\cos ^{2}x=1}$, we get

${\displaystyle V(r,\theta ,z)=r^{2}{\sqrt {1-{\frac {r^{2}\cos ^{2}\theta }{r^{2}}}}}=r^{2}{\sqrt {1-\cos ^{2}\theta }}=r^{2}\left|\sin \theta \right|}$.

Now the solutions can be readily found: ${\displaystyle \sin(\theta )=0}$, so ${\displaystyle \theta =0}$ or ${\displaystyle \theta =\pi }$. Applying the inverse of ${\displaystyle \Phi }$ shows that this is equivalent to ${\displaystyle y=0}$ while ${\displaystyle x\not =0}$. Indeed we see that for ${\displaystyle y=0}$ the function vanishes, except for the origin.

Note that, had we allowed ${\displaystyle r=0}$, the origin would also have been a solution, though it is not a solution to the original problem. Here the bijectivity of ${\displaystyle \Phi }$ is crucial. Note also that the function is always positive (for ${\displaystyle x,y,z\in \mathbb {R} }$), hence the absolute values.

### Differentiation

{{#invoke:main|main}} The chain rule is used to simplify complicated differentiation. For example, to calculate the derivative

${\displaystyle {\frac {d}{dx}}\left(\sin(x^{2})\right)\,}$

the variable x may be changed by introducing x2 = u. Then, by the chain rule:

${\displaystyle {\frac {d}{dx}}={\frac {d}{du}}{\frac {du}{dx}}={\frac {d}{dx}}\left(u\right){\frac {d}{du}}={\frac {d}{dx}}\left(x^{2}\right){\frac {d}{du}}=2x{\frac {d}{du}}\,}$

so that

${\displaystyle {\frac {d}{dx}}\left(\sin(x^{2})\right)=2x{\frac {d}{du}}\left(\sin(u)\right)=2x\cos(x^{2})\,}$

where in the very last step u has been replaced with x2.

### Integration

{{#invoke:main|main}} Difficult integrals may often be evaluated by changing variables; this is enabled by the substitution rule and is analogous to the use of the chain rule above. Difficult integrals may also be solved by simplifying the integral using a change of variables given by the corresponding Jacobian matrix and determinant. Using the Jacobian determinant and the corresponding change of variable that it gives is the basis of coordinate systems such as polar, cylindrical, and spherical coordinate systems.

### Differential equations

Variable changes for differentiation and integration are taught in elementary calculus and the steps are rarely carried out in full.

The very broad use of variable changes is apparent when considering differential equations, where the independent variables may be changed using the chain rule or the dependent variables are changed resulting in some differentiation to be carried out. Exotic changes, such as the mingling of dependent and independent variables in point and contact transformations, can be very complicated but allow much freedom.

Very often, a general form for a change is substituted into a problem and parameters picked along the way to best simplify the problem.

### Scaling and shifting

Probably the simplest change is the scaling and shifting of variables, that is replacing them with new variables that are "stretched" and "moved" by constant amounts. This is very common in practical applications to get physical parameters out of problems. For an nth order derivative, the change simply results in

${\displaystyle {\frac {d^{n}y}{dx^{n}}}={\frac {y_{\text{scale}}}{x_{\text{scale}}^{n}}}{\frac {d^{n}{\hat {y}}}{d{\hat {x}}^{n}}}}$

where

${\displaystyle x={\hat {x}}x_{\text{scale}}+x_{\text{shift}}}$
${\displaystyle y={\hat {y}}y_{\text{scale}}+y_{\text{shift}}.}$

This may be shown readily through the chain rule and linearity of differentiation. This change is very common in practical applications to get physical parameters out of problems, for example, the boundary value problem

${\displaystyle \mu {\frac {d^{2}u}{dy^{2}}}={\frac {dp}{dx}}\quad ;\quad u(0)=u(L)=0}$

describes parallel fluid flow between flat solid walls separated by a distance δ; µ is the viscosity and ${\displaystyle dp/dx}$ the pressure gradient, both constants. By scaling the variables the problem becomes

${\displaystyle {\frac {d^{2}{\hat {u}}}{d{\hat {y}}^{2}}}=1\quad ;\quad {\hat {u}}(0)={\hat {u}}(1)=0}$

where

${\displaystyle y={\hat {y}}L\qquad {\text{and}}\qquad u={\hat {u}}{\frac {L^{2}}{\mu }}{\frac {dp}{dx}}.}$

Scaling is useful for many reasons. It simplifies analysis both by reducing the number of parameters and by simply making the problem neater. Proper scaling may normalize variables, that is make them have a sensible unitless range such as 0 to 1. Finally, if a problem mandates numeric solution, the fewer the parameters the fewer the number of computations.

### Momentum vs. velocity

Consider a system of equations

${\displaystyle m{\dot {v}}=-{\frac {\partial H}{\partial x}}}$
${\displaystyle m{\dot {x}}={\frac {\partial H}{\partial v}}}$

for a given function ${\displaystyle H(x,v)}$. The mass can be eliminated by the (trivial) substitution ${\displaystyle \Phi (p)=1/m\cdot v}$. Clearly this is a bijective map from ${\displaystyle \mathbb {R} }$ to ${\displaystyle \mathbb {R} }$. Under the substitution ${\displaystyle v=\Phi (p)}$ the system becomes

${\displaystyle {\dot {p}}=-{\frac {\partial H}{\partial x}}}$
${\displaystyle {\dot {x}}={\frac {\partial H}{\partial p}}}$

### Lagrangian mechanics

{{#invoke:main|main}} Given a force field ${\displaystyle \phi (t,x,v)}$, Newton's equations of motion are

${\displaystyle m{\ddot {x}}=\phi (t,x,v)}$.

Lagrange examined how these equations of motion change under an arbitrary substitution of variables ${\displaystyle x=\Psi (t,y)}$, ${\displaystyle v={\frac {\partial \Psi (t,y)}{\partial t}}+{\frac {\partial \Psi (t,y)}{\partial y}}\cdot w}$.

He found that the equations

${\displaystyle {\frac {\partial {L}}{\partial y}}={\frac {\mathrm {d} }{\mathrm {d} t}}{\frac {\partial {L}}{\partial {w}}}}$

are equivalent to Newton's equations for the function ${\displaystyle L=T-V}$, where T is the kinetic, and V the potential energy.

In fact, when the substitution is chosen well (exploiting for example symmetries and constraints of the system) these equations are much easier to solve than Newton's equations in Cartesian coordinates.