# Ordinary Differential Equations/Substitution 2

Substitution methods are really applicable anywhere you can find a differential equation. However, there's very few instances where you will always give a certain substitution. You generally pick one and plug it in as needed. So I'll give situations where you could use a substitution method, although you may later learn better methods.

## Parametric equations

One time where you may need it is when solving parametric equations. Lets say we're given functions for velocity in two dimensions- ${\displaystyle v_{x}(t)}$ and ${\displaystyle v_{y}(t)}$. If we want to solve for ${\displaystyle y(x)}$, you have to divide ${\displaystyle {\frac {v_{y}}{v_{x}}}}$. This works out to be ${\displaystyle {\frac {\frac {dv_{y}}{dx}}{\frac {dv_{x}}{dx}}}={\frac {dy}{dx}}}$. When you do this, you will frequently (although not always) get a chance to use ${\displaystyle {\frac {y}{x}}}$ substitution.

### Constant velocity

Lets say we're swimming across a river with constant velocity ${\displaystyle v_{0}}$. The river has no current. We start swimming at an angle of ${\displaystyle \theta }$ with respect to the shore. Solve for ${\displaystyle y(x)}$

The first thing we need to do is break the velocity into x and y components. This is fairly simple.

${\displaystyle v_{x}=v_{0}cos(\theta )}$
${\displaystyle v_{y}=v_{0}sin(\theta )}$

Using simple trig, we can remove the theta.

${\displaystyle v_{x}=v_{0}{\frac {x}{\sqrt {x^{2}+y^{2}}}}}$
${\displaystyle v_{y}=v_{0}{\frac {y}{\sqrt {x^{2}+y^{2}}}}}$

Now we divide the two to find ${\displaystyle {\frac {dy}{dx}}}$.

${\displaystyle {\frac {dy}{dx}}={\frac {v_{0}{\frac {y}{\sqrt {x^{2}+y^{2}}}}}{v_{0}{\frac {x}{\sqrt {x^{2}+y^{2}}}}}}={\frac {y}{x}}}$

Now this is simple to solve separably. It could also be solved via substitution. This is a trivial example, but it can be made more complicated.

### Motion against a current

Imagine the same swimmer. Now there is a current with speed r going straight up the river (positive y direction). How does this change our example?

The x component is still the same.

${\displaystyle {\frac {dx}{dt}}=v_{0}cos(\theta )={\frac {v_{0}x}{\sqrt {x^{2}+y^{2}}}}}$

And in the y direction we also have a term due to the current.

${\displaystyle {\frac {dy}{dt}}=v_{0}sin(\theta )+r={\frac {v_{0}y}{\sqrt {x^{2}+y^{2}}}}+r}$

You can get ${\displaystyle {\frac {dy}{dx}}}$ by dividing the two equations

${\displaystyle {\frac {dy}{dx}}={\frac {y}{x}}+{\frac {r{\sqrt {x^{2}+y^{2}}}}{v_{0}x}}}$

We can move the x into the root to simplify the equation a bit

${\displaystyle {\frac {dy}{dx}}={\frac {y}{x}}+{\frac {r{\sqrt {{\frac {x^{2}}{x^{2}}}+{\frac {y^{2}}{x^{2}}}}}}{v_{0}}}}$
${\displaystyle {\frac {dy}{dx}}={\frac {y}{x}}+{\frac {r}{v_{0}}}{\sqrt {1+{\frac {y^{2}}{x^{2}}}}}}$

Well, this complicated equation looks like a case for ${\displaystyle {\frac {y}{x}}}$ substitution.

${\displaystyle v={\frac {y}{x}}}$
${\displaystyle y=vx}$
${\displaystyle y'=v+v'x}$
${\displaystyle v+v'x=v+{\frac {r}{v_{0}}}{\sqrt {1+v^{2}}}}$
${\displaystyle v'={\frac {r}{xv_{0}}}{\sqrt {1+v^{2}}}}$

That looks like a nice, easily solved separable equation. Let solve it.

${\displaystyle {\frac {dv}{\sqrt {1+v^{2}}}}={\frac {r}{xv_{0}}}}$
${\displaystyle \int {\frac {dv}{\sqrt {1+v^{2}}}}=\int {\frac {r}{xv_{0}}}}$

The left end is an ugly integral. Just trust me on it.

${\displaystyle ln(v+{\sqrt {1+v^{2}}})={\frac {r}{v_{0}}}ln(x)+C}$
${\displaystyle v+{\sqrt {1+v^{2}}}=e^{ln(x^{\frac {r}{v_{0}}})+C}}$
${\displaystyle v+{\sqrt {1+v^{2}}}=Cx^{\frac {r}{v_{0}}}}$

Lets try to get rid of that root. Isolate it, and square both sides.

${\displaystyle {\sqrt {1+v^{2}}}=Cx^{\frac {r}{v_{0}}}-v}$
${\displaystyle 1+v^{2}=Cx^{2{\frac {r}{v_{0}}}}-2vCx^{\frac {r}{v_{0}}}+v^{2}}$
${\displaystyle 2vCx^{\frac {r}{v_{0}}}=C^{2}x^{2{\frac {r}{v_{0}}}}-1}$
${\displaystyle v={\frac {Cx^{\frac {r}{v_{0}}}}{2}}-{\frac {1}{2Cx^{\frac {r}{v_{0}}}}}}$

Plugging in for v, we get

${\displaystyle {\frac {y}{x}}={\frac {Cx^{\frac {r}{v_{0}}}}{2}}-{\frac {1}{2Cx^{\frac {r}{v_{0}}}}}}$

We can solve for y by multiplying through by x

${\displaystyle y={\frac {Cx^{{\frac {r}{v_{0}}}+1}}{2}}-{\frac {x}{2Cx^{\frac {r}{v_{0}}}}}}$
${\displaystyle y={\frac {C}{2}}x^{{\frac {r}{v_{0}}}+1}-{\frac {1}{2C}}x^{{\frac {-r}{v_{0}}}+1}}$

This complicated equation does make sense- the bigger the current, the further you go in the y direction as a portion of the x.

If you ever find an equation this evil in real life, do yourself a favor and buy a computer program to solve it.