# Change of variables

(Redirected from Variable substitution)

In mathematics, a change of variables is a basic technique used to simplify problems in which the original variables are replaced with functions of other variables. The intent is that when expressed in new variables, the problem may become simpler, or equivalent to a better understood problem.

Change of variables is an operation that is related with substitution. However these are different operations, as it can be seen when considering differentiation (chain rule) or integration (integration by 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 written

${\displaystyle (x^{3})^{2}-9(x^{3})+8=0}$

(this is a simple case of a polynomial decomposition). Thus the equation 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 solutions in terms of the original variable are obtained by substituting x3 back in for u:

${\displaystyle x^{3}=1\quad {\text{and}}\quad x^{3}=8.}$

Then, assuming that x is real,

${\displaystyle 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 very difficult, 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

Let ${\displaystyle A}$, ${\displaystyle B}$ be smooth manifolds and let ${\displaystyle \Phi :A\rightarrow B}$ be a ${\displaystyle C^{r}}$-diffeomorphism between them, that is: ${\displaystyle \Phi }$ is a ${\displaystyle r}$ times continuously differentiable, bijective map from ${\displaystyle A}$ to ${\displaystyle B}$ with ${\displaystyle r}$ times continuously differentiable inverse from ${\displaystyle B}$ to ${\displaystyle A}$. Here ${\displaystyle r}$ may be any natural number (or zero), ${\displaystyle \infty }$ (smooth) or ${\displaystyle \omega }$ (analytic).

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 polar coordinates. Consider for example the equation

${\displaystyle U(x,y):=(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)=\Phi (r,\theta )}$ given by ${\displaystyle \displaystyle \Phi (r,\theta )=(r\cos(\theta ),r\sin(\theta ))}$.

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 )}$. 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)). 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 )=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\in \mathbb {R} }$), hence the absolute values.

### Differentiation

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

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

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.