Professional Documents
Culture Documents
2.1
Exact Equations
These are ODEs whose general solution can be obtained by simply integrating both sides of the equation.
Examples Find the general solutions of the following ODEs.
a)
dy
dx
b)
d
2
dx (yx )
= 2 sin x,
= 4x3
Z
Z
dy =
2 sin(x)dx. Then
d(yx )
Z
=
4x3 dx
and hence
yx2 = x4 + c.
c
.
x2
Key Point
The solution of the equation
d
f (x)y = g(x)
dx
is
Z
f (x)y =
g(x) dx
or
y=
1
f (x)
Z
g(x) dx
c
d
(yx2 ) = 4x3 , the solution has two parts, since y = x2 + 2 .
dx
x
c
(containing the arbitrary constant of integration) is
x2
c
x2 ,
then
d
d
d c
2
=
x
(yi x2 ) =
(c) = 0.
2
dx
dx x
dx
This works generally:
2.1.1
Useful fact:
d
f (x)y = g(x), the solution y has two parts: y = yd (x) + yi (x) where:
dx
d
dx (y sin
cos x + C
cot x + Ccosec x.
x) = 0.
2.1.2
d
(yx2 ) = x2 is exact but if we expand the left-hand side of this equation using the
dx
product rule, we have that
The equation b)
d
(yx2 )
dx
=
=
dy
d
+ y (x2 )
dx
dx
dy
x2
+ y(2x)
dx
x2
and so,
x2
dy
+ 2xy = x2 .
dx
(2.1)
2.1.3
Key point
dy
+ yf 0 (x) = g(x) is exact. It can be rewritten as:
dx
d
(yf (x)) = g(x)
dx
Z
so that yf (x) =
1
g(x) dx and y =
f (x)
Z
g(x) dx.
dy
+ 2e2x y = x2 .
dx
d 2x
e = 2e2x . Therefore this is just the exact equation
dx
x3
gives e2x y =
+ c. Thus
3
x3 2x
y=
e
+ ce2x
3
Note that
d
2x
dx (e y)
2.2
Integrating Factors
Integrating factors can be used to transform certain ODEs which are not exact into exact ODEs. As an
illustration, consider
x3
dy
+ 4x2 y = x.
dx
As you may wish to check, this is not exact. However, if we multiply through by x, we get
x4
dy
+ 4x3 y = x2
dx
d
(yx4 )dx =
dx
x2 dx =
x3
+c
3
or
y=
1
c
+ 4.
3x x
The function by which we multiply a given ODE in order to make it exact is called the integrating factor.
In the above example x is the integrating factor. This works rather generally:
2.2.1
Fundamental Algorithm
dy
+ b(x)y + c(x) = 0 can be transformed into an exact equation and
dx
then (hopefully!) solved. This requires the following steps:
Any linear ODE of the form a(x)
dy
+ f (x)y = g(x)
dx
f (x) dx
Note that we do not need constants of integrationhere the IF is any function of the form eF (x) where
f (x) = F 0 (x).
Step III: Multiply through by the IF to get
eF (x)
dy
+ f (x)eF (x) y = eF (x) g(x).
dx
d F (x)
(e
y) and so we can solve:
dx
Z
Z
d F (x)
F (x)
(e
y) = eF (x) g(x).
e
y=
dx
dy
+ 4x3 y = x2 ;
x4 dx
equivalently
d
dy
(yx4 ) = x4
+ 4x3 y = x2
dx
dx
as before.
2 dx
= e2x .
Step 3. Multiply through by the I.F. and write the equation in exact form.
e2x
dy
+ 2e2x y = e2x sin x.
dx
Thus
d 2x
e y = e2x sin x.
dx
Step 4. Integrate both sides of the equation and find the general solution. This is a standard integration
by parts, and I will let you check that
2x
2x
e y=
e ydx =
1
2
e2x sin x = = e2x cos x + e2x sin x + C.
5
5
dy
+ (sin x)y = cos2 x.
dx
dy
Step 1. Rewrite the differential equation as
+ tan(x)y = cos x.
dx
cos x
tan(x) dx = exp( ln(cos x)) = exp(ln(sec x)) = sec(x).
Step 3. Multiply through by the I.F. and write the equation in exact form.
sec x
dy
+ y sec x tan x = sec(x) cos x = 1
dx
equivalently,
d
sec(x)y = 1
dx
Step 4. Integrate both sides of the equation and find the general solution:
Z
d sec(x)y =
Z
dx
or
y = (x + c) cos(x).
An electrical example:
Suppose we are given an electrical circuit with a resistor and an inductance coil and a battery.
A basic fact from physics is that, if we close the circuit we get a current i flowing clockwise around the
di
circuit, with voltage drop across the resistor of iR and across the coil of L . Thus,
dt
E = iR + L
di
.
dt
[Note: These are not formulae you need to remember for this course.]
Lets put in some numbers; say E = 10, R = 8 and L = 2; with initial conditions of i = 0 at t = 0. Thus
di
10 = 8i + 2 , or
dt
di
+ 4i = 5.
dt
6
This can be solved either with an IF (which equals e4t ) or by separating variables and using (1.3.1) from
page 6 of the Separation of Variables notes. Either way you find that i = 5/4 + Ce4t . The initial
conditions give 0 = 5/4 + C and so C = 5/4 and
i=
5 5 4t
e .
4 4
This has the graph with asymptote at i = 5/4 like those on page 7 of the Separation of Variables section.
Now suppose the battery goes flat and we use the mains in place, say with voltage 2 cos(t). This means
that we have to solve the equation
2
di
+ 8i = 2 cos(t)
dt
di
+ 4i = cos(t).
dt
or
R
This does now need an IF = exp( 4dt) = e4t . Thus
d 4t
di
e i = e4t + 4e4t i = e4t cos(t).
dt
dt
Z
1
4 4t
e cos(t) + e4t sin(t) + C, where the integral on the RHS was
17
17
solved by integration by parts (twice). Solving for i we get
4t
Therefore, e i =
e4t cos(t) =
i =
4
1
cos(t) +
sin(t) + Ce4t .
17
17
4
Finally, solving for C from i(0) = 0 gives C = 17
and so, finally,
i =
4
1
4
cos(t) +
sin(t) e4t .
17
17
17
Example: Even quite innocent-looking equations can lead to impossible integrals. For example the
R
2
equation y 0 + xy = 1 leads to the IF = exp( xdx) = ex /2 and hence to the equation
ex
/2
Z
y=
ex
/2
dx,
which has no closed form. (In fact, you can always solve this sort of equation by writing ex
series in x, but that is another storyand another course.)
/2
as a power
Homogenous Equations
y
x
tx
ty
tx
y
x
=1+
= f (x, y).
3.1
x
y
y
x
tx
ty
ty
tx
x
y
y
x
= f (x, y).
y
(or y = zx)
x
dy
d
dz
=
(zx) = x
+ z.
dx
dx
dx
dy
= x + y.
dx
d
dx (xz)
dy
dx
= 1 + xy .
= 1 + z.
The Key Step 3. Expand the LHS of the equation using the product rule,
x
dz
d
+ z (x) = 1 + z
dx
dx
or
dz
+ z = 1 + z.
dx
Step 4. Hopefully (!) this can now be solved by one of the earlier techniques. In this case we can cancel
dz
the zs to get x
= 1. This can then be solved by separating variables:
dx
Z
Z
dz
1
dx
=
and so
dz =
.
dx
x
x
This has solution z = ln x + C.
Step 5. Finally substitute back z = y/x; thus
y
= ln(x) + C
x
or
y = x ln(x) + Cx.
dy
= y + xey/x
dx
y = 1 at x = 1.
y
dy
= + ey/x .
dx
x
y
x
x
Cancel the z to get x
subject to
or y = zx to get
dz
d(zx)
+z =
= z + ez .
dx
dx
dz
= ez . This can now be solved by separating variables:
dx
Z
Z
z
e dz = x1 dx,
Solution: This is not obviously homogeneous, but we make it so by dividing the top and bottom of the
fraction on RHS by x2 :
dy
=
dx
y
x
+ 1 xy
2
1 xy
Substitute in y = zx
x
dz
+z
dx
x
dz
dx
(z + 1)z
2
(1 z)
2
z +z
=
z2
1z
=
dz
z 2 z z(1 z) 2(1 z)
z 2 z z + z 2 2 + 2z
2
2
=
=
=
=
.
dx
1z
1z
1z
z1
z1
2
dz =
1
dx
x
or
z
1
2 2
dz =
1
dx
x
y
x
to get
y2
y
= ln x + c.
2
4x
2x
With a bit of an effort you can write this as y = g(x) for some function g(x) but I really do not think it
is worth the bother.
10