Skip to content

7 Linear Ordinary Differential Equations

Introduction

  • Q1: Consider the cooling model. Assume there is a cup of boiled water (100°C), environment temperature is 20°C. How does water cool down over time?
  • A: According to the Newton's Law of Cooling
dTdt=k(T20).

k is the cooling rate constant. Initial temperature T(0)=100.

T=20+80et
  • Q2: Assume a ball goes from static to free fall. How to calculate the fall distance over time?
  • A:
dvdt=gdxdt=vd2xdt2=g

g is gravity, with initial position x(0)=0.

x=12gt2

Applications about Differential Equations include:

  • neutron diffusion equation:D2ϕaϕ+kaϕ=0
  • decay chain model:dNidt=λiNi+j=1i1bjiλjNj
  • Tsiolkovsky rocket equation:dvdt=uemdmdtg
  • Navier-Stokes equations:ρ(vt+vv)=p+μ2v+f.

A differential equation relates two or more variables via derivatives or differentials.

The simplest form:

dydx=f(x)

where f(x) is a function of x. we define a solution of a differential equation to be any functional relation, not involving derivatives or integrals of unknown functions

The solution is obtained immediately by integration, in the form

y=f(x) dx+C

Whether or not it happens that the integral can be expressed in terms of simple functions is incidental, in the sense that we define a solution of a differential equation to be any functional relation, not involving derivatives or integrals of unknown functions, which implies the differential equation.

Similarly, in an equation of the form

F(x)G(y)dx+f(x)g(y)dy=0.

We may separate the variables and obtain a solution by integration in the form

F(x)f(x) dx+g(y)G(y) dy=CH(x)+I(y)=C

Linear Ordinary Differential Equations (ODEs)

Definition: Linear ODEs

Linear differential equation of order n, in absence of products or nonlinear functions of the dependent variable y and its derivatives the highest derivative present being of order n:

a0(x)dnydxn+a1(x)dn1ydxn1++an1(x)dydx+an(x)y=f(x).

The coefficients a may be arbitrarily specified functions of the independent variable x.

Examples:

  • First order:
dydx=gxdydx+ky=20k,(a0=1,a1=k,f(x)=20k)
  • Second order:
d2ydx2+2dydx+y=x
  • Higher orders include:
(y)5+x4yxy+y7=1,y(4)4y+10y12y+5y=sin2x

The most general linear differential equation of the nth order can be written in the form (by dividing a0(x) in both terms):

dnydxn+a1(x)dn1ydxn1++an1(x)dydx+an(x)y=h(x).

This equation is frequently written in the abbreviated form

Ly=h(x).

where L here represents the linear differential operator:

L=dndxn+a1(x)dn1dxn1++an1(x)ddx+an(x)

General solutions to linear differential equations

  • If n linearly independent solutions u1(x),u2(x),...,un(x) of the associated homogeneous equation LyH=0 are known, the general solution is of the form:
yH(x)=c1u1(x)+c2u2(x)++cnun(x)=k=1nckuk(x)

where ci are required arbitrary constants.

  • Suppose that one particular solution of LyP=h(x) can be obtained by inspection or otherwise, such that LyP=h(x), then the complete solution is of the form:
y=yH(x)+yP(x)=k=1nckuk(x)+yP(x)

The mission is:

  1. Find yH:LyH=0;
  2. Find yP:LyP=h(x) need only one solution

Then y=yH+yP:Ly=h(x)

The question is : how do we know n functions are linearly independent?

Linear Dependence/Independence of functions

The functions u1,u2,,un are said to linear independence over a given interval if over that interval no one of the functions can be expressed as a linear combination of the others (nontrival). Here are more specific:

We assume that each of a set of n functions u1,u2,,un possesses n finite derivatives at all points of an interval M. Then, if a set of constants exists such that

c1u1+c2u2++cnun=0

for all values of x in the interval M.

these same constants also satisfy the identities

c1du1dx+c2du2dx++cndundx=0c1d2u1dx2+c2d2u2dx2++cnd2undx2=0c1dn1u1dxn1+c2dn1u2dxn1++cndn1undxn1=0

Then:

(u1u2undu1dxdu2dxdundxdn1u1dxn1dn1u2dxn1dn1undxn1)(c1c2cn)=0.

if the functions u1,u2,,un are linearly dependent, then the determinant The following determinant vanishes if the functions are linearly dependent; otherwise, they are linearly independent

Lemma: Wronskian determinant

The vanishing of the Wronskian determinant is necessary but not sufficient for linear dependence. The functions are linearly independent if this determinant does not vanish, i.e.:

W(u1,u2,,un)=|u1u2undu1dxdu2dxdundxdn1u1dxn1dn1u2dxn1dn1undxn1|0.

First order linear solution

The linear equation of first order is readily solved in general terms, without determining separately homogeneous and particular solutions

we attempt to determine an integrating factor p(x) such that the standard form

dydx+a1(x)y=h(x).

is equivalent to the equation

ddx(py)=ph.

Here is the procession:

ddx(py)=pdydx+ydpdx1pddx(py)=dydx+ypdpdxh(x)ddx(py)=ph(x).
  • The above equation can be written as dydx+(1pdpdx)y=h(x).
  • Therefore, we have 1pdpdx=a1(x), which leads to p=exp(a1(x) dx)
  • As a result, we obtain the general solution py=ph dx+C, C is an arbitrary constant, ory=1pph dx+Cp.

Example1: Integrating factor

To solve the differential equation

xdydx+(1x)y=xex

we first rewrite the equation in the standard form,

dydx+(1x1)y=ex

An integrating factor is then

p=e(1x1) dx=elogxx=xex

no constant being added in the integration, since only a factor is needed. The solution is then given by

y=exxx dx+Cexxy=x2ex+Cexx

Linear ODEs with Constant Coefficients

The simplest and perhaps the most important differential equation of higher order is the linear equation (in which the coefficients ak are constants)

Ly=dnydxn+a1dn1ydxn1++an1dydx+any=h(x).
  • Note that dmdxmerx=rmerx

  • Then

    Lerx=(rn+a1rn1++an1r+an)erx
  • For a homogeneous equation (h(x)=0), we just need (The characteristic equation of r):

    rn+a1rn1++an1r+an=0
    • If there are n distinct roots to the characteristic equation:
    yH=k=1nckerkx
    • if one or more of the roots is repeated, less than n independent solutions are obtained. Suppose that r=r1 is a double root of the characteristic equation:
    Lerx=(rr1)2(rr2)(rrn)erx,r1r2rn

    To solve it, note that:

    L[erx]r=r1=L[er1x]=0L[rerx]r=r1=L[xer1x]=0,

    (Not so accuracy):

    L[rerx]=rL[erx]

    The part of the homogeneous solution corresponding to the double root r1 can be written in the form

    c1er1x+c2xer1x=er1x(c1+c2x).

    By a simple extension of this argument, it can be shown the part of the homogeneous solution corresponding to an m-fold root r1 is of the form

    er1x(c1+c2x+c3x2++cmxm1).

If the characteristic equation has imaginary roots and if the coefficients of that equation are real, the roots must occur in conjugate pairs. Thus, if r1=a+ib is one root, a second root must be r2=aib. The part of the solution corresponding to these two roots can be written in the form

Ae(a+ib)x+Be(aib)x=eax(Aeibx+Beibx).

In order that this expression be real, the constants A and B must be imaginary By making use of Euler's formula,*

eiθ=cosθ+isinθ,

we find that the solution becomes

eax[A(cosbx+isinbx)+B(cosbxisinbx)]

and hence can be written in the more convenient form,

eax(c1cosbx+c2sinbx),

where c1 and c2 are new arbitrary constants replacing (A+B) and i(AB), respectively. Thus real values of c1 and c2 correspond to values of A and B which are conjugate complex.

Similarly, if a±ib are m-fold roots, the corresponding 2m terms in the homogeneous solution can be written in the real form,

eax[(c1+c2x++cmxm1)cosbx+(cm+1+cm+2x++c2mxm1)sinbx]

Example2: Linear ODE with constant coefficients [core]

  • For the equation
d3ydx3dydx=0,

the characteristic equation is r3r=r(r+1)(r1)=0, from which there follows r=0,±1. The general solution is then

y=c1+c2ex+c3ex
  • For the differential equation
d3ydx35d2ydx2+8dydx4y=0

the characteristic equation is (r1)(r2)2=0, from which there follows r=1,2,2. The general solution is then

y=c1ex+e2x(c2+c3x).
  • The equation
d2ydx2+2dydx+5y=0

has the characteristic equation r2+2r+5=0, from which r=1±2i; hence

y=ex(c1cos2x+c2sin2x)

Nonhomogeneous Linear ODEs

A shorter method which can be applied in many practical cases is that of undetermined coefficients. This method may be used when the right-hand side of h(x) involves only terms of

xm,sin(qx),cos(qx),epx, and/or products of two

or more such functions. The reason for the success of the method is the fact that each of these functions, or any product of a finite number of these functions, has only a finite number of linearly independent derivatives.

If we define the family of a function f(x) as the set of linearly independent functions of which the function f(x) and its derivatives with respect to x are linear combinations, the following families may be listed

TermFamily
xmxm,xm1,xm2,,x2,x,1
sin(qx)sin(qx),cos(qx)
cos(qx)sin(qx),cos(qx)
epxepx

Example3 [core]

Consider the differential equation

d3ydx3dydx=2x+14cosx+2ex.

The general homogeneous solution is

yH=c1+c2ex+c3ex.

The families of the terms x,1,cosx, and ex on the right-hand side of the equation are, respectively,

{x,1},{1},{cosx,sinx},{ex}.
  • The second family is contained in the first, and is discarded.
  • Since the first family has the representative 1 in the homogeneous solution(r1=0e0=1), it is replaced by the family {x2,x}. Similarly, the last family is replaced by {xex} (r2=1e1x). (?)

A particular solution is then assumed in the form

yP=Ax2+Bx+Ccosx+Dsinx+Exex.

When y is replaced by yP, the differential equation becomes

2AxB2Dcosx+2Csinx+2Eex=2x+14cosx+2ex.

By equating the coefficients of x,1,cosx,sinx, and ex, there follows

A=1,B=1,D=2,C=0,E=1.

A particular solution thus is

yP=x2x+2sinx+xe2,

and the general solution is

y=c1+c2ex+c3exx2x+2sinx+xex.

Equidimensional linear differential equation

An equation of the form

Ly=xndnydxn+b1xn1dn1ydxn1++bn1xdydx+bny=h(x).

where the b's are constants, this equation has the property that each term on the left is unchanged when x is replaced by cx, where c is a nonzero constant.

Introducing a new independent variable z by the substitution:

x=ez,z=logx

There then follows

ddx=dzdxddz=1ezddz

In particular, we obtain

xdydx=dydzx2d2ydx2=d2ydz2dydz=ddz(ddz1)y,x3d3ydx3=d3ydz33d2ydz2+2dydz=ddz(ddz1)(ddz2)y,
x2d2ydx2=x2ddx(ddxy)=xddz(dydx)=xddz(1xdydz)=ezddz(1ezdydz)=ez(1ezdydz+1ezd2ydz2)=d2ydz2dydz

In general, it is found that

xmdmydxm=ddz(ddz1)(ddz2)(ddzm+1)y.

The transformed equation thus becomes linear with constant coefficients, and y then can be determined in terms of z. The final result is obtained by replacing z by logx

Example4: Equidimensional linear differential equation

To solve the differential equation

x2d2ydx22xdydx+2y=x2+2

Making use of the variable transformation, we obtain the transformed equation

d2ydz23dydz+2y=e2z+2

The solution is found to be

y=c1ez+c2e2z+ze2z+1

or, returning to the variable x

y=c1x+c2x2+x2logx+1

Particular Solutions by Variation of Parameters

Suppose

Ly=dnydxn+a1(x)dn1ydxn1++an1(x)dydx+an(x)y=h(x).

has the homogeneous solution

yH=k=1nckuk(x).

where the u's are n linearly independent homogeneous solutions and the c’s are n arbitrary constants or "parameters."

We assume that the particular solution of the above ODE is of the following form

yP=k=1nCkuk(x).

Given yP, we obtain:

ddxyP=k=1nCkuk+k=1nCkuk.

In order to simplify this expression, we require

k=1nCkuk=0.

There then follows

d2dx2yP=k=1nCkuk+k=1nCkuk.

As the second condition, we require

k=1nCkuk=0.

Proceeding in this way through the (n1)th derivative, we have our (n1)th requirement:

k=1nCkuk(n2)=0.

And the (n1)th derivative is

dn1dxn1yP=k=1nCkuk(n1).

The expression for the nth derivative is then

dndxnyP=k=1nCkuk(n1)+k=1nCkuk(n).

Introducing the expressions for yP and its derivatives into the general linear differential equation:

LyP=k=1nCkuk(n)+a1(x)k=1nCkuk(n1)++an1(x)k=1nCkuk+an(x)k=1nCkuk+k=1nCkuk(n1)=h(x)

Combining the first summations, we obtain

k=1nCk[dnukdxn+a1(x)dn1ukdxn1++an1(x)dukdx+an(x)uk]+k=1nCkuk(n1)=h(x)

Therefore

k=1nCkuk(n1)=h(x)

In summary, the n conditions imposed on the n unknown functions can be written in the expanded form

{C1(x)u1(x)+C2(x)u2(x)++Cn(x)un(x)=0C1(x)u1(x)+C2(x)u2(x)++Cn(x)un(x)=0C1(x)u1(n2)(x)+C2(x)u2(n2)(x)++Cn(x)un(n2)(x)=0C1(x)u1(n1)(x)+C2(x)u2(n1)(x)++Cn(x)un(n1)(x)=h(x)

If this set of equations is solved for C1,C2,,Cn by Cramer's rule, the common-denominator determinant is seen to be the Wronskian of u1,u2, ,un.

Example6: the general solution to the second order linear differential equation

d2ydx2+a1(x)dydx+a2(x)y=h(x),

there follows

y=C1(x)u1(x)+C2(x)u2(x)

where

C1=|0u2hu2||u1u2u1u2|=h(x)u2(x)W[u1(x),u2(x)]

and, similarly,

C2=h(x)u1(x)W[u1(x),u2(x)].

Thus we can write

C1=xh(x)u2(x)W[u1(x),u2(x)] dx+c1,C2=xh(x)u1(x)W[u1(x),u2(x)] dx+c2

Example7: 2nd order linear differential equation

d2ydx2+y=f(x)

two linearly independent homogeneous solutions are u1=cosx,u2=sinx. The Wronskian is

W(cosx,sinx)=|cosxsinxsinxcosx|=sin2x+cos2x=1.

Therefore

y=cosx[xf(x)sinx dx+c1]+sinx[xf(x)cosx dx+c2]

or

y=xf(ξ)[cosξsinxsinξcosx] dξ+c1cosx+c2sinx

or

y=xf(ξ)sin(xξ) dξ+c1cosx+c2sinx

Example8: 3rd order linear differential equation

d3ydx33d2ydx2+2dydx=f(x),

we may take u1=1,u2=ex,u3=e2x. Equations (52) then become

C1+C2ex+C3e2x=0C2ex+2C3e2x=0C2ex+4C3e2x=f(x)

Solving the three simultaneous equations, we obtain

C1=12f(x),C2=exf(x),C3=12e2xf(x)

The solution of the differential equation is then

y=1[12xf(ξ) dξ+c1]+ex[xeξf(ξ) dξ+c2]+e2x[12xe2ξf(ξ) dξ+c3]

or, equivalently,

y=12xf(ξ)[12exξ+e2(xξ)] dξ+c1+c2ex+c3e2x

Reduction of order

One of the important properties of linear differential equations is the fact that:

if one homogeneous solution of an equation of order n is known, a new linear differential equation of order n1,determining the remainder of the solution, can be obtained.

This procedure is in a sense analogous to the reduction of the degree of an algebraic equation when one solution is known.

Suppose that one homogeneous solution u1(x) is known.

  1. We next write y=v(x)u1(x) and attempt to determine the function v(x).
  2. Substituting vu1 for y in the left-hand side of the differential equation, we obtain a new linear differential equation of order n to determine v. But since y=cu1(x) is a homogeneous solution of the original equation, v=c must be a homogeneous solution of the new equation.
  3. Hence the new equation must lack the term of zero order in v; that is, the coefficient of v must be zero in equations. Thus the new equation is of order n1 in the variable dv/dx

Example9: general 2nd-order linear equation

d2ydx2+a1(x)dydx+a2(x)y=h(x)

Assuming y=v(x)u1(x), then introduce into 2nd -order linear equation

vu1+2vu1+a1vu1+v(u1+a1u1+a2u1=0)=h.

since u1 is a homogeneous solution, the expression in parentheses vanishes and the differential equation determining v becomes

vu1+2vu1+a1vu1=h

or

(v)+(2u1u1+a1)v=hu1.

This equation is of first order in v, with an integrating factor (See first order linear solution) in the form

e2logu1+a1 dx=pu12, where p=ea1dx

Hence

v=1pu12xphu1 dx+c1pu12v=xxphu1 dxpu12dx+c1xdxpu12+c2

With y=vu1(x),

y=u1(x)xphu1 dxpu12 dx+c1u1(x)xdxpu12+c2u1(x)

Determination of Constants

The n arbitrary constants present in the general solution of a linear differential equation of order n are to be determined by n suitably prescribed supplementary conditions

Frequently these conditions consist of the requirement that the function and its first n1 derivatives take on prescribed values at a given point x=a:

y(a)=y0,y(a)=y0,,y(n1)(a)=y0(n1)

When such conditions are prescribed, the problem is known as an initial-value problem. In this case it can be shown that if the point x=a is included in an interval where the coefficients a1(x),,an(x) and the right-hand side h(x) of the differential equation, in standard form, are continuous, there exists a unique solution satisfying above Equations. Here, if the complete solution is written in the form

y=k=1nckuk(x)+yp(x)k=1nckuk(m)(a)=y0(m)yP(m)(a)(m=0,1,2,,n1)(u1(0)u2(0)un(0)u1(1)u2(1)un(1)u1(n1)u2(n1)un(n1))(c1c2cn)=(y0(0)yp(0)(a)y0(1)yp(1)(a)y0(n1)yp(n1)(a))

determinant of the coefficients of the constants ck is the value of the Wronskian of the linearly independent solutions uk at the point x=a

Special solvable types of nonlinear equations

1. Separable equations

Q:

(1+x2) dy+(1+y2) dx=0

A:

dx1+x2+dy1+y2=0tan1x+tan1y=tan1cx+y=c(1xy)

Q:

(dydx)24y+4=0

A: yields two separable equations when solved algebraically for dy/dx

dydx=±2y1,

provided that the division by y1 is legitimate, and hence there follows ±y1=xc, or

y=1+(xc)2.

2. Exact first-order equations

A first-order equation, written in the form

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

where P and Q are assumed to have continuous first partial derivatives, is said to be exact when P and Q satisfy the condition

Py=Qx.

In this case, and in this case only, there exists a function u(x,y) such that,

du=P dx+Q dy=0u(x,y)=c.

since

ux=P,uy=Q,

the necessity follows from the fact that

x(uy)=y(ux)

In order to obtain a function u satisfying the two relations, for example, we start with the first relation u/x=P

u(x,y)=xP(x,y)dx+f(y)

f(y) is the added constant of integration to be determined by second relation u/y=Q

xPydx+f(y)=Q

hence

f(y)=QxPydx

the right-hand member is indeed only a function of y, so that f(y) can be determined (with an irrelevant arbitrary additive constant) by direct integration f(y) has no relation with x, because

x(QxPydx)=QxPy=0

Example 10

dydx=1+y2+3x2y12xyx3

can be written in the form

(3x2y+y2+1) dx+(x3+2xy1) dy=0

and the condition of exactness is satisfied. From the relation

ux=3x2y+y2+1

there follows u=x3y+xy2+x+f(y). The relation

uy=x3+2xy1

then gives x3+2xy+f(y)=x3+2xy1 or f(y)=1, from which f(y)=y, apart from an irrelevant arbitrary additive constant. Hence the required solution u=c is

x3y+xy2+xy=c.

3. Homogeneous first-order equations

A function f(x,y) is said to be homogeneous of degree n if there exists a constant n such that, for every number λ

f(λx,λy)=λnf(x,y).

The first-order differential equation, P(x,y) dx+Q(x,y) dy=0, is said to be homogeneous if P and Q are both homogeneous of degree n , for some constant n . Differential equation becomes separable upon the change of variables y=vxdy=v dx+x dv,

xnP(1,v) dx+xnQ(1,v)(v dx+x dv)=0 or [P(1,v)+vQ(1,v)] dx+xQ(1,v) dv=0

Example 11

(3y2x2) dx=2xy dy

is homogeneous (with n=2 ) and, with y=vx, it becomes

(3v2x2x2) dx=2vx2(v dx+x dv)
(v21) dx+2xv dv=0

from which there follows

2v dvv21=dxx(x0,v21)

and hence

log|v21|=log|x|+log|c|=log|cx|

or

v21=cx

or

y2x2=cx3.

4. Second-order equations lacking one variable

The general equation of second order is of the form

F(x,y,dydx,d2ydx2)=0.

Assume

dydx=pd2ydx2=dpdx=dpdyp
  1. Lacking y or else:{F(x,y,p,dpdx)=0dydx=p.
  2. Lacking x or else:{F(x,y,p,pdpdy)=0dydx=p.

Example 12

d2ydx2=x(dydx)3

lacks the variable y. With dydx=p and d2ydx2=dpdx, there follows

dpdx=xp3

which separates to give

Hence

p=±1c12x2dy=±dxc12x2

from which there follows

y=±sin1xc1+c2 or x=c1sin(yc2),

where c1=±c1.

Released under the MIT License.