Академический Документы
Профессиональный Документы
Культура Документы
Introduction
y2
d2 y
dy
= 0.
+ 3x2 y 2
dx2
dx
dy
= et
dt
In this section we will look at some specific types of differential equation and how to solve them.
Classifying equations
df
= 2 x is not linear
dx
df
= f 3 (x) is not linear
dx
d2 f
= x2 f (x) + ex is linear.
dx2
Constant coefficients
A differential equation has constant coefficients if the dependent variable and all the derivatives are only
multiplied by constants.
Examples: which have constant coefficients?
3
df
= 2 x: yes
dx
d2 f
= x2 f (x) + ex : no
dx2
1
d2 f
df
+3
+ 2f (x) = sin xex : no.
dx2
dx
df
+ ex f (x) = x3 does have constant coefficients: divide the whole equation by ex .
dx
Order
The order of a differential equation is the largest number of derivatives (of the dependent variable) ever
taken.
Examples:
f (x)
df
= 2 x is 1st order
dx
d2 f
= x2 f (x)+ex is 2nd order
dx2
d2 f
d2 f df
+3 2
= 0 is 2nd order.
2
dx
dx dx
First the general theory. A first order linear differential equation for y(x) must be of the form
dy
+ p(x)y = q(x).
dx
If there is something multiplying the dy/dx term, then divide the whole equation by this first.
Now suppose we calculate an integrating factor
Z
I(x) = exp
p(x) dx .
Just this once, we wont bother about a constant of integration.
We multiply our equation by the integrating factor:
I(x)
dy
+ I(x)p(x)y = I(x)q(x).
dx
1
I(x)
I(x)q(x) dx + C
Z
I(x)q(x) dx +
C
.
I(x)
We sort out the constant C from the initial conditions at the end.
2
Example
dy
+ 2xy = 0
dx
Here the integrating factor will be
and
Z
I(x) = exp
and our equation is
ex
y = 3 when x = 0.
2x dx = exp x2
2
dy
+ 2xex y = 0.
dx
2
2
d h x2 i
ye
=0
=
yex = C
=
y = Cex .
dx
The last thing we do is use the initial conditions: at x = 0, y = 3 but our form gives at x = 0, y = C so
we need C = 3 and
2
y = 3ex .
Example
dy
+ 2y = sin x
with y(/2) = 0.
dx
First we need to get the equation into a form where the first term is just dy/dx: so divide by x:
x
dy
2
sin x
+ y=
.
dx x
x
Now we calculate the integrating factor:
Z
2
I(x) = exp
dx = exp (2 ln x) = exp ln (x2 ) = x2 .
x
We multiply the whole system by x2 :
x2
dy
+ 2xy = x sin x
dx
Z
x2 y =
=
3
x sin x dx + C
x y = x cos x +
cos x sin x
C
+ 2 + 2.
x
x
x
Finally, we use the initial condition y = 0 when x = /2 to get
y=
0=
cos x 1 sin x
.
x
x2
Example
This time we will solve two different differential equations in parallel.
dy
+ 3y = e2x
dx
and
df
+ 3f = e3x
dx
In this example, we dont actually have variable coefficients but that just makes it easier!
Z
In both cases, I(x) = exp 3 dx = e3x .
e3x
dy
+ 3e3x y = ex
dx
d 3x
e y = ex
dx
e3x y = ex + C0
y = e2x + C0 e3x
and
and
and
and
df
+ 3e3x f = 1.
dx
d 3x
e f = 1.
dx
e3x
e3x f = x + C1 .
f = xe3x + C1 e3x .
A homogeneous linear equation is one in which all terms contain exactly one power of the dependent
variable and its derivatives:
dy
d2 y
+5
+ 6y = 0.
e.g.
dx2
dx
For these equations, we can add up solutions: so if f (x) is a solution and g(x) is a solution:
df
d2 f
+5
+ 6f = 0
dx2
dx
and
4
d2 g
dg
+5
+ 6g = 0
dx2
dx
4.1
Suppose we are given a differential equation in which the coefficient of the rth derivative is a constant
multiple of xr :
d2 y
dy
e.g. x2 2 + 2x
6y = 0.
dx
dx
m
Then if we try a solution of the form y = x we get
dy
d2 y
= mxm1
= m(m 1)xm2
dx
dx2
and if we put this back into the original equation we get
y = xm
xm (m2 + m 6) = 0.
(m 2)(m + 3) = 0.
In this case we get two roots: m1 = 2 and m2 = 3. This means we have found two functions that work
as solutions to our differential equation:
y1 = xm1 = x2
and
y2 = xm2 = x3 .
But we know that if we have two solutions we can use any combination of them so our general solution
is
y = c1 x2 + c2 x3 .
This works with an nth order ODE as long as the nth order polynomial for m has n different real roots.
Example
x2
Try y = xm :
y = xm
m(m 1)xm 6mxm + 10xm
d2 y
dy
6x
+ 10y = 0.
dx2
dx
dy
d2 y
= mxm1
= m(m 1)xm2 .
dx
dx2
= 0 = xm (m2 m 6m + 10) = 0 = xm (m 5)(m 2) = 0.
4.2
Now suppose we have a homogeneous equation with constant coefficients, like this one:
d2 y
dy
+5
+ 6y = 0.
dx2
dx
We try a solution y = ex . This gives dy/dx = ex and d2 y/dx2 = 2 ex so
2 ex + 5ex + 6ex = 0.
(2 + 5 + 6)ex = 0
for all x.
Just like the polynomial case, the function of x will not be zero everywhere so we need
2 + 5 + 6 = 0
( + 2)( + 3) = 0.
In this case we get two roots: 1 = 2 and 2 = 3. This means we have found two independent
solutions:
y1 = e1 x = e2x
and
y2 = e2 x = e3x ,
and the general solution is
y = c1 e2x + c2 e3x .
Example
A third-order equation this time:
d2 y
dy
d3 y
2
= 0.
3
3
dx
dx
dx
Trying y = ex gives
3 2 2 = 0
(2 2) = 0
( 2)( + 1) = 0
2 = 2
3 = 1.
Notice that we have three constants here: in general we will always have N constants in the solution to
an N th order equation.
Example
Another second-order equation:
Trying y = ex gives
d2 y
dy
+2
+ 5y = 0.
dx2
dx
2 + 2 + 5 = 0
6
4 20
16
= 1 2i.
Repeated roots
If our polynomial for has two roots the same, then we will end up one short in our solution. This
is similar to the case with a repeated eigenvalue in the previous section: there, we used a generalised
eigenvector and a function xex . Here we only need the xex part.
Example
Another third-order equation:
d3 y
d2 y
dy
2 3 +
= 0.
3
dx
dx
dx
Trying y = ex gives
3 22 + = 0
(2 2 + 1) = 0
( 1)2 = 0
2 = 3 = 1.
What happens if there is a term with none of the dependent variable? That is, loosely, a term on the
right hand side, or a function of x.
f2 (x)
d2 y
dy
+ f1 (x)
+ f0 (x)y = g(x).
dx2
dx
In the most general case we cant do anything: but in one or two special cases we can.
If we already know the general solution to the homogeneous equation:
f2 (x)
d2 y
dy
+ f1 (x)
+ f0 (x)y = 0
2
dx
dx
7
y = c1 y1 (x) + c2 y2 (x)
then all we need is a particular solution to the whole equation: one function u(x) that obeys
f2 (x)
d2 u
du
+ f1 (x)
+ f0 (x)u = g(x).
dx2
dx
d2 y
dy
6x
+ 10y = 6x3 .
dx2
dx
d2 y
dy
6x
+ 10y = 0
dx2
dx
y = c1 x5 + c2 x2 .
Now as long as the power on the right is not part of the CF we can find the PI by trying a multiple
of the right hand side:
dy
d2 y
y = Ax3 =
= 3Ax2 and
= 6Ax.
dx
dx2
d2 y
dy
6x
+ 10y = x2 6Ax 6x3Ax2 + 10Ax3 = x3 [6A 18A + 10A] = 2Ax3
dx2
dx
so for this to be a solution we need 2A = 6 so A = 3. Then the general solution to the full equation
is
y = c1 x5 + c2 x2 3x3 .
x2
Example
d2 y
dy
3
+ 2y = ex .
2
dx
dx
on the homogeneous equation:
2 3 + 2 = 0
( 1)( 2) = 0.
dy
= Aex
dx
d2 y
= Aex .
dx2
d2 y
dy
3
+ 2y = Aex + 3Aex + 2Aex = 6Aex
dx2
dx
so we need A = 1/6 for this to work. Our PI is
yPI =
and the general solution is
1 x
e
6
1
y = c1 ex + x2 e2x + ex .
6
Example
dy
+ 3y = e3x .
dx
This is only first-order: in fact we solved it in section 3 and the solution was
y = xe3x + C1 e3x .
Let us solve it the way we have just learned. First the CF: try y = ex then
+3=0
so = 3 and the CF is
yCF = C1 e3x .
Now look for the PI. The RHS is e3x so our first thought might be to try Ae3x . But this is the CF:
so we know when we try it we will get zero! So instead (motivated by knowing the answer in this case)
we multiply by x and try
dy
y = Axe3x
= Ae3x 3Axe3x
dx
dy
+ 3y = Ae3x 3Axe3x + 3Axe3x = Ae3x .
dx
so we need A = 1 and we end up with the same solution we got last time.
In general, if the RHS matches the CF (or part of the CF) then we will multiply by x to get our trial
function for the PI.
9
Example
This time we have initial conditions as well: remember we always use these as the very last thing we
do.
d3 y
d2 y
dy
dy
d2 y
+2 2 +
= 2x
with y = 3,
= 4 and
= 4 at x = 0.
3
dx
dx
dx
dx
dx2
First we find the CF. Try y = ex :
3 + 22 + = 0 = (2 + 2 + 1) = 0 = ( + 1)2 = 0.
This has only two distinct roots: 1 = 0, 2 = 3 = 1. Therefore the CF is:
yCF = c1 + c2 ex + c3 xex .
Now we look for the PI. The RHS is x so we try a function
y = Ax + B =
dy
d2 y
d3 y
= A =
=
= 0.
2
dx
dx
dx3
This makes
d3 y
d2 y
dy
+2 2 +
=0+0+A
3
dx
dx
dx
and no value of A can make this equal to x. What do we do when it fails?
If the trial function fails, try multiplying by x.
[Note: in this case we could have predicted this because the B of our trial function is part of the CF.]
We want one more power of x so we try
y = Cx2 + Ax =
dy
d2 y
d3 y
= 2Cx + A =
=
2C
and
= 0.
dx
dx2
dx3
d3 y
d2 y
dy
+
2
+
= 0 + 4C + 2Cx + A
dx3
dx2
dx
so we need
2Cx + 4C + A = 2x
Our general solution is
which means C = 1, A = 4.
y = c1 + c2 ex + c3 xex + x2 4x.
=
=
=
y(0) = c1 + c2 = 3
dy
(0) = c2 + c3 4 = 4
dx
d2 y
(0) = c2 2c3 + 2 = 4
dx2
Conditions on CF
= k not a root
= k a root
= k a double root
= ik not a root
= ik not a root
= ik a root
= ik a double root
= 0 not a root
= 0 a root
= 0 a double root
11
First guess at PI
Aex
Axex
Ax2 ex
A cos kx + B sin kx
A cos kx + B sin kx
Ax cos kx + Bx sin kx
Ax2 cos kx + Bx2 sin kx
Axn + Bxn1 + + C
Axn+1 + Bxn + + Cx
Axn+2 + Bxn+1 + + Cx2
Yes
No
Is it an ODE?
Yes
?
No
Is it linear?
'
?
Does it have
No Is it first order?
constant
coefficients?
&
Yes
Yes
?
?
Integrating
CF & PI
factor
using
method
ex
@
R Beyond
@
this
- course
6
No
$
'
Are the coefficients
No
- powers of x matching
the derivatives?
%
&
Yes
?
CF & PI
using
xm
ye
p dx
q(x)e
p dx
dx+C = y = e
p dx
q(x)e
p dx
dx+Ce
p dx
yCF = c1 e1 x + c2 e2 x
or
yCF = c1 ex + c2 xex .
We calculate the PI, which is any solution to the original equation, by a system of trial and error. In
general we try something of the same form as f (x); if this overlaps with the CF at all then we multiply
by x. The general solution is y = yCF + yPI .
12