[<< wikibooks] Ordinary Differential Equations/Substitution 1
First-Order Differential EquationsAs we saw in a previous example, sometimes even though an equation isn't separable in its original form, it can be factored into a form where it is.  Another way you can turn non-separable equations into separable ones is to use substitution methods.

== General substitution procedure ==
All substitution methods use the same general procedure:

Take a term of the equation and replace it with a variable v. The key is that the new variable must cover all instances of the variable y. Otherwise substitution would not help.
Solve for

d
y

d
x

{\displaystyle {\frac {dy}{dx}}}
in terms of

v

{\displaystyle v}
and

d
v

d
x

{\displaystyle {\frac {dv}{dx}}}
. To do this, take the equation

v
=
f
(
x
,
y
)

{\displaystyle v=f(x,y)}
where

f

{\displaystyle f}
is the term you replaced and take its derivative.
Plug in

d
v

d
x

{\displaystyle {\frac {dv}{dx}}}
and solve for

v

{\displaystyle v}
.
Plug

v

{\displaystyle v}
into the original term replaced, and solve for

y

{\displaystyle y}
.

== Constant coefficient substitution ==
Lets say we have an equation with a term ay + bx + c, such as

d
y

d
x

=
G
(
a
y
+
b
x
+
c
)
.

{\displaystyle {\frac {dy}{dx}}=G(ay+bx+c).}
where G is a function. This is non-separable.  But we can sometimes solve these equations by turning the term into a function v, defining v(x,y) and finding v'(x,y,y').

v
(
x
,
y
)
=
a
y
+
b
x
+
c

{\displaystyle v(x,y)=ay+bx+c\,}
The trick with the derivation of v is that y is also a function of x. The derivative of v thus becomes

d
v

d
x

=
a

d
y

d
x

+
b

{\displaystyle {\frac {dv}{dx}}=a{\frac {dy}{dx}}+b}
In maxima this looks like so:

(%i1) v:a*y(x)+b*x+c;and

(%i2) diff(v,x);yielding

(%o1) a*(dy/dx)+bNext, we rearrange terms and solve for y'(x,v,v'):

d
y

d
x

=

d
v

d
x

−
b

a

{\displaystyle {\frac {dy}{dx}}={\frac {{\frac {dv}{dx}}-b}{a}}}
Now plug v back into the original equation,

d
y

d
x

=
G
(
a
y
+
b
x
+
c
)

{\displaystyle {\frac {dy}{dx}}=G(ay+bx+c)}
, and get it into the form

d
v

d
x

=
f
(
v
)

{\displaystyle {\frac {dv}{dx}}=f(v)}

d
v

d
x

−
b

a

=
G
(
v
)

{\displaystyle {\frac {{\frac {dv}{dx}}-b}{a}}=G(v)}

d
v

d
x

=
a
G
(
v
)
+
b

{\displaystyle {\frac {dv}{dx}}=aG(v)+b}
Solve for v, that is integrate on both sides:

d
v

d
x

=
a
G
(
v
)
+
b

{\displaystyle {\frac {dv}{dx}}=aG(v)+b}

d
v

a
G
(
v
)
+
b

=
d
x

{\displaystyle {\frac {dv}{aG(v)+b}}=dx}

∫

d
v

a
G
(
v
)
+
b

=
∫
d
x

{\displaystyle \int {\frac {dv}{aG(v)+b}}=\int dx}

∫

d
v

a
G
(
v
)
+
b

=
x
+
D

{\displaystyle \int {\frac {dv}{aG(v)+b}}=x+D}
Once you have v(x), plug back into the definition of v(x) to get y(x).

y
(
x
)
=

v
(
x
)
−
c
−
b
x

a

{\displaystyle y(x)={\frac {v(x)-c-bx}{a}}}
It is highly suggested that one should not memorize this equation, and instead remember the method of solving the problem.  The final equation is rather obscure and easy to forget, but if one knows the method, he/she can always solve it.  It will also help if one uses other substitution methods.

=== Example 1 ===

d
y

d
x

=
(
x
+
y
+
3

)

2

{\displaystyle {\frac {dy}{dx}}=(x+y+3)^{2}}
Lets replace the quantity being raised to a power with v.

v
=
x
+
y
+
3

{\displaystyle v=x+y+3\,}
Now lets find v'.

d
v

d
x

=

d
y

d
x

+
1

{\displaystyle {\frac {dv}{dx}}={\frac {dy}{dx}}+1}
Solve for y'

d
y

d
x

=

d
v

d
x

−
1

{\displaystyle {\frac {dy}{dx}}={\frac {dv}{dx}}-1}
Plug in for y and y':

d
v

d
x

−
1
=

v

2

{\displaystyle {\frac {dv}{dx}}-1=v^{2}}

d
v

d
x

=

v

2

+
1

{\displaystyle {\frac {dv}{dx}}=v^{2}+1}
Now we solve for v, using the methods we learned in Separable Variables:

d
v

v

2

+
1

=
d
x

{\displaystyle {\frac {dv}{v^{2}+1}}=dx}

∫

d
v

v

2

+
1

=
∫
d
x

{\displaystyle \int {\frac {dv}{v^{2}+1}}=\int dx}

tan

−
1

⁡
(
v
)
=
x
+
C

{\displaystyle \tan ^{-1}(v)=x+C\,}

v
=
tan
⁡
(
x
+
C
)

{\displaystyle v=\tan(x+C)\,}
Now that we have v(x), plug back in and find y(x).

y
+
x
+
3
=
tan
⁡
(
x
+
C
)

{\displaystyle y+x+3=\tan(x+C)\,}

y
=
tan
⁡
(
x
+
C
)
−
x
−
3

{\displaystyle y=\tan(x+C)-x-3\,}

== Other methods ==
These are not the only possible substitution methods, just some of the more common ones.  Substitution methods are a general way to simplify complex differential equations.  If you ever come up with a differential equation you can't solve, you can sometimes crack it by finding a substitution and plugging in.  Just look for something that simplifies the equation.  Remember that between v and v' you must eliminate the y in the equation.

=== Example 2 ===

2
y

d
y

d
x

=

y

2

+
x
−
1

{\displaystyle 2y{\frac {dy}{dx}}=y^{2}+x-1}
This equation isn't separable, and none of the methods we previously used will quite work.  Let's use a custom substitution of v = y2 + x − 1.  Solve for v':

d
v

d
x

=
2
y

d
y

d
x

+
1

{\displaystyle {\frac {dv}{dx}}=2y{\frac {dy}{dx}}+1}

2
y

d
y

d
x

=

d
v

d
x

−
1

{\displaystyle 2y{\frac {dy}{dx}}={\frac {dv}{dx}}-1}
Plug into the original equation

d
v

d
x

−
1
=
v

{\displaystyle {\frac {dv}{dx}}-1=v}
Solve for v

d
v

v
+
1

=
d
x

{\displaystyle {\frac {dv}{v+1}}=dx}

∫

d
v

v
+
1

=
∫
d
x

{\displaystyle \int {\frac {dv}{v+1}}=\int dx}

ln
⁡
(
v
+
1
)
=
x
+
C

{\displaystyle \ln(v+1)=x+C\,}

v
=
C

e

x

−
1

{\displaystyle v=Ce^{x}-1\,}
Now plug in and get y

C

e

x

−
1
=

y

2

+
x
−
1

{\displaystyle Ce^{x}-1=y^{2}+x-1\,}

y

2

=
C

e

x

−
x

{\displaystyle y^{2}=Ce^{x}-x\,}
Pretty easy after using that substitution.  Keep this method in mind, you will use this for more complex equations.