68

3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We
kgriffiths
Rectangle
Page 2: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3 Di¤erential Equations

3.1 Introduction

2 Types of Di¤erential Equation (D.E)

(i) Ordinary Di¤erential Equation (O.D.E)

Equation involving (ordinary) derivatives

x; y;dy

dx;d 2y

dx2; ::::::::;

d ny

dxn(some �xed n)

y is some unknown function of x together with its derivatives, i.e.

Page 172

Page 3: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

F�x; y; y0; y00; ::::::; y (n)

�= 0 (1)

Note y4 6= y(4)

Also if y = y (t), where t is time, then we often write

�y =

dy

dt,��y =

d 2y

dt2, ......,

����y =

d 4y

dt4

Page 173

Page 4: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

(ii) Partial Di¤erential Equation (PDE)

Involve partial derivatives, i.e. unknown function dependent on two or morevariables,

e.g.

@u

@t+@2u

@x@y+@u

@z� u = 0

So here we solving for the unknown function u (x; y; z; t) :

More complicated to solve - better for modelling real-life situations, e.g. �-nance, engineering & science.

In quant �nance there is no concept of spatial variables, unlike other branchesof mathematics.

Page 174

Page 5: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Order of the highest derivative is the order of the DE

An ode is of degree r ifd ny

dxn(where n is the order of the derivative) appears

with power r

�r�Z+

�� the de�nition of n and r is distinct. Assume that any ode has the

property that each

d`y

dx`appears in the form

d`y

dx`

!r! dny

dxn

!rorder n and degree r.

Page 175

Page 6: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Examples:

DE order degree(1) y0 = 3y 1 1(2)

�y0�3 + 4 sin y = x3 1 3

(3)�y(4)

�2+ x2

�y(2)

�5+�y0�6 + y = 0 4 2

(4) y00 =py0 + y + x 2 2

(5) y00 + x�y0�3 � xy = 0 2 1

Note - example (4) can be written as�y00�2 = y0 + y + x

Page 176

Page 7: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

We will consider ODE�s of degree one, and of the form

an (x)dnydxn + an�1 (x)

dn�1ydxn�1

+ ::::+ a1 (x)dydx + a0 (x) y = g(x)

�nXi=0

ai (x) y(i) (x) = g (x) (more pedantic)

Note: y(0) (x) - zeroth derivative, i.e. y(x):

This is a Linear ODE of order n, i.e. r = 1 8 (for all) terms. Linear alsobecause ai (x) not a function of y(i) (x) - else equation is Non-linear.

Page 177

Page 8: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Examples:

DE Nature of DE(1) 2xy00 + x2y0 � (x+ 1) y = x2 Linear(2) yy00 + xy0 + y = 2 a2 = y ) Non-Linear

(3) y00 +py0 + y = x2 Non-Linear * �y0�12

(4)d4y

dx4+ y4 = 0 Non-Linear - y4

Our aim is to solve our ODE either explicitly or by �nding the most generaly (x) satisfying it or implicitly by �nding the function y implicitly in terms ofx, via the most general function g s.t g (x; y) = 0.

Page 178

Page 9: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Suppose that y is given in terms of x and n arbitrary constants of integrationc1, c2, ......., cn.

So eg (x; c1; c2; :::::::; cn) = 0. Di¤erentiating eg, n times to get (n+ 1)equations involving

c1; c2; :::::::; cn; x; y; y0; y00; ::::::; y (n).

Eliminating c1; c2; :::::::; cn we get an ODE

ef �x; y; y0; y00; ::::::; y (n)

�= 0

Page 179

Page 10: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Examples:

(1) y = x3 + ce�3x (so 1 constant c)

) dy

dx= 3x2 � 3ce�3x, so eliminate c by taking 3y + y0 = 3x3 + 3x2; i.e.

�3x2 (x+ 1) + 3y + y0 = 0(2) y = c1e�x + c2e2x (2 constant�s so di¤erentiate twice)

y0 = �c1e�x + 2c2e2x ) y00 = c1e�x + 4c2e2x

Now

y + y0 = 3c2e2x (a)y0 + y00 = 6c2e2x (b)

)and 2(a)=(b) ) 2 � y + y0� = y + y00 !

y00 � 2y0 � y = 0.

Page 180

Page 11: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Conversely it can be shown (under suitable conditions) that the general solutionof an nth order ode will involve n arbitrary constants. If we specify values (i.e.boundary values) of

y; y0; :::::::::::; y(n)

for values of x, then the constants involved may be determined.

Page 181

Page 12: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

A solution y = y(x) of (1) is a function that produces zero upon substitutioninto the lhs of (1).

Example:

y00 � 3y0 + 2y = 0 is a 2nd order equation and y = ex is a solution.

y = y0 = y00 = ex - substituting in equation gives ex � 3ex + 2ex = 0. Sowe can verify that a function is the solution of a DE simply by substitution.

Exercise:

(1) Is y(x) = c1 sin 2x + c2 cos 2x (c1,c2 arbitrary constants) a solution ofy00 + 4y = 0

(2) Determine whether y = x2 � 1 is a solution of�dy

dx

�4+ y2 = �1

Page 182

Page 13: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.1.1 Initial & Boundary Value Problems

A DE together with conditions, an unknown function y (x) and its derivatives,all given at the same value of independent variable x is called an Initial ValueProblem (IVP).

e.g. y00+2y0 = ex; y (�) = 1, y0 (�) = 2 is an IVP because both conditionsare given at the same value x = �.

A Boundary Value Problem (BVP) is a DE together with conditions givenat di¤erent values of x, i.e. y00 + 2y0 = ex; y (0) = 1, y (1) = 1.

Here conditions are de�ned at di¤erent values x = 0 and x = 1.

A solution to an IVP or BVP is a function y(x) that both solves the DE andsatis�es all given initial or boundary conditions.

Page 183

Page 14: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Exercise: Determine whether any of the following functions

(a) y1 = sin 2x (b) y2 = x (c) y3 =12 sin 2x is a solution of the IVP

y00 + 4y = 0; y (0) = 0; y0 (0) = 1

Page 184

Page 15: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.2 First Order Ordinary Di¤erential Equations

Standard form for a �rst order DE (in the unknown function y (x)) is

y0 = f (x; y) (2)

so given a 1st order ode

F�x; y; y0

�= 0

can often be rearranged in the form (2), e.g.

xy0 + 2xy � y = 0) y0 =y � 2xx

Page 185

Page 16: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.2.1 One Variable Missing

This is the simplest case

y missing:

y0 = f (x) solution is y =Zf(x)dx

x missing:

y0 = f (y) solution is x =Z

1

f(y)dy

Example:

y0 = cos2 y , y =�

4when x = 2

) x =Z

1

cos2 ydy =

Zsec2 y dy ) x = tan y + c ,

c is a constant of integration.

Page 186

Page 17: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

This is the general solution. To obtain a particular solution use

y (2) =�

4! 2 = tan

4+ c) c = 1

so rearranging gives

y = arctan (x� 1)

Page 187

Page 18: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.2.2 Variable Separable

y0 = g (x)h (y) (3)

So f (x; y) = g (x)h (y) where g and h are functions of x only and y onlyin turn. So

dy

dx= g (x)h (y)!

Zdy

h (y)=Zg (x) dx+ c

c � arbitrary constant.

Two examples follow on the next page:

Page 188

Page 19: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

dy

dx=

x2 + 2

yZy dy =

Z �x2 + 2

�dx! y2

2=x3

3+ 2x+ c

dy

dx= y lnx subject to y = 1 at x = e (y (e) = 1)

Zdy

y=Zlnx dx Recall:

Zlnx dx = x (lnx� 1)

ln y = x (lnx� 1) + c! y = A exp (x lnx� x)

A � arb. constant

now putting x = e, y = 1 gives A = 1. So solution becomes

y = exp (lnxx) exp (�x)! y =xx

ex) y =

�x

e

�x

Page 189

Page 20: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.2.3 Linear Equations

These are equations of the form

y0 + P (x) y = Q (x) (4)

which are similar to (3), but the presence of Q (x) renders this no longerseparable. We look for a function R(x), called an Integrating Factor (I.F)so that

R(x) y0 +R(x)P (x) y =d

dx(R(x)y)

So upon multiplying the lhs of (4), it becomes a derivative of R(x)y, i.e.

R y0 +RPy = Ry0 +R0y

from (4) :

Page 190

Page 21: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

This gives RPy = R0y ) R(x)P (x) =dR

dx, which is a DE for R which is

separable, hence ZdR

R=ZPdx+ c! lnR =

ZPdx+ c

So R(x) = K exp (RP dx), hence there exists a function R(x) with the

required property. Multiply (4) through by R(x)

R(x)hy0 + P (x)y

i| {z }

= ddx(R(x)y)

= R(x)Q(x)

d

dx(Ry) = R(x)Q(x)! R(x)y =

ZR(x)Q(x)dx+B

B � arb. constant.

We also know the form of R(x)!

yK exp�Z

P dx

�=ZK exp

�ZP dx

�Q(x)dx+B:

Page 191

Page 22: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Divide through by K to give

y exp�Z

P dx

�=Zexp

�ZP dx

�Q(x)dx+ constant.

So we can take K = 1 in the expression for R(x).

To solve y0 + P (x) y = Q (x) calculate R(x) = exp (RP dx), which is the

I.F.

Page 192

Page 23: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Examples:

1. Solve y0 � 1

xy = x2

In this case c.f (4) gives P (x) � �1x& Q(x) � x2, therefore

I.F R(x) = exp�R�1xdx

�= exp (� lnx) = 1

x. Multiply DE by

1

x!

1

x

�y0 � 1

xy

�= x) d

dx

�y

x

�= x!

Zd�x�1y

�=

Zxdx+ c

) y

x=x2

2+ c ) GS is y = x3

2+ cx

Page 193

Page 24: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

2. Obtain the general solution of (1 + yex)dx

dy= ex

dy

dx= (1 + yex) e�x = e�x + y )

dy

dx� y = e�x

Which is a linear equation, with P = �1; Q = e�x

I.F R(y) = exp�Z

�dx�= e�x

so multiplying DE by I.F

e�x�y0 � y

�= e�2x ! d

dx

�ye�x

�= e�2x )Z

d�ye�x

�=

Ze�2xdx

ye�x = �12e�2x + c ) y = cex � 1

2e�x is the GS.

Page 194

Page 25: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.3 Second Order ODE�s

Typical second order ODE (degree 1) is

y00 = f�x; y; y0

�solution involves two arbitrary constants.

3.3.1 Simplest Cases

A y0, y missing, so y00 = f (x)

Integrate wrt x (twice): y =R(Rf (x) dx) dx

Example: y00 = 4x

Page 195

Page 26: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

GS y =Z �Z

4x dx�dx =

Z h2x2 + C

idx =

2x3

3+ Cx+D

B y missing, so y00 = f�y0; x

Put P = y0 ! y00 =dP

dx= f (P; x), i.e. P 0 = f (P; x) - �rst order ode

Solve once ! P (x)

Solve again ! y(x)

Example: Solve xd 2y

dx2+ 2

dy

dx= x3

Note: A is a special case of B

Page 196

Page 27: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

C y0 and x missing, so y00 = f (y)

Put p = y0, then

d 2y

dx2=

dp

dx=dp

dy

dy

dx= p

dp

dy= f (y)

So solve 1st order ode

pdp

dy= f (y)

which is separable, so

Zp dp =

Zf ( y) dy !

Page 197

Page 28: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

1

2p2 =

Zf (y) dy + const.

Example: Solve y3y00 = 4

) y00 =4

y3. Put p = y0 ! d2y

dx2= p

dp

dy=4

y3

) R p dp = Z4

y3dy ) p2 = � 4

y2+D ) p =

�qDy2 � 4y

, so from our

de�nition of p,

dy

dx=�qDy2 � 4y

)Zdx =

Z � yqDy2 � 4

dy

Page 198

Page 29: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Integrate rhs by substitution (i.e. u = Dy2 � 4) to give

x =�qDy2 � 4D

+ E !hD (x� E)2

i= Dy2 � 4

) GS is Dy2 �D2 (x� E)2 = 4

D x missing: y00 = f�y0; y

Put P = y0, sod2y

dx2= P

dP

dy= f (P; y) - 1st order ODE

Page 199

Page 30: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.3.2 Linear ODE�s of Order at least 2

General nth order linear ode is of form:

an (x) y(n) + an�1 (x) y

(n�1) + :::::::+ a1 (x) y0 + a0 (x) y = g(x)

Use symbolic notation:

D � d

dx; Dr � d r

dx rso Dry � d ry

dx r

) arDr � ar(x)d r

dx rso

arDry = ar(x)

d ry

dx r

Now introduce

L = anDn + an�1D

n�1 + an�2Dn�2 + ::::::::::::+ a1D + a0

so we can write a linear ode in the form

L y = g

Page 200

Page 31: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

L� Linear Di¤erential Operator of order n and its de�nition will be usedthroughout.

If g (x) = 0 8x, then L y = 0 is said to be HOMOGENEOUS.

L y = 0 is said to be the homogeneous part of L y = g:

L is a linear operator because as is trivially veri�ed:

(1) L (y1 + y2) = L (y1) + L(y2)

(2) L (cy) = cL (y) c 2 R

GS of Ly = g is given by

y = yc + yp

Page 201

Page 32: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

where yc� Complimentary Function & yp� Particular Integral (or ParticularSolution)

yc is solution of Ly = 0yp is solution of Ly = g

)) GS y = yc + yp

Look at homogeneous case Ly = 0. Put s = all solutions of Ly = 0. Thens forms a vector space of dimension n. Functions y1 (x) ; :::::::::::; yn(x)are LINEARLY DEPENDENT if 9 �1; :::::::::; �n 2 R (not all zero) s.t

�1y1 (x) + �2y2 (x) + :::::::::::+ �nyn(x) = 0

Otherwise yi�s (i = 1; :::::; n) are said to be LINEARLY INDEPENDENT(Lin. Indep.) ) whenever

�1y1 (x) + �2y2 (x) + :::::::::::+ �nyn(x) = 0 8x

then �1 = �2 = ::::::::: = �n = 0:

Page 202

Page 33: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

FACT:

(1) L� nth order linear operator, then 9 n Lin. Indep. solutions y1; :::::; ynof Ly = 0 s.t GS of Ly = 0 is given by

y = �1y1 + �2y2 + :::::::::::+ �nyn �i 2 R1� i � n

.

(2) Any n Lin. Indep. solutions of Ly = 0 have this property.

To solve Ly = 0 we need only �nd by "hook or by crook" n Lin. Indep.solutions.

Page 203

Page 34: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.3.3 Linear ODE�s with Constant Coe¢ cients

Consider Homogeneous case: Ly = 0 .

All basic features appear for the case n = 2, so we analyse this.

L y = ad2y

dx2+ b

dy

dx+ cy = 0 a; b; c 2 R

Try a solution of the form y = exp (�x)

L�e�x

�=�aD2 + bD + c

�e�x

hence a�2 + b�+ c = 0 and so � is a root of the quadratic equation

a�2 + b�+ c = 0 AUXILLIARY EQUATION (A.E)

Page 204

Page 35: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

There are three cases to consider:

(1) b2 � 4ac > 0

So �1 6= �2 2 R, so GS is

y = c1 exp (�1x) + c2 exp (�2x)

c1, c2 � arb. const.

(2) b2 � 4ac = 0

So � = �1 = �2 = �b

2a

Page 205

Page 36: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Clearly e�x is a solution of L y = 0 - but theory tells us there exist twosolutions for a 2nd order ode. So now try y = x exp (�x)

L�xe�x

�=

�aD2 + bD + c

� �xe�x

�=

�a�2 + b�+ c

�| {z }

=0

�xe�x

�+ (2a�+ b)| {z }

=0

�e�x

�= 0

This gives a 2nd solution ) GS is y = c1 exp (�x) + c2x exp (�x), hence

y = (c1 + c2x) exp (�x)

(3) b2 � 4ac < 0

So �1 6= �2 2 C - Complex conjugate pair � = p� iq where

p = � b

2a, q =

1

2a

r���b2 � 4ac��� (6= 0)

Page 206

Page 37: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Hence

y = c1 exp (p+ iq)x+ c2 exp (p� iq)x= c1e

pxeiq + c2epxe�iq = epx

�c1e

iqx + c2e�iqx�

Eulers identity gives exp (�i�) = cos � � i sin �

Simplifying (using Euler) then gives the GS

y (x) = epx (A cos qx+B sin qx)

Examples:

(1) y00 � 3y0 � 4y = 0

Put y = e�x to obtain A.E

A.E: �2 � 3� � 4 = 0 ! (�� 4) (�+ 1) = 0 ) � = 4 & �1 - 2distinct R roots

GS y (x) = Ae4x +Be�x

Page 207

Page 38: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

(2) y00 � 8y0 + 16y = 0

A.E �2 � 8�+ 16 = 0! (�� 4)2 = 0) � = 4 , 4 (2 fold root)

�go up one�, i.e. instead of y = e�x, take y = xe�x

GS y (x) = (C +Dx) e4x

(3) y00 � 3y0 + 4y = 0

A.E: �2 � 3�+ 4 = 0! � =3�

p9� 162

=3� i

p7

2� p� iq

p =

3

2, q =

p7

2

!

y = e32x

a cos

p7

2x+ b sin

p7

2x

!

Page 208

Page 39: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.4 General nth Order Equation

Consider

Ly = any(n) + an�1y

(n�1) + ::::::::::+ a1y0 + a0y = 0

then

L � anDn + an�1Dn�1 + an�2Dn�2 + :::::::+ a1D + a0

so Ly = 0 and the A.E becomes

an�n + an�1�

n�1 + :::::::::::::+ a1�+ a0 = 0

Page 209

Page 40: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Case 1 (Basic)

n distinct roots �1; :::::::::; �n then e�1x, e�2x, ........, e�nx are n Lin. Indep.solutions giving a GS

y = �1e�1x + �2e

�2x + ::::::::+ �ne�nx

�i� arb.

Case 2

If � is a real r� fold root of the A.E then e�x, xe�x, x2e�x,.........., xr�1e�x

are r Lin. Indep. solutions of Ly = 0, i.e.

y = e�x��1 + �2x+ �3x

2::::::::+ �r xr�1�

�i� arb.

Page 210

Page 41: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Case 3

If � = p+ iq is a r - fold root of the A.E then so is p� iq

epx cos qx, xepx cos qx, ..........,xr�1epx cos qxepx sin qx, xepx sin qx, ............,xr�1epx sin qx

)! 2r Lin. Indep. solutions of L y = 0

GS y = epx�c1 + c2x+ c3x

2 + ::::::::::::�cos qx+

epx�C1 + C2x+ C3x

2 + ::::::::::::�sin qx

Page 211

Page 42: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Examples: Find the GS of each ODE

(1) y(4) � 5y00 + 6y = 0

A.E: �4 � 5�2 + 6 = 0 !��2 � 2

� ��2 � 3

�= 0

So � = �p2 , � = �

p3 - four distinct roots

) GS y = Aep2x +Be�

p2x + Ce

p3x +De�

p3x (Case 1)

(2)d 6y

dx6� 5d

4y

dx4= 0

A.E: �6 � 5�4 = 0 roots: 0; 0; 0; 0; �p5

GS y = Aep5x +Be�

p5x +

�C +Dx+ Ex2 + Fx3

�(* exp(0) = 1)

Page 212

Page 43: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

(3)d 4y

dx4+ 2

d 2y

dx2+ y = 0

A.E: �4 + 2�2 + 1 =��2 + 1

�2= 0 � = �i is a 2 fold root.

Example of Case (3)

y = A cosx+Bx cosx+ C sinx+Dx sinx

Page 213

Page 44: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.5 Non-Homogeneous Case - Method of Undetermined

Coe¢ cients

GS y = C.F+ P.I

C.F comes from the roots of the A.E

There are three methods for �nding P.I

(a) "Guesswork" - which we are interested in

(b) Annihilator

(c) D-operator Method

Page 214

Page 45: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

(a) Guesswork Method

If the rhs of the ode g (x) is of a certain type, we can guess the form of P.I.We then try it out and determine the numerical coe¢ cients.

The method will work when g(x) has the following forms

i. Polynomial in x g (x) = p0 + p1x+ p2x2 + ::::::::::+ pmxm.

ii. An exponential g (x) = Cekx (Provided k is not a root of A.E).

iii. Trigonometric terms, g(x) has the form sin ax, cos ax (Provided ia isnot a root of A.E).

iv. g (x) is a combination of i. , ii. , iii. provided g (x) does not contain partof the C.F (in which case use other methods).

Page 215

Page 46: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Examples:

(1) y00 + 3y0 + 2y = 3e5x

The homogeneous part is the same as in (1), so yc = Ae�x + Be�2x. Forthe non-homog. part we note that g (x) has the form ekx, so try yp = Ce5x,and k = 5 is not a solution of the A.E.

Substituting yp into the DE gives

C�52 + 15 + 2

�e5x = 3e5x ! C =

1

14

) y = Ae�x +Be�2x + 1

14e5x

Page 216

Page 47: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

(2) y00 + 3y0 + 2y = x2

GS y = C.F + P.I = yc + yp

C.F: A.E gives

�2 + 3�+ 2 = 0) � = �1; �2 ) yc = ae�x + be�2x

P.I Now g(x) = x2,

so try yp = p0 + p1x+ p2x2 ! y0p = p1 + 2p2x ! y00p = 2p2

Now substitute these in to the DE, ie

2p2+ 3 (p1 + 2p2x) + 2�p0 + p1x+ p2x

2�= x2 and equate coe¢ cients of

xn

O�x2�: 2p2 = 1) p2 =

12

Page 217

Page 48: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

O (x) : 6p2 + 2p1 = 0) p1 = �32

O�x0�: 2p2 + 3p1 + 2p0 = 0) p0 =

74

) GS y = ae�x + be�2x +7

4� 32x+

1

2x2

Page 218

Page 49: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

(3) y00 � 5y0 � 6y = cos 3x

A.E: �2 � �� 6 = 0) � = �1, 6) yc = �e�x + �e6x

Guided by the rhs, i.e. g (x) is a trigonometric term, we can try yp =

A cos 3x+B sin 3x;and calculate the coe¢ cients A and B:

How about a more sublime approach? Put yp = ReKei3x for the unknowncoe¢ cient K:

! y0p = 3Re iKei3x ! y 00p = �9ReKei3x and substitute into the DE,dropping Re

(�9� 15i� 6)Kei3x = ei3x

�15 (1 + i)K = 1

�15K =1

1 + i�! K =

1

2(1� i)

Page 219

Page 50: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Hence K = � 130 (1� i) to give

yp = � 1

30Re (1� i) (cos 3x+ i sin 3x)

= � 1

30(cos 3x+ i sin 3x� i cos 3x+ sin 3x)

so general solution becomes

y = �e�x + �e6x � 1

30(cos 3x+ sin 3x)

Page 220

Page 51: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.5.1 Failure Case

Consider the DE y00 � 5y0 + 6y = e2x, which has a CF given by y (x) =�e2x + �e3x. To �nd a PI, if we try yp = Ae2x, we have upon substitution

Ae2x [4� 10 + 6] = e2x

so when k (= 2) is also a solution of the C.F , then the trial solution yp =Aekx fails, so we must seek the existence of an alternative solution.

Page 221

Page 52: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Ly = y00 + ay0 + b = �ekx - trial function is normally yp = Cekx:

If k is a root of the A.E then L�Cekx

�= 0 so this substitution does not

work. In this case, we try yp = Cxekx - so �go one up�.

This works provided k is not a repeated root of the A.E, if so try yp = Cx2ekx,and so forth ....

Page 222

Page 53: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.6 Linear ODE�s with Variable Coe¢ cients - Euler Equa-

tion

In the previous sections we have looked at various second order DE�s withconstant coe¢ cients. We now introduce a 2nd order equation in which thecoe¢ cients are variable in x. An equation of the form

L y = ax2d2y

dx2+ �x

dy

dx+ cy = g (x)

is called a Cauchy-Euler equation. Note the relationship between the coe¢ cient

and corresponding derivative term, ie an (x) = axn andd ny

dxn, i.e. both power

and order of derivative are n.

Page 223

Page 54: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

The equation is still linear. To solve the homogeneous part, we look for asolution of the form

y = x�

So y0 = �x��1 ! y00 = � (�� 1)x��2 , which upon substitution yields thequadratic, A.E.

a�2 + b�+ c = 0

[where b = (� � a)] which can be solved in the usual way - there are 3 casesto consider, depending upon the nature of b2 � 4ac.

Page 224

Page 55: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Case 1: b2 � 4ac > 0! �1, �2 2 R - 2 real distinct roots

GS y = Ax�1 +Bx�2

Case 2: b2 � 4ac = 0! � = �1 = �2 2 R - 1 real (double fold) root

GS y = x� (A+B lnx)

Case 3: b2 � 4ac < 0 ! � = � � i� 2 C - pair of complex conjugateroots

GS y = x� (A cos (� lnx) +B sin (� lnx))

Page 225

Page 56: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Example 1 Solve x2y00 � 2xy0 � 4y = 0

Put y = x� ) y0 = �x��1 ) y00 = � (�� 1)x��2 and substitutein DE to obtain (upon simpli�cation) the A.E. �2 � 3� � 4 = 0 !(�� 4) (�+ 1) = 0

) � = 4 & �1 : 2 distinct R roots. So GS is

y (x) = Ax4 +Bx�1

Example 2 Solve x2y00 � 7xy0 + 16y = 0

So assume y = x�

A.E �2 � 8�+ 16 = 0) � = 4 , 4 (2 fold root)

�go up one�, i.e. instead of y = x�, take y = x� lnx to give

y (x) = x4 (A+B lnx)

Page 226

Page 57: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Example 3 Solve x2y00 � 3xy0 + 13y = 0

Assume existence of solution of the form y = x�

A.E becomes �2 � 4�+ 13 = 0! � =4�

p16� 522

=4� 6i2

�1 = 2 + 3i, �2 = 2� 3i � �� i� (� = 2, � = 3)

y = x2 (A cos (3 lnx) +B sin (3 lnx))

Page 227

Page 58: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.6.1 Reduction to constant coe¢ cient

The Euler equation considered above can be reduced to the constant coe¢ cientproblem discussed earlier by use of a suitable transform. To illustrate this simpletechnique we use a speci�c example.

Solve x2y00 � xy0 + y = lnx

Use the substitution x = et i.e. t = lnx. We now rewrite the the equationin terms of the variable t, so require new expressions for the derivatives (chainrule):

dy

dx=dy

dt

dt

dx=1

x

dy

dt

Page 228

Page 59: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

d 2y

dx2=

d

dx

�dy

dx

�=d

dx

�1

x

dy

dt

�=1

x

d

dx

dy

dt� 1

x2dy

dt

=1

x

dt

dx

d

dt

dy

dt� 1

x2dy

dt=1

x2d2y

dt2� 1

x2dy

dt

) the Euler equation becomes

x2 1

x2d2y

dt2� 1

x2dy

dt

!� x

�1

x

dy

dt

�+ y = t !

y00 (t)� 2y0 (t) + y = t

The solution of the homogeneous part , ie C.F. is yc = et (A+Bt) :

The particular integral (P.I.) is obtained by using yp = p0 + p1t to giveyp = 2 + t

Page 229

Page 60: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

The GS of this equation becomes

y (t) = et (A+Bt) + 2 + t

which is a function of t . The original problem was y = y (x), so we use ourtransformation t = lnx to get the GS

y = x (A+B lnx) + 2 + lnx.

Page 230

Page 61: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.7 Partial Di¤erential Equations

The formation (and solution) of PDE�s forms the basis of a large numberof mathematical models used to study physical situations arising in science,engineering and medicine.

More recently their use has extended to the modelling of problems in �nanceand economics.

We now look at the second type of DE, i.e. PDE�s. These have partialderivatives instead of ordinary derivatives.

One of the underlying equations in �nance, the Black-Scholes equation for theprice of an option V (S; t) is an example of a linear PDE

@V

@t+1

2�2S2

@2V

@S2+ (r �D)S@V

@S� rV = 0

Page 231

Page 62: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

providing �; D; r are not functions of V or any of its derivatives.

If we let u = u (x; y) ; then the general form of a linear 2nd order PDE is

A@2u

@x2+B

@2u

@x@y+ C

@2u

@y2+D

@u

@x+ E

@u

@y+ Fu = G

where the coe¢ cients A; ::::; G are functions of x & y:

When

G (x; y) =

(0 (1) is homogeneous

non-zero (1) is non-homogeneous

hyperbolic B2 � 4AC > 0

parabolic B2 � 4AC = 0

elliptic B2 � 4AC < 0

Page 232

Page 63: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

In the context of mathematical �nance we are only interested in the 2nd type,i.e. parabolic.

There are several methods for obtaining solutions of PDE�s.

We look at a simple (but useful) technique:

Page 233

Page 64: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

3.7.1 Method of Separation of Variables

Without loss of generality, we solve the one-dimensional heat equation

@u

@t= c2

@2u

@x2(*)

for the unknown function u (x; t) :

In this method we assume existence of a solution which is a product of afunction of x (only) and a function of y (only). So the form is

u (x; t) = X (x)T (t) :

We substitute this in (*), so

@u

@t=

@

@t(XT ) = XT 0

@2u

@x2=

@

@x

�@

@x(XT )

�=@

@x

�X 0T

�= X 00T

Page 234

Page 65: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Therefore (*) becomes

X T 0 = c2X 00 T

dividing through by c2X T gives

T 0

c2T=X 00

X:

The RHS is independent of t and LHS is independent of x:

So each equation must be a constant. The convention is to write this constantas �2 or ��2:

There are possible cases:

Case 1: �2 > 0

T 0

c2T=X 00

X= �2 leading to

T 0 � �2c2T = 0X 00 � �2X = 0

)

Page 235

Page 66: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

which have solutions, in turn

T (t) = k exp�c2�2t

�X (x) = A cosh (�x) +B sinh (�x)

)So solution is

u (x; t) = X T = k exp�c2�2t

�fA cosh (�x) +B sinh (�x)g

Therefore u = exp�c2�2t

�f� cosh (�x) + � sinh (�x)g

(� = Ak; � = Bk)

Page 236

Page 67: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Case 2: ��2 < 0

T 0

c2T=X 00

X= ��2 which gives

T 0 + �2c2T = 0X 00 + �2X = 0

)

resulting in the solutions

T = k exp��c2�2t

�X = A cos (�x) +B sin (�x)

)respectively.

Hence

u (x; t) = exp��c2�2t

�f cos (�x) + � sin (�x)g

where� = kA; � = kB

�:

Page 237

Page 68: 3 Di⁄erential Equations€¦ · 5 + y0 6 + y = 0 4 2 (4) y00 = p y0 + y + x 2 2 (5) y00 + x y0 3 xy = 0 2 1 Note - example (4) can be written as y00 2 = y0 + y + x Page 176. We

Case 3: �2 = 0

T 0 = 0X 00 = 0

)! T (t) = eA

X = eBx+ eC)

which gives the simple solution

u (x; y) = bAx+ bCwhere

� bA = eA eB; bC = eB eC� :

Page 238