sms 2308 - mathematical methods lecture notes

27
SMS 2308 - Mathematical Methods Lecture Notes Samsun Baharin Haji Mohamad September 9, 2009

Upload: others

Post on 02-Jun-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SMS 2308 - Mathematical Methods Lecture Notes

SMS 2308 - Mathematical MethodsLecture Notes

Samsun Baharin Haji Mohamad

September 9, 2009

Page 2: SMS 2308 - Mathematical Methods Lecture Notes

Chapter 1

Differential Equations

1.1 Definitions

A differential equation is an equation which involve differential coefficients ordifferentials. For example, the equations below are all differential equations.

1. exdx+ eydy = 0

2. d2xdt2

+ n2x = 0

3. y = x dydx

+ xdxdy

4.[1 +

(dydx

)2]3/2/ d

2ydx2

= c

5. dxdy− wy = a cos(pt), dy

dt+ wx = a sin(pt)

6. x∂u∂x

+ y ∂u∂y

= 2u

7. ∂2y∂t2

= c2 ∂2y∂x2

An ordinary differential equations (ODE) is differential equations whereall the differential coefficients have reference to a single independent variable.Item 1 to 5 in the list are all ODEs.

A partial differential equation (PDE) is differential equations which thereare two or more independent variables and partial differential coefficientswith respect to any of them. Item 6 and 7 are PDEs.

The ORDER of a differential equation is the order of the highest deriva-tive appearing in it.

1

Page 3: SMS 2308 - Mathematical Methods Lecture Notes

The DEGREE of a differential equation is the degree of the highestderivative occuring in it, after the equation has been expressed in a form freefrom any radicals or fractions as far as the derivatives are concerned.

From the list above, we can see that

1. Item 1 is of the first order and first degree.

2. Item 2 is of the second order and first degree.

3. Item 3 written as y dydx

= x(dydx

)2+ x is clearly of the first order but of

second degree.

4. Item 4 written as[1 +

(dydx

)2]3= c2

(d2ydx2

)2is of the second order and

second degree.

1.2 Solution of Differential Equation

A solution of a differential equation is a relation between the variables whichsatisfies the given differential equation.

y = A cos(nx+ �)

is a solution of

d2y

dx2+ ny2 = 0

The general (or complete) solution of a differential equation is that inwhich the number of arbitrary constants are equal to the order of the dif-ferential equation. Thus y = A cos(nx + �) is a solution for d2y

dx2+ ny2 = 0

as the number of arbitrary constants (A,�) are the same as the order ofd2ydx2

+ ny2 = 0.A particular solution is a solution that can be obtained from general

solution by giving particular values to the arbitrary constants. For example

y = A cos(nx+ �/4)

is the particular solution of the equation d2ydx2

+ny2 = 0 as it can be derivedfrom the general solution y = A cos(nx+ �) by putting � = �/4.

A differential equation may sometimes have an additional solution whichcannot be obtained from the general solution by assigning a particular valueto the arbitrary constant. Such a solution is called a singular solution.

2

Page 4: SMS 2308 - Mathematical Methods Lecture Notes

1.2.1 Linearly independent solution

Two solutions y1(x) and y2(x) of the differential equation

d2y

dx2+ P (x)

dy

dx+Q(x)y = 0

are said to be linearly independent if c1y1(x) + c2y2(x) = 0 such thatc1 = 0 and c2 = 0.

If c1 and c2 are not both zero, then the two solutions y1(x) and y2(x) aresaid to be linearly dependent.

If y1(x) and y2(x) any two solutions of d2ydx2

+ P (x) dydx

+ Q(x)y = 0, thentheir linear combination c1y1(x) + c2y2(x) where c1 and c2 are constants, is

also a solution of d2ydx2

+ P (x) dydx

+Q(x)y = 0.

1.3 First Order and First Degree ODE

Some special methods to find solutions for these ODEs will be discussed here,

1. Separation of Variables

2. Homogeneous equations

3. Linear equations

4. Exact equations.

1.3.1 Separation of Variables

If in a n equation, it is possible to collect all function of x and dx on oneside and all the functions of y and dy on the other side, then the variablesare said to be separable. Thus the general form of such equation is

f(x)dx = g(y)dy

Integrating both sides, we get∫f(x)dx =

∫g(y)dy + c

as its solution.

3

Page 5: SMS 2308 - Mathematical Methods Lecture Notes

Example 1 Solvedy

dx=x(2 log x+ 1)

sin y + y cos y

We separate them into

(sin y + y cos y)dy = (x(2 log x+ 1))dx

Integrating both side, we get∫sin ydy +

∫y cos ydy = 2

∫log x ⋅ xdx+ 2

∫xdx

− cos y +

[y sin y −

∫sin y ⋅ 1dy + c

]= 2

[(log x ⋅ x

2

2−∫

1

x⋅ x

2

2dx

)+x2

2

]− cos y + y sin y + cos y + c = 2x2 log x− x2

2+x2

2

Hence the solution is2x2 log x− y sin y = c

Example 2 Solvedy

dx= e3x−2y + x2e−2y

We separate them intoe2ydy = (e3x + x2)dx

Integrating both side, we get∫e2ydy =

∫(e3x + x2)dx+ c

e2y

2=e3x

3+x3

3+ c

Hence the solution is3e2y = 2(e3x + x3) + 6c

Example 3 Solve

dy

dx= sin(x+ y) + cos(x+ y)

Setting x+ y = t so that dy/dx = dt/dx− 1. The given equation becomes

dt

dx− 1 = sin t+ cos t

dx =dt

1 + sin t+ cos t

4

Page 6: SMS 2308 - Mathematical Methods Lecture Notes

Integrating both side, we get∫dx =

∫dt

1 + sin t+ cos t+ c

x =

∫2d�

1 + sin 2� + cos 2�+ c (setting t = 2�)

=

∫2d�

2 cos2 � + 2 sin � cos �c

=

∫sec2 �

1 + tan �d� + c

= log(1 + tan �) + c

Hence the solution is

x = log

[1 + tan

1

2(x+ y)

]+ c

Example 4 Solve

y

x

dy

dx+

x2 + y2 − 1

2(x2 + y2) + 1= 0

Setting x2 + y2 = t, we get

2x+ 2ydy

dx=dt

dx

ory

x

dy

dx=

1

2x

dt

dx− 1

The given equation becomes

1

2x

dt

dx− 1 +

t− 1

2t+ 1= 0

1

2x

dt

dx= 1− t− 1

2t+ 1=

t+ 2

2t+ 1

2xdx =2t+ 1

t+ 2dt

2xdx =

(2− 3

t+ 2

)dt

Integrating both side, we get∫2xdx =

∫ (2− 3

t+ 2

)dt+ c

x2 = 2t− 3 log(t+ 2) + c

Hence the solution is

x2 + 2y2 − 3 log(x2 + y2 + 2) + c = 0

5

Page 7: SMS 2308 - Mathematical Methods Lecture Notes

1.3.2 Homogeneous Equations

Homogeneous equations are of the form

dy

dx=f(x, y)

g(x, y)

where f(x, y) and g(x, y) are homogeneous functions of the same degree in xand y.

To solve a homogeneous equation,

1. Set y = ux, then dydx

= u+ xdudx

2. Separate the variables u and x, and integrate.

Example 1 Solve(x2 − y2)dx− xydy = 0

Rearrange the equation, we get

dy

dx=x2 − y2

xy

Setting y = ux, then dydx

= u+ xdudx

, the equation becomes,

u+ xdu

dx=

1− u2

u

xdu

dx=

1− 2u2

u

Separating the variables, we get

u

1− 2u2du =

dx

x

Integrating both sides, we get∫u

1− 2u2du =

∫dx

x+ c

−1

4

∫−4u

1− 2u2du =

∫dx

x+ c

−1

4log(1− 2u2) = log x+ c

4 log x+ log(1− 2u2) = −4c

log x4(1− 2u2) = −4c

x4(

1− 2y2

x2

)= e−4c = c′ (Set u = y/x)

6

Page 8: SMS 2308 - Mathematical Methods Lecture Notes

Hence the solution isx2(x2 − 2y2) = c′

Example 2 Solve(x tan

y

x− y sec2

y

x

)dx+

(x sec2

y

x

)dy = 0

The equation can be rearrange into homogeneous equation

dy

dx=(yx

sec2y

x− tan

y

x

)cos2

y

x

Setting y = ux, then dydx

= u+ xdudx

, the equation becomes,

u+ xdu

dx= (u sec2 u− tanu) cos2 u

xdu

dx= u− tanu cos2 u− u

Separating the variables, we get

sec2 u

tanudu = −dx

x

Integrating both side, we get∫sec2 u

tanudu = −

∫dx

x

log tanu = − log x+ log c

x tanu = c

Hence the solution isx tan

y

x= c

Example 3 Solve

(1 + ex/y)dx+ ex/y(

1− x

y

)dy = 0

Rewrite the equation into its homogeneous form, we get

dx

dy= −

ex/y(

1− xy

)(1 + ex/y)

7

Page 9: SMS 2308 - Mathematical Methods Lecture Notes

Setting x = uy, then dxdy

= u+ y dudy

, the equation becomes

u+ ydu

dy= −e

u(1− u)

(1 + eu)

ydu

dy= −e

u(1− u)

(1 + eu)− u = − u+ eu

(1 + eu)

Separating the variables, we get

−dyy

=1 + eu

u+ eudu =

d(u+ eu)

u+ eu

Integrating both side, we get

−∫dy

y=

∫d(u+ eu)

u+ eu

− log y = log(u+ eu) + c

y(u+ eu) = e−c = c′

Hence the solution isx+ yex/y = c′

1.3.3 Equations Reducible to Homogeneous Form

The equation of the form

dy

dx=

ax+ by + c

a′x+ b′y + c′

can be reduced to the homogeneous form as follows:Case I. When a

a′∕= b

b′

Settingx = X + ℎ, y = Y + k, (ℎ, k are constants)

anddx = dX, dy = dY

the equation becomes

dY

dX=

aX + bY + (aℎ+ bk + c)

a′X + b′Y + (a′ℎ+ b′k + c′)

we choose ℎ and k so that dYdX

become homogeneous equation.

8

Page 10: SMS 2308 - Mathematical Methods Lecture Notes

Set aℎ+ bk + c = 0 and a′ℎ+ b′k + c′ = 0 so that

bc′ − b′c=

k

ca′ − c′a=

1

ab′ − ba′

or

ℎ =bc′ − b′cab′ − b′a

, and k =ca′ − c′aab′ − ba′

Thus when ab′ − ba′ ∕= 0, dYdX

becomes

dY

dX=

aX + bY

a′X + b′Y

which is homogeneous in X, Y and be solved by setting Y = uX.Example Solve

dy

dx=y + x− 2

y − x− 4

Settingx = X + ℎ, y = Y + k, (ℎ, k are constants)

anddx = dX, dy = dY

the equation becomes

dy

dx=y + x+ (k + ℎ− 2)

y − x+ (k − ℎ− 4)

Letting k + ℎ − 2 = 0 and k − ℎ − 4 = 0, then ℎ = −1 and k = 3 then theequation will be dY

dX= Y+X

Y−X which is homogeneous in X and Y .

Setting Y = uX, then dYdX

= u+X dudX

, the equation becomes,

u+Xdu

dX=u+ 1

u− 1

Xdu

dX=

1 + 2u− u2

u− 1u− 1

1 + 2u− u2du =

dX

X

9

Page 11: SMS 2308 - Mathematical Methods Lecture Notes

Integrating both sides, we get

−1

2

∫2− 2u

1 + 2u− u2du =

∫dX

X

−1

2log(1 + 2u− u2) = logX + c

log

(1 +

2Y

X2− Y 2

X2

)+ logX2 = −2c

log(X2 + 2XY − Y 2) = −2c

X2 + 2XY − Y 2 = e−2c = c′

Setting X = x− ℎ = x+ 1 and Y = y− k = y− 3, the previous equationbecomes

(x+ 1)2 + 2(x+ 1)(y − 3)− (y − 3)2 = c′

x2 + 2xy − y2 − 4x+ 8y − 14 = c′

which is the required solution.Case II. When a

a′= b

b′

When ab′− ba′ = 0, the above method fails as ℎ and k become infinite orundetermined.

Seta

a′=b

b′=

1

mor

a′ = am, b′ = bm

then dydx

becomesdy

dx=

(ax+ by) + c

m(ax+ by) + c′

Setting ax+by = t, so that a+b dydx

= dtdx

or dydx

= 1b

(dtdx− a), then the previous

equation becomes

1

b

(dt

dx− a)

=t+ c

mt+ c′

dt

dx= a+

bt+ bc

mt+ c′

=(am+ b)t+ ac′ + bc

mt+ c′

so the variables are separable. In the solution, setting t = ax + by, we getthe required solution of dy

dx

10

Page 12: SMS 2308 - Mathematical Methods Lecture Notes

Example Solve

(3y + 2x+ 4)dx− (4x+ 6y + 5)dy = 0

The equation can be rearrange as

dy

dx=

(2x+ 3y) + 4

2(2x+ 3y) + 5

Setting 2x+ 3y = t, then 2 + 3 dydx

= dtdx

The equation becomes,

1

3

(dt

dx− 2

)=

t+ 4

2t+ 5

dt

dx=

7t+ 22

2t+ 52t+ 5

7t+ 22dt = dx

Integrating both sides, ∫2t+ 5

7t+ 22dt =

∫dx∫ (

2

7− 9

7⋅ 1

7t+ 22

)= x+ c

2

7t− 9

49log(7t+ 22) = x+ c

Setting t = 2x+ 3y, we have

14(2x+ 3y)− 9 log(14x+ 21y + 22) = 49x+ 49c

21x− 42y + 9 log(14x+ 21y + 22) = c′

which is the required solution.

1.3.4 Linear First-order Equations

A differential equation is said to be linear if the dependent variable andits differential coefficients occur only in the first degree and not multipliedtogether.

Thus the standard form of a linear equation of the first order is,

dy

dx+ Py = Q

11

Page 13: SMS 2308 - Mathematical Methods Lecture Notes

where P Q are the functions of x.To solve the equation, we multiply both sides by e

∫Pdx, so we get

dy

dx⋅ e

∫Pdx + y

(e∫PdxP

)= Qe

∫Pdx

d

dx

(ye

∫Pdx)

= Qe∫Pdx

Integrating both side, we get

ye∫Pdx =

∫Qe

∫Pdx + c

as the required solution.Example 1 Solve

(x+ 1)dy

dx− y = e3x(x+ 1)2

Divide the equation with (x+ 1), we get

dy

dx− y

x+ 1= e3x(x+ 1)

Here P = − 1x+1

and∫Pdx = −

∫dx

x+ 1= − log(x+ 1) = log(x+ 1)−1

The integrating factor is

e∫Pdx = elog(x+1)−1

=1

x+ 1

Thus the solution for the equation is

y

x+ 1=

∫[e3x(x+ 1)]

1

x+ 1dx+ c

=

∫e3xdx+ c

=1

3e3x + c

So the solution is

y =

(1

3e3x + c

)(x+ 1)

12

Page 14: SMS 2308 - Mathematical Methods Lecture Notes

Example 2 Solve (e−2√x

√x

)dx

dy= 1

Rewrite the equation into

dy

dx+

y√x

=e−2√x

√x

where P = 1√x

and ∫Pdx =

∫1√x

= 2√x

then the integrating factor becomes e∫Pdx = e2

√x

The solution for the equations is

y ⋅ e2√x =

∫e−2√x

√x⋅ e2√xdx+ c

=

∫1√xdx+ c

So the solution isy ⋅ e2

√x = 2

√x+ c

Example 3 Solve

3x(1− x2)y2 dydx

+ (2x2 − 1)y3 = ax3

Setting z = y3 and 3y2 dydx

= dzdx

, the equation becomes

x(1− x2)dzdx

= (2x2 − 1)z = ax3

dz

dx+

2x2 − 1

x− x3z =

ax3

x− x3

Here P = 2x2−1x−x3 and∫

Pdx =

∫2x2 − 1

x− x3dx

=

∫ (−1

x− 1

2

1

1 + x+

1

2

1

1− x

)dx

= − log x− 1

2log(1 + x)− 1

2log(1− x)

= − log[x√

1− x2]

13

Page 15: SMS 2308 - Mathematical Methods Lecture Notes

The integrating factor is

exp

(∫2x2 − 1

x− x3dx

)= e− log[x

√1−x2] =

[x√

1− x2]−1

So the solution is

z[x√

1− x2] = a

∫x3

x(1− x2)⋅ 1

x√

1− x2dx+ c

= a

∫x(1− x2)−3/2dx+ c

= −a2

∫(−2x)(1− x2)−3/2dx+ c

z[x√

1− x2] = a(1− x2)−1/2 + c

Inserting z = y3, we get

y3 = ax+ cx√

1− x2

1.3.5 Bernoulli’s Equation

The equationdy

dx+ Py = Qyn

where P, Q are function of x is reducible to linear equation of the first order.This is a Bernoulli’s equation.

To solve it, we divide both sides with yn so that

y−ndy

dx+ Py1−n = Q

Setting y1−n = z so that

(1− n)y−ndy

dx=dz

dx

Then, the equation becomes

1

1− ndz

dx+ Pz = Q

dz

dx+ P (1− n)z = Q(1− n)

14

Page 16: SMS 2308 - Mathematical Methods Lecture Notes

which is a linear equation of the first order and can be solved easily.Example Solve

xdy

dx+ y = x3y6

.Divide both sides with xy6, we get

y−6dy

dx+y−5

x= x2

Setting y−5 = z and

−5y−6dy

dx=dz

dx

The equation becomes

−1

5

dz

dx+z

x= x2

dz

dx− 5

xz = −5x2

which is the same as dydx

+ Py = Q pattern. So we can use the integratingfactor.

Integrating factor is

e∫Pdx = e−

∫(5/x)dx

= e−5 log x

= elog x−5

= x−5

The solution is

z ⋅ x−5 =

∫(−5x2) ⋅ x−5dx+ c

y−5x−5 = −5 ⋅ x−2

−2+ c

Divide both side with y−5x−5, we get

1 = (2.5 + cx2)x3y5

which is the required solution.

15

Page 17: SMS 2308 - Mathematical Methods Lecture Notes

1.3.6 Exact Differential Equations

A differential equation of the form

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

is said to be exact if its left hand side member is the exact differential ofsome function u(x, y) which is

du ≡Mdx+Ndy = 0

The solution is thereforeu(x, y) = c

From calculus, we see that the partial derivatives of u(x, y) is

du =∂u

∂xdx+

∂u

∂ydy

Comparing with du ≡Mdx+Ndy, then we see that

∂u

∂x= M

∂u

∂y= N

If we differentiate M with respect to y and N with respect to x, we get

∂M

∂y=

∂2u

∂y∂x

∂N

∂x=

∂2u

∂x∂y

or∂M

∂y=∂N

∂x

We integrate ∂u∂x

= M with respect to x, we get

u =

∫Mdx+ k(y) k(y) is a constant

To determine k(y), we derive ∂u∂y

from this equation, and use ∂u∂y

= N to get

dk/dy, and integrate dk/dy to get k.Example Solve

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

16

Page 18: SMS 2308 - Mathematical Methods Lecture Notes

Test for exactness

M = cos(x+ y)

N = (3x2 + 2y + cos(x+ y))

Thus

∂M

∂y= − sin(x+ y)

∂N

∂x= − sin(x+ y)

So the equation is exact.Implicit general solution

u =

∫Mdx+ k(y)

=

∫cos(x+ y)dx+ k(y)

= sin(x+ y) + k(y)

To find k(y), we differentiate u = sin(x+ y) + k(y) with respect to y, weget

∂u

∂y= cos(x+ y) +

dk

dy

N = 3y2 + 2y + cos(x+ y)

So, dkdy

is

dk

dy= 3y2 + 2y

By integration k(y) isk(y) = y3 + y2 + c∗

Inserting k(y) into u = sin(x+ y) + k(y), we obtain the answer

u(x, y) = sin(x+ y) + y3 + y2 = c

1.3.7 Reduction to Exact Form, Integrating Factor

We can transform a non-exact equation,

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

17

Page 19: SMS 2308 - Mathematical Methods Lecture Notes

by multiplying it with a function F (x, y) producing an exact equation

FPdx+ FQdy = 0

which can be solve by using the method from the previous section. F (x, y)is called Integrating Factor.How to find Integrating factor

For Mdx + Ndy = 0, the exactness condition is ∂M/∂y = ∂N/∂x. ForF (x) and FPdx+ FQdy = 0, the exactness condition is

∂(FP )/∂y = ∂(FQ)/∂x

By product rule, we getFPy = F ′Q+ FQx

Dividing by FQ and rearrange, we get

1

F

dF

dx= R where R =

1

Q

(∂P

∂y− ∂Q

∂x

)If we integrate the equation with respect to x and taking the exponent

on both side, we get the integrating factor which is

F (x) = exp

∫R(x)dx

and if our initial is F (y), we get

F (y) = exp

∫R(y)dy where R(y) =

1

P

(∂Q

∂x− ∂P

∂y

)Example Find an integrating factor and solve the initial value problem

of(ex+y + yey)dx+ (xey − 1)dy = 0, y(0) = 1

Test for exactness

∂P

∂y= ex+y + ey + yey

∂Q

∂x= ey

Since ∂P∂y∕= ∂Q

∂x, so we have to find the integrating factor to make it an exact

equation.

18

Page 20: SMS 2308 - Mathematical Methods Lecture Notes

R(x) fail, since it on both x and y, so we have to use R(y), which is

R(y) =1

P

(∂Q

∂x− ∂P

∂y

)=

1

ex+y + yey(ey − (ex+y + ey + yey))

= −1

Hence the integrating factor is F (y) = exp∫−1dy = e−1. Multiplying the

integrating factor to the original equation, we get

(ex + y)dx+ (x− e−y)dy = 0

which is an exact equation and be solve using the previous method.

u =

∫(ex + y)

= ex + xy + k(y)

∂u

∂y= x+

dk

dy= N = x− e−y

dk

dy= −e−y

k = e−y + c∗

Hence, the general solution is

u(x, y) = ex + xy + e−y = c

The particular solution is

u(0, 1) = e0 + 0 ⋅ 1 + e−1 = 3.72

ex + xy + e−y = 3.72

1.4 Second Order Linear Differential Equa-

tion

1.4.1 Homogeneous Linear ODEs with Constant Coef-ficients

A second-order homogeneous linear ODEs with constant coefficient is

y′′

+ ay′+ by = 0

19

Page 21: SMS 2308 - Mathematical Methods Lecture Notes

The solution is

y = e�x

y′= �e�x

y′′

= �2e�x

If we put the equation, we will get

(�2 + a�+ b)e�x = 0

Hence � is a solution of the important characteristic equation

�2 + a�+ b = 0

The roots for this quadratic equation is

�1 =1

2(−a+

√a2 − 4b) �2 =

1

2(−a−

√a2 − 4b)

then the functiony1 = e�1x y2 = e�2x

are solutions for second-order homogeneous linear ODEs with constant coef-ficient.

From algebra, we know that the quadratic equation might have threedifferent kind of roots, depending on the sign of the discriminant a2 − 4b,which are

1. Two real roots if a2 − 4b > 0.

2. A real double root if a2 − 4b = 0.

3. Complex conjugate roots if a2 − 4b < 0

Case I: Two Distinct Real Root �1 and �2In this case, the basic solution is

y1 = e�1x and y2 = e�2x

and the general solution is

y = c1e�1x + c2e

�2x

Example Solve the initial value problem

y′′

+ y′ − 2y = 0, y(0) = 4, y

′(0) = −5

20

Page 22: SMS 2308 - Mathematical Methods Lecture Notes

The characteristics equation is

�2 + �− 2 = 0

Its roots are,�1 = 1 and �2 = −2

So the general equation is

y = c1ex + c2e

−2x

For finding particular solution, we differentiate once

y′= c1e

x − 2c2e−2x

and using the initial condition, we get

y = ex + 3e−2x

Case II: Real Double Root � = −a/2When a2 − 4b = 0 we only get one root, � = �1 = �2 = −a/2, hence the

only solution isy1 = e−(a/2)x

To obtain the second independent solution y2, we set y2 = uy1. Substitutethis and its derivative y

′2 and y

′′2 , we get

(u′′y1 + 2u′y′ + uy′′

1 ) + (a(u′y1 + uy′

1) + buy1 = 0

Collecting term

u′′y1 + u′(2y′

1 + ay1) + u(y′′

1 + ay′

1 + by1) = 0

The second and third expression is zero, so we are left with

u′′y1 = 0

By two integrations, we get

u = c1x+ c2

we choose c1 = 1 and c2 = 0 then u = x, so y2 = xy1, so the general solutionis

y = (c1 + c2x)e−(a/2)x

21

Page 23: SMS 2308 - Mathematical Methods Lecture Notes

Example Solve the initial value problem

y′′ + y′ + 0.25y = 0 y(0) = 3.0, y′(0) = −3.5

The characteristic equation is

�2 + �+ 0.25 = (�+ 0.5)2 = 0

It has double root � = −0.5, this give the general solution as

y = (c1 + c2x)e−0.5x

Taking the derivative and find c1 and c2, so we get the particular solution as

y = (3− 2x)e−0.5x

Case III: Complex Roots −1

2+ i! and −1

2− i!

The discriminant is a2 − 4b < 0, two complex roots, or we can obtain areal solution by using

y1 = e−ax/2 cos!x and y2 = e−ax/2 sin!x

where ! = b− 1

4a2. The real general solution for Case III is

y = e−ax/2(A cos!x+B sin!x)

where A, B are arbitrary constants.Example Solve the initial value problem

y′′ + 0.4y′ + 9.04y = 0, y(0) = 0, y′(0) = 3

The characteristic equation is

�2 + 0.4�+ 9.04 = 0

so the roots are �1 = −0.2 + 3i and �1 = −0.2 − 3i. Hence ! = 3. Thegeneral solution is

y = e−0.2x(A cos 3x+B sin 3x)

Differentiate the general solution and using the initial value, we get the par-ticular solution as

y = e−0.2x sin 3x

22

Page 24: SMS 2308 - Mathematical Methods Lecture Notes

1.4.2 Non-homogeneous ODEs

A general solution for a non-homogeneous ODEs

y′′ + p(x)y′ + q(x)y = r(x), r(x) ∕= 0

on aopen interval I is a solution of the form

y(x) = yℎ(x) + yp(x)

here, yℎ = c1y1 + c2y2 is a general solution from homogeneous ODE and ypis any solution of non-homogenous ODE containing no arbitrary constant.

Method of Undetermined Coefficients

Method of undetermined coefficients is suitable for linear ODEs with constantcoefficients a and b,

y′′ + ay′ + by = r(x)

when r(x) is an exponential function, a power of x, a cosine or sine, or sumsor products of such functions. These functions have derivative similar tor(x) itself. So, we choose a form for yp similar to r(x), but with unknowncoefficients to be determined by substituting yp and its derivatives into theODE. Table below shows the choice for yp for important form of r(x).

Term in r(x) Choice for ypke x Ce x

kxn (n = 0, 1, ⋅ ⋅ ⋅ ) Knxn +Kn−1x

n−1 + ⋅ ⋅ ⋅+K1x+K0

k cos!x K cos!x+M sin!xk cos!x K cos!x+M sin!xke�x cos!x e�x(K cos!x+M sin!x)ke�x sin!x e�x(K cos!x+M sin!x)

And the choice of rules for the method of undetermined coefficients are

1. Basic Rule If r(x) is one of the functions in the first column from thetable, choose yp from the same line and determine the coefficients bysubstituting yp and its derivatives into the equation

2. Modification rule If a term in our choice for yp happens to be asolution of the homogeneous ODE corresponding to the equation, wemultiply the choice of yp by x or x2 etc.

3. Sum Rule If r(x) is a sum of functions in the first column of the table;we choose yp by summing up the functions in the corresponding line.

23

Page 25: SMS 2308 - Mathematical Methods Lecture Notes

Example 1: Rule 1 Solve the initial value problem

y′′ + y = 0.001x2, y(0) = 0, y′(0) = 1.5

The general solution for homogeneous ODE y′′ + y = 0 is

yℎ(x) = A cosx+B sinx

Solution for non-homogeneous ODE, setting yp = Kx2, then y′′p = 2K.

Substitute into the equation, we get

2K +Kx2 = 0.001x2

Comparing both sides, we see that

2K = 0, K = 0.001

which the value of K contradict each other, so yp = Kx2 is not the solutionfor this equation.

Looking from the table, the choice of yp for the term r(x) = Kxn isyp = K2x

2 +K1x+K0, then

y′′

p + yp = 2K2 + 2K2x2 +K1x+K0 = 0.001x2

Comaparing both sides, we get

K2 = 0.001, K1 = 0, K0 = −0.002

This givesyp = 0.001x2 − 0.002

and the general solution becomes,

y = yℎ + yp = A cosx+B sinx+ 0.001x2 − 0.002

To find the value for A and B, we use the initial condition

y(0) = A cos 0 +B sin 0 + 0.001(0)2 − 0.002

= A− 0.002 = 0

So, A = 0.002. To find B, we diffentiate the general solution once and putthe initial condition

y′ = y′

ℎ + y′

p

= −A sinx+B cosx+ 0.002x

y′(0) = −A sin 0 +B cos 0 + 0.002(0)

= B = 1.5

24

Page 26: SMS 2308 - Mathematical Methods Lecture Notes

So, B = 1.5. This gives the answer as

y = 0.002 cosx+ 1.5 sinx+ 0.001x2 − 0.002

Example 2: Rule 2 Solve the initial value problem

y′′ + 3y′ + 2.25y = −10e−1.5x, y(0) = 1, y′(0) = 0

The general solution for the homogeneous ODE,

y′′ + 3y′ + 2.25y = 0

where �2 + 3�+ 2.25 = (�+ 1.5)2 = 0 is

yℎ = (c1 + c2x)e−1.5x

The solution of non-homogeneous ODE cannot be taken as yp = Ce−1.5x

since this a solution for homogeneous ODE. So, by using rule number 2, wemodify our choice function by x2. That is, we use

yp = Cx2e−1.5x

y′

p = C(2x− 1.5x2)e−1.5x

y′′

p = C(2− 3x− 3x+ 2.25x2)e−1.5x

Substitute these equations into the main equation, by ignoring the e−1.5x, weget

C(2− 6x+ 2.25x2) + 3C(2x− 1.5x2) + 2.25Cx2e−1.5x = −10

Comparing both sides, we get 2C = −10, so C = −5 and the solution is

yp = −5x2e−1.5x

Hence the general equation becomes

y = yℎ + yp = (c1 + c2x)e−1.5x − 5x2e−1.5x

Using the initial condition to find c1 and c2, we get

c1 = 1, and c2 = 1.5

This give the answer which is

y = (1 + 1.5x)e−1.5x − 5x2e−1.5x

25

Page 27: SMS 2308 - Mathematical Methods Lecture Notes

Example 3: Rule 3 Solve the initial value problem

y′′+ 2y′+ 5y = e0.5x + 40 cos 10x− 190 sin 10x, y(0) = 0.16, y′(0) = 40.08

The general solution for homogeneous ODE y′′ + 2y′ + 5y = 0 from thecharacteristics equation

�2 + 2�5 = (�+ 1 + 2i)(�+ 1− 2i) = 0

isyℎ = e−x(A cos 2x+B sin 2x)

The solution for non-homogeneous ODE, we choose our yp as summationof two function from the table, that is

yp = Ce0.5x +K cos 10x+M sin 10x

Substitute into the equation and comparing both side, we get

C = 0.16, K = 0, M = 2

Hence the solution is

y = yℎ + yp = e−x(A cos 2x+B sin 2x) + 0.16e0.5x + 2 sin 10x

From the initial condition, we found that A = 0 and B = 10, hence thecomplete solution is

y = 10e−x sin 2x+ 0.16e0.5x + 2 sin 10x

26