# Substitution of variables

{{ safesubst:#invoke:Unsubst||$N=Merge to |date=__DATE__ |$B= Template:MboxTemplate:DMCTemplate:Merge partner }} {{ safesubst:#invoke:Unsubst||$N=Unreferenced |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }} In mathematics, substitution of variables (also called variable substitution or coordinate transformation) refers to the substitution of certain variables with other variables. Though the study of how variable substitutions affect a certain problem can be interesting in itself, they are often used when solving mathematical or physical problems, as the correct substitution may greatly simplify a problem which is hard to solve in the original variables. Under certain conditions the solution to the original problem can be recovered by back-substitution (inverting the substitution).

## Formal introduction

The map ${\displaystyle \Phi }$ is called a regular coordinate transformation or regular variable substitution, where ${\displaystyle 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}$.

## 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)=(5,11).}$ 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)}$.

## Common examples

### Cylindrical coordinates

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}\sin \theta }$.

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.

### Integration

{{#invoke:main|main}} Under the proper variable substitution, calculating an integral may become considerably easier. Consult the main article for an example.

### 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.