Example:
If dy dx =4x3y2 , use the method of separation of variables to find the functiony.
Solution: First we need to get the differential equation into the correct form with all the x’s on the right hand side and all they’s on the left. Multiplying both sides byy2 gives:
y2dy= 4x3dx
We can now integrate both sides; the left with respect toyand the right with respect to x:
Z
y2dy= Z
4x3dx 1
3y3= 4x4 4 +C y3= 3x4+C0 y=p3
3x4+C0 whereC0= 3Cand is a constant.
Example:
If dydx = sin(−x) +e4x
y2 then use the method of separation of variables to find an expression fory in terms ofx.
Solution: So first we need to get the differential equation into the correct form will all the x’s on the right hand side and all they’s on the left. So we have:
y2dy= sin(−x) +e4x dx
We can now integrate both sides, the left with respect toyand the right with respect to x:
Z
y2dy= Z
sin(−x) +e4x
dx Split up the integral on the right Z
y2dy= Z
sin(−x)dx+ Z
e4xdx Integrate both sides y3
3 = cos(−x) +e4x
4 +C Multiply both sides by 3 y3=3
4e4x+ 3 cos(−x) + 3C Take the cube root of both sides y=
3
4e4x+ 3 cos(−x) +C0 13
WhereC0 = 3C
Physics Example:
The force between two particles is modelled to be:F =12ε a0
"a0 r
13
− a0
r 7#
Given that force is the negative derivative of potential, i.e. F =− d
drU, and at r=a0,U =−ε calculate the potential between the two particles.
Solution: This is a problem of seperating variables so first we set up the problem:
− d
drU =12ε a0
"
a0
r 13
− a0
r 7#
Turn this into a nicer form with negative powers
− d
drU =12ε a0
a130 r−13−a70r−7
Multiply bydrand integrate both sides
− Z
dU= Z 12ε
a0
a130 r−13−a70r−7
dr Take the constant 12ε
a0 out of the integral
−U =12ε a0
Z
a130 r−13−a70r−7
dr Now integrate the right hand side
−U = 12ε a0
− a130
12r−12+a70 6 r−6
+C This simplifies down U =ε a120 r−12−2a60r−6
+C Now find C by substitution (r=a0, U =−ε)
−ε=ε a120 a−120 −2a60a−60
+C Simplify this
−ε=ε 1−2 +C
−ε=−ε+C 0 =C
Back into our equation we get,U =ε a120 r−12−2a60r−6 .
Note: This is another form of the Lennard-Jones 6-12 potential, with a0 being the equilibrium seperation andεbeing the energy needed to move the particles apart to infinity.
The Integrating Factor Method
Equations of the form
dy
dx+g(x)y=f(x)
are linear and can be solved using the method of integrating factor. In order to use this method, we must always ensure that our differential equation is in the form above and that there is nothing multiplied by the dy
dx.
Our objective is to write our equation in the form d
dx I(x)y
=I(x)f(x)
by finding anintegrating factor I(x). This form is beneficial because we can now directly integrate this to find the solution.
The formula for the integrating factor is:
I(x) =e
R g(x) We then simply need to find
1 I(x)
Z
I(x)f(x)dx . For example, given the equation
xdy
dx+ 2y=x2−x+ 1
we begin by dividing everything byxto get the equation in the correct form:
dy dx + 2y
x=x−1 + 1 x
Now we can compare this equation to our general form for these equations, and note thatf(x) =x−1+1 x andg(x) = 2
x. Now, we can find the integrating factor as follows:
I(x) =e
R g(x)dx=e R 2
xdx
=e2 ln|x|=x2 Now we can write the ODE as
d dx
x2y
=x2(x−1 + 1
x) =x3−x2+x and so we only need to solve
y= 1 x2
Z
(x3−x2+x)dx
= 1 x2(1
4x4−1 3x3+1
2x2+C)
=1 4x2−1
3x1+1
2x+Cx−2
Example:
Find the general solution of the following differential equation:dy
dx + 2xy= 6x Solution: The integrating factor is
I(x) =e
R2x dx=ex2 And as the theory tells us that
d(yI(x))
dx = 6xI(x) (Wheref(x) = 6x)
This implies that
yex2 = Z
6xex2dx
Knowing that ex2 differentiates to 2xex2 allows us to assume that 2xex2 integates to give ex2. Therefore we if write the equation above as
yex2 = 3 Z
2xex2dx Then is it easy to see that
yex2 = 3ex2+C Therefore
y= 3 +Ce−x2
Example:
Find the solution to the initial value problem:dy dx+−2y
x = 8x2 Ifx= 1 aty= 0
Solution: The integrating factor is I(x) =e
R −2
x dx=e−2 lnx=x−2 And as
d(yI(x))
dx =f(x)I(x) Anf(x) = 8x2 This implies that
yx−2= Z
8dx Therefore
yx−2= 8x+C
Using the Boundary Conditions, we ge that 0 = 8 +C and thereforeC=−8 Our final answer is then
y= 8(x3−x2)
Equations of the Form dy
dx = f (
yx)
If we have a homogeneous differential equation of the form
dy
dx =f(xy)
then we cannot always use separation of variables, so we use the change of variableV =y/xin order to get our equation into a more manageable form. We can then usually separate the variables and integrate with respect to this new variable.
Note: In this case, the word homogeneous has a different meaning to the one described on page 194.
We can write these types of equations in an alternate form:
dy
dx =F(x, y) G(x, y)
In order to use this method, the functionsF(x, y) andG(x, y) must be homogeneous functions of degree one, meaning that they satisfy the condition:
F(kx, ky) =kF(x, y) For example, if we have the differential equation
dy
dx = y+p x2−y2 x thenF(x, y) =y+p
x2−y2satisfies the above relation sinceky+p
k2x2−k2y2=k(y+p
x2−y2), and clearly so does G(x, y) =x. Now that we have checked the condition, we can then use the substitution V =y/x⇒y=V x. We then have:
dy
dx =dV x
dx =V +xdV dx So the equation becomes:
xdV
dx = V x+√
x2−V2x2
x −V =V +p
1−V2−V
⇒xdV dx =p
1−V2 This equation is separable and so we can write:
Z 1
√
1−V2dV Z 1
xdx
and then integrate this using the methods in the Integration chapter to give:
arcsin(V) = ln|x|+C⇒V = sin(ln|x|+C)
Now we must remember to return to the original variabley by substitutingV =y/x:
y=xsin(ln|x|+C)
Example:
Find the general solution of the following differential equation:5xy2dy
dx =x3+ 2y3, x >0
Solution: Rearranging the equation we get dy
dx = x3+ 2y3 5xy2 which is an equation in the form dy
dx = F(x,y)G(x,y) whereF andGare homogeneous equations.
Using the substitutionv=xy we obtain get dy
dx =v+dv
dx andy=xv Using this to re-write the equation gives
v+xdv
dx = x3+ (xv)3 5x(xv)2 Dividing byx3 on the top and bottom of the fraction gives
v+xdv
dx = 1 +v3 5v2 Using the technique of separating the variables gives
Z 1 xdx=
Z 5v2 1−3v3dx
The integral on the left hand side is a standard integral but the right hand side is more difficult.
However it can be done simply enough with the right trick. Notice that the derivative of 1−3v3 with respect tov is −9x3. Therefore we can get this integrand to a standard inspection integral by rewriting it as
−5 9
Z −9v2 1−3v3dx (An integral in the form of
Z f0(x) f(x) dx) Integrating both sides gives
ln|x|=−5
9ln|1−3v3|+c
Rewriting c as ln|k| and using log rules this equation simplifies further to ln
x(1 + 3v3)5/9 k
= 0
As ln(1) = 0 we know
x(1 + 3v3)5/9
k = 1
Equations of the Form dy
dx + f (x)y = g(x)y
kEquations of the form
dy
dx +f(x)y=g(x)yk
are often called Bernoulli equations. Clearly we cannot simply separate the variables, but if we use the substitutionz=y1−k we can get round this. Differentiating with respect to xgives:
dz
dx = (1−k)y−kdy dx On rewriting the original equation as
y−kdy
dx+f(x)y1−k =g(x) and now substituting our substitution in, we obtain:
dz
dx + (1−k)f(x)z= (1−k)g(x) We can now solve this equation using an integrating factor as before.
For example, given the equation
dy
dx+xy= y x , we rewrite as
ydy
dx +xy2=x Now, use the substitutionz=y2 and differentiate this to get:
dz
dx = 2ydy dx Substituting these into our equations gives:
dz
dx + 2xz = 2x We can now solve this using an integrating factore
R2x dx to get z= 1 +Ce−x2 Then, returning to the original variable
y2= 1 +Ce−x2