Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ODEs PartI

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

1

ORDINARY DIFFERENTIAL EQUATIONS

DEs are very important in engineering mathematics because many physical laws and relations
are in this form of equations mathematically. For the rest of this course, we will consider
several physical and geometrical problems that lead to DEs and we will try to explore some of
the important standard methods for solving such equations.

An ODE is an equation that contains one or several derivatives of an unknowm function,


which we call y(x). Equation may also contain y itself and given functions of x and constants.

For example: y’=cosx (y’: y prime)

y’’+4x=0

x2y’’’y’+2exy’’=(x2+2)y2

These are all ODEs.

The word ‘ordinary’ means that the unknown function depends on only one variable. That
makes it different than the ‘partial’ DEs where unknown functions depend on 2 or more
variables. So, they are more complex, and will be considered at the end of semester.

DEs can be seen in many engineering problems as mathematical models of several physical
and other systems. The simplest ones can be solved by remembering elementary calculus.

More complicated models need more detailed methods to be solved, which we will discuss
systematically.

Let’s begin with a classification of DEs according to their order.

The order of a DE is the order of the highest derivative in the equation.

First order ODEs:

We begin to study ODEs and their applications by considering the simplest of these
equations: These are called differential equations of first order. They involve only the first
derivative of the unknown function, and may contain y and given functions of x. So they
could be written as,

F(x,y,y’)=0 or y’=f(x,y) here y’=dy/dx

Separable differential equations:

Many DEs can be reduced to the form,

g(y)y’=f(x) by algebraic manipulations


2

Since y’=dy/dx, it can be written as

g(y)dy=f(x)dx

Such an equation is called ‘separable equation’, because the variables x & y are separated so
that x appears only on the right hand side, and y on the left hand side.

To solve, we should integrate both sides, obtaining,

ò g ( y)dy = ò f ( x)dx + C

Examples:

1) 9 yy '+4 x = 0
ò 9 ydy = - ò 4 xdx
y2 x2
9 = -4 +C
2 2
9 y 2 + 4x 2 + C' = 0 C ' = -2C
x2 y2
+ = C' '
9 4 This represents an ellipse

2) dy
= 1- y2
dx
dy
ò 1 - y 2 = ò dx
arctan y = x + C
y = tan( x + C )

3) dy
= ky
dx
dy
ò y = ò kdx
ln y = kx + C
y = e ( kx +C ) = e kx e C = C ' e kx

4) dy
= -2 xy
dx
dy
ò y = -2ò xdx
ln y = - x 2 + C
2
y = C' e -x
3

Summary: Solution to ODE of the form g(y)y’=f(x) is ò g ( y)dy = ò f ( x)dx + C

Reduction to separable form:

Some 1st order DEs are not separable, but can be made separable by a simple change of
variable.
y
y' = g ( ) (1) Where g is any given fct of y/x; for example (y/x)3, sin(y/x), etc
x

The form of equation suggests us to set

y/x=u

By manipulating it by x à y=ux

By product differentiation à y’=u+xu’ (u’=du/dx)

By substituting into the 1st eqn à u+xu’=g(u)


du dx
Now we may separate the variables u and x à xu’=g(u)-u à =
g (u ) - u x
If we integrate both sides, and in the result, replace u back again by y/x, we can obtain the
general solution of 1st equation.

Examples:

1) 2 xyy' = y 2 - x 2
y2 - x2 y2 x2
y' = = -
2 xy 2 xy 2 xy
y x 1æ y xö
y' = - = çç - ÷÷
2x 2 y 2 è x y ø

Let u=y/x & y’=u’x+u


1 1 1 1
u' x + u = (u - ) ® u ' x = u - -u
2 u 2 2u
1æ 1ö u2 +1
= - çu + ÷ = -
2è uø 2u
u2 +1
u' x = -
2u
2u dx
ò u 2 + 1 du = -ò x
1
ln(u 2 + 1) = - ln x + C = ln + C
x
2
C' y C'
u2 +1 = ® 2 +1 = ® y 2 = C' x - x 2
x x x
4

2) Sometimes the form of a given DE suggest other simple substitutions, as given in the
following example.
(2 x - 4 y + 5) y '+ x - 2 y + 3 = 0

Let v=x-2y à 2y’=1-v’ à y’=(1-v’)/2


Substitute into equation:
1 - v'
(2v + 5) +v+3= 0
2
(2v + 5)(1 - v' ) = -2(v + 3)
(2v + 5) - (2v + 5)v' = -2(v + 3)
- (2v + 5)v' = -2v - 6 - 2v - 5
- (2v + 5)v' = -4v - 11
(2v + 5)v' = 4v + 11
(2v + 5) æ 1 ö 1 4v + 11 - 1
ò 4v + 11 dv = ò dx ®ò çè1 - 4v + 11 ÷ødv = 2ò dx 2 4v + 11
1
v - ln(4v + 11) = 2 x + C
4
v = x - 2y
Þ 4 x + 8 y + ln(2 x - 8 y + 11) = C

Exact differential equations:

As you should remember from calculus, if a function u(x,y) has continuous partial derivatives,
then its total or “exact” differential is,
¶u ¶u
du = dx + dy
¶x ¶y
If u(x,y)=constant à then, du=0

Let’s show with an example,

u=x+x2y3 = c à then, du=(1+2xy3)dx+3x2y2dy = 0 or


y’=dy/dx= - (1+2xy3)/(3x2y2)

Then we can solve this DE by going backward.

The solution method is as follows:

A 1st order DE of the form

M(x,y)dx+N(x,y)dy=0 (1)
5

is called ‘exact’ if its left hand side is ‘exact’ differential

¶u ¶u
du = dx + dy
¶x ¶y (2) of a function u(x,y)

Then du=0 à u(x,y)=c (3)

[DE can be written] [by integrating to obtain general equation]

Comparing above equations (1) & (2), we can see that (1) is exact if there is a function such
that:
¶u ¶u
=M and =N (4a and 4b)
¶x ¶y

Suppose that M and N are defined and have continuous 1st partial derivatives
¶M ¶ 2u and ¶N = ¶ u
2
=
¶y ¶y¶x ¶x ¶x¶y

by the assumption of continuity, these 2nd derivatives are equal.


¶M ¶N (5)
=
¶y ¶x

This is a necessary and sufficient condition to say that the DE is exact.

From (4a), by integration with respect to x, we have,

u = ò Mdx + k (y) (6)

In this integration, y has to be regarded as a constant, and k(y) plays the role of a ‘constant’ of
the integration.

To determine k(y), we derive ¶u / ¶y from (6), use (4b) to get dk/dy, and integrate dk/dy to get
k.

Instead of (4a), (4b) may be equally used to obtain (6).

u = ò Ndy + l ( y)

Example:
( x 3 + 3xy 2 )dx + (3x 2 y + y 3 )dy = 0

Step 1. Test for exactness:

M = ( x 3 + 3xy 2 ) N = (3x 2 y + y 3 )
¶M ¶N exact
= 6 xy = 6 xy
¶y ¶x
6

Step 2. Implicit solution. Now we can solve,

u = ò Mdx + k ( y ) = ò ( x 3 + 3xy 2 )dx + k ( y )


x4 2 x
2
u= + 3y + k ( y) We need to find this term
4 2

To find k(y), differentiate this formula with respect to y and use (4b).

du 3 2 dk
= x 2y + = N = 3x 2 y + y 3
dy 2 dy
dk
= 3x 2 y + y 3 - 3x 2 y = y 3
dy
y4
k= +C
4
x4 3 2 2 y4
u= + x y + +C
4 2 4
Note that the present method gives the solution in ‘implicit’form u(x,y)=c not in
‘explicit’ form y=f(x).

Summary: Solution to exact DE, M(x,y)dx+N(x,y)dy=0 is u = ò Mdx + k (y)


Where ¶u = M ¶u
=N
¶x ¶y

Reducing to exact form:

The idea of the method here is quite simple. We somtimes have an equation,

P( x, y )dx + Q( x, y )dy = 0 (1)

That is not exact.


Let say –ydx + xdy = 0
¶M ¶N Not equal!
= -1 =1
¶y ¶x
However, if we multiply it by a suitable function F(x,y), the new equation would be exact,
and it could be solved by the method discussed before.

FPdx + FQdy = 0 (2)


2
Let’s multiply by 1/x ,
1 1
- 2
ydx + 2 xdy = 0
x x
¶M 1 ¶N 1 Equal! à Exact
=- 2 =- 2
¶y x ¶x x
7

This function F(x,y) is called an ‘integration factor’.

How to find integrating factors ? :

In simpler cases, IF’s may be found by inspection or after some trials.


In general case, the idea is:

Equation (2) is Mdx+Ndy=0 with M=FP and N=FQ and it is exact by definition of IF.
¶M ¶N ¶ ¶
So the exactness condition is = à ( FP) = ( FQ)
¶y ¶x ¶y ¶x
That is FyP+FPy=FxQ+FQx (3)

However this is complicated and useless in most cases.

So use the golden rule,


Look for an IF, depending only on “one” variable, which means F is onlya function of x or y.

Let F = F ( x) Þ Fy = 0, Fx = F '

FPy = F ' Q + FQ x
Devide by FQ and rearrange,

1 dF 1 æ ¶P ¶Q ö (4)
= ç - ÷
F dx Q çè ¶y ¶x ÷ø

R
Theorem: If (1) is such that the right hand side of (4), call it R, depends only on x, then (1)
has an integrating factor F=F(x), which is obtained by integrating (4) and taking exponents on
both sides
ln F ( x) = ò R( x)dx
F ( x) = exp( ò R( x)dx )

Similarly, if F=F(y) à Fx=0, Fy=F’

1 dF 1 æ ¶Q ¶P ö
= ç - ÷
F dy P çè ¶x ¶y ÷ø
~
R
w
~
F ( y) = exp(ò Rer
( y)dy )
8

Example: 2 sin( y 2 )dx + xy cos( y 2 )dy = 0

¶P ¶ ¶Q ¶
= (2 sin( y 2 )) = 4 y cos( y 2 ) & = ( xy cos( y 2 )) = y cos( y 2 ) Not equal!
¶y ¶y ¶x ¶x

Let F=F(x)

R=
1
Q
( Py - Qx) =
1
2
xy cos( y )
[
4 y cos( y 2 ) - y cos( y 2 ) =
3y 3
=
xy x
]
3
F ( x) = exp ò R( x)dx = exp ò dx = x 3
x

Multiply the given equation by F(x)


2 x 3 sin( y 2 )dx + x 4 y cos( y 2 )dy = 0

¶M & ¶N Equal! àExact


= 4 x 3 y cos( y 2 ) = 4 x 3 y cos( y 2 )
¶y ¶x

u = ò Mdx + k ( y ) = ò 2 x 3 sin( y 2 )dx + k ( y )


1 4
u= x sin( y 2 ) + k ( y )
2

du
= x 4 y cos( y 2 ) + k ' ( y ) = x 4 y cos( y 2 )
dy
k ' ( y ) = 0 Þ k = constant

1 4
Then, u= x sin( y 2 ) + C
2

Linear Differential Equations:

A 1st order DE can be said ‘linear’, if it can be written

y '+ p( x) y = r ( x) (1)

It is linear in y & y’. p & r may be any given function of x.


If r(x) is zero, the equation could be called ‘homogeneous’, otherwise it is said to be
‘nonhomogeneous’.

For the homogeneous equation:

y ' = - p ( x) y (2)

dy
= - p( x)dx
y
ln y = - ò p( x)dx + C *
9

By taking exponents of both sides

y( x) = Ce - ò p ( x ) dx (3)

The nonhomogeneous equation now will be solved,

First, write (1) as,

dy
+ p( x) y = r ( x)
dx
dy + p( x) ydx = r ( x)dx
( p( x) y - r ( x))dx + dy = 0
This is the form of Pdx + Qdy = 0

Where P=py-r and Q=1

Hence, in this case, integrating factor will only depend on x

1 dF é 1 dF 1 æ dP dQ öù
= p( x) ê = çç - ÷÷ú
F dx ë F dx Q è dy dx øû
è F ( x) = e ò p ( x ) dx
Multiplying the ODE with F(x) & applying product differentiation rule

e ò p ( x ) dx y'+ p( x)e ò p ( x ) dx y = r ( x)e ò p ( x ) dx


e ò p ( x ) dx ( y'+ p( x) y) = (e ò p ( x ) dx y)' = e ò p ( x ) dx r ( x)

Now, integrate with respect to x


e ò p ( x ) dx y = ò e ò p ( x ) dx r ( x)dx + C
Solve for y
[
y( x) = e- ò p ( x) dx ò e ò p( x) dx r ( x)dx + C ] (4)

This represent the general solution of (1) in the form of integral.

Summary: Solution for linear DE: [


y '+ p( x) y = r ( x) is y( x) = e- ò p( x) dx ò e ò p( x) dx r ( x)dx + C ]
10

Example: y '- y = e 2 x
y '+ p( x) y = r ( x) p=-1, r=e2x

ò p( x)dx = -ò dx = - x
General solution,

[
y ( x) = e - ò p ( x ) dx ò e ò p ( x ) dx r ( x)dx + C ]
[ ]
y ( x) = e x ò e - x e 2 x dx + C
y ( x) = e [ò e dx + C ]
x x

y ( x ) = e x (e x + C )
y ( x) = Ce x + e 2 x

Reduction to Linear form:

Bernoulli’s equation:

Certain nonlinear DEs can be reduced to linear form. The practically most famous of these is
the ‘Bernoulli’s equation’.

y'+ p( x) y = g ( x) y a (5) Where a is any real number

If a=0 or a=1 à linear equation

Otherwise a>=2 à nonlinear equation

u ( x) = [ y ( x)]
1- a
Then, let’s set

Differentiate this and substitue y’ from (5)

u ' = (1 - a) y - a y'
u ' = (1 - a) y -a ( gy a - py )
u ' = (1 - a)( g - py1-a )
Where y1-a=u

So we get the linear equation,

u '+(1 - a) pu = (1 - a) g (6)
11

Example:

Let’s take a special Bernoulli’s equation, called Verhulst equation. y'+ p( x) y = g ( x) y a


u ( x) = [ y ( x)]
1- a

a=2 à u=y -1 y'- Ay = - By 2

u ' = - y -2 y ' = - y -2 (- By 2 + Ay )
u ' = B - Ay -1
u ' = B - Au
u '+ Au = B

From (4) [
y( x) = e- ò p ( x) dx ò e ò p( x) dx r ( x)dx + C ] with p=A

ò p( x)dx = Ax and r = B
u = e [ò Be dx + C ]
- Ax Ax

éB ù
u = e - Ax ê e Ax + C ú
ëA û
B
u = Ce - Ax +
A
1 1
y= =
u Ce - Ax + B
A

Ricatti’s equation:

Another nonlinear equation type,

y'- P( x) y = Q( x) y 2 + R( x)

It may be reduced to Bernoulli equation by coordinate transformation.

If R(x)=0 à becomes Bernoulli

If R(x)≠0 à a general solution can be found whenever one specific solution y=u(x) is known.
12

The substitution y=u+1/z will transform the above equation into a linear 1st order equation in
z.

Example:
dy
x - 3 y + y 2 = 4x2 - 4x 2x(2x-2)
dx
y'- P( x) y = Q( x) y 2 + R( x)
It is obvious that y=2x is a particular solution of this ODE.

Change the variable y=2x+1/z


dy 1 dz
= 2- 2
dx z dx
1 dz 1 1
x(2 - 2 ) - 3(2 x + ) + (2 x + ) 2 = 4 x 2 - 4 x
z dx z z
x dz 3 4x 1
2x - 2 - 6x - + 4x2 + + 2 = 4x2 - 4x
z dx z z z
x dz 3 4 x 1
- + + =0
z 2 dx z z z 2
dz æ 3 ö 1
+ ç - 4÷z =
dx è x ø x

Example: Revisit the tank with a changing heating surface area.

d (T - T1 ) wtA0U 0
wC p (T - T1 ) + wC p t = (Ts - T )
dt rV0

After introducing dimensionless quantities:

dq æ 1 ö First order DE, IC: at t=0, T=T1 à at η=0, θ=0


+ ç1 + ÷q = 1
dh çè h ÷ø
13

M N
éæ 1 ö ù ¶u ¶u
dq + êçç1 + ÷÷q - 1ú dh = 0 du = dx + dy
¶x ¶y
ëè h ø û
¶M ¶N 1 Control if it is an exact equation
=0 = 1+
¶h ¶q h Not equal

To solve this differential equation, first determine F (integrating factor)

P=1, Q=p(η)θ-1

Hence, in this case integrating factor will only depend on η

¶Q æ 1 ö
R= = ç1 + ÷
¶q çè h ÷ø
[
F = exp ò R(h )dh ]
é æ 1ö ù
F = expê ò çç1 + ÷÷dh ú
ë è hø û
F = exp(h + lnh ) integratin g factor

Multiply both sides of DE by F(η):

dq æ 1ö
exp(h + lnh ) + çç1 + ÷÷q exp(h + lnh ) = exp(h + lnh )
dh è hø
Apply product differentiation rule

d (exp(h + lnh )q )
= exp(h + lnh )
dh

Integrate with respect to η:

exp(h + lnh )q = ò exp(h + lnh )dh + C


= ò exp(h ) exp(lnh )dh + C
= ò exp(h )hdh + C
14

Variable conversion,

u= η à du= dη

dv=exp(η)dη à v=exp(η) (uv’=uv-u’v)

exp(h + lnh )q = h exp(h ) - ò exp(h )dh + C


= h exp(h ) - exp(h ) + C
= exp(h )(h - 1) + C

exp(h ) exp(lnh )q = exp(h )(h - 1) + C


hq = (h - 1) + C exp(-h )
(h - 1) exp(-h )
q= +C
h h

Use IC: 0=0-1+Cexp(0) à C=1


(h - 1) 1
q= +
h h exp(h )

Summary 1st order ODEs:

F(x,y,y’)=0 or y’=f(x,y) here y’=dy/dx

Separable differential equations:

Form: g(y)y’=f(x), Solution: ò g ( y)dy = ò f ( x)dx + C

*Reduction to separable form:


y
Form: y ' = g ( ) , Solution: simple change of variable y/x=u
x
Exact differential equations:

¶u ¶u ¶u ¶u
Form: du = dx + dy where M = and N =
¶x ¶y ¶x ¶y
¶M ¶N
Should satisfy =
¶y ¶x
Solution: u = ò Mdx + k (y)
15

*Reducing to exact form:

Form: P( x, y )dx + Q( x, y )dy = 0


If does not satisfy ¶M ¶N
=
¶y ¶x
Solution: use integrating factor, F ( x) = exp( ò R( x)dx) and FPdx + FQdy = 0

Linear Differential Equations:

Form: y '+ p ( x) y = r ( x)
If r(x)=0, the equation is ‘homogeneous’, otherwise it is ‘nonhomogeneous’.
Integrating factor, F ( x) = e ò p ( x ) dx

Solution: [
y( x) = e- ò p( x) dx ò e ò p( x) dx r ( x)dx + C ]
*Reduction to Linear form:

Bernoulli’s equation:. y'+ p( x) y = g ( x) y a


If a=0 or a=1 à linear equation

Otherwise a>=2 à nonlinear equation

Set u ( x) = [ y ( x)]
1- a

Ricatti’s equation: y'- P( x) y = Q( x) y 2 + R( x)

If R(x)=0 à Bernoulli

If R(x)≠0 à a general solution.

Substitute y=u+1/z.

You might also like