on inhomogeneous second-order linear ODE with constant coefficients

Let’s consider solving the ordinary second-order linear differential equation

d2ydx2+adydx+by=R(x) (1)

which is inhomogeneous (http://planetmath.org/HomogeneousLinearDifferentialEquation), i.e. R(x)0.

For obtaining the general solution of (1) we have to add to the general solution of the corresponding homogeneous equation (http://planetmath.org/SecondOrderLinearODEWithConstantCoefficients)

d2ydx2+adydx+by= 0 (2)

some particular solution (http://planetmath.org/SolutionsOfOrdinaryDifferentialEquation) of the inhomogeneous equation (1).  A latter one can always be gotten by means of the variation of parametersMathworldPlanetmath, but in many cases there exist simpler ways to find a particular solution of (1).

1:  R(x) is a nonzero constant function xc.  In this case, apparently  y=cb is a solution of (1), supposing that  b0.  If  b=0  but a0,  a particular solution is y=cax.  If  a=b=0,  a solution is gotten via two consecutive integrations.

2:  R(x) is a polynomial function of degree n1.  Now (1) has as solution a polynomialPlanetmathPlanetmath which can be found by using indetermined coefficients.  If  b0,  the polynomial is of degree n and is uniquely determined.  If  b=0  and  a0,  the degree of the polynomial is n+1 and its constant term is arbitrary. If  a=b=0  the polynomial is of degree n+2 and is gotten via two integrations.

3:  Let R(x) in (1) be of the form αsinnx+βcosnx with α, β, n constants.  We try to find a solution of the same form and put into (1) the expression

y:=Asinnx+Bcosnx. (3)

Then the left hand side of (1) attains the form


This must equal R(x), i.e. we have the conditions


These determine uniquely the values of A and B provided that the determinantMathworldPlanetmath


does not vanish.  Then we obtain the particular solution (3).  The determinant vanishes only if  a=0 and  b=n2, in which case the differential equation (1) reads

d2ydx2+n2y=αsinnx+βcosnx. (4)

Unless we have  α=β=0, the equation (4) has no solution of the form (3), since

d2dx2(Asinnx+Bcosnx)+n2(Asinnx+Bcosnx)= 0 (5)

identically.  But we find easily a solution of (4) when we differentiate the identity (5) with respect to n.  Changing the order of differentiations we get


The right hand side coincides with the right hand side of (4) iff  -2nA=α  and  -2nB=β, and thus (4) has the solution


4:  Let R(x) in (1) now be αekx where α and k are constants.  Denote the left hand side of (1) briefly d2ydx2+adydx+by=:F(y).  We seek again a solution of the same form Aekx as R(x).

First we have


Thus A can be determined from the condition  Af(k)=α.  If  f(k)0,  i.e. k is not a root of the characteristic equationMathworldPlanetmathPlanetmathPlanetmathf(r)=0  corresponding the homogeneous equation (2), then we obtain the particular solution


of the inhomogeneous equation (1).

If  f(k)=0, then ekx and Aekx satisfy the homogeneous equation  F(y)=0.  Now we may start from the identity


and differentiate it with respect to r.  Changing again the order of differentiations we can write first

F(Axerx)=Aerx[f(r)+xf(r)], (6)

and differentiating anew,

F(Ax2erx)=Aerx[f′′(r)+2xf(r)+x2f(r)]. (7)

If k is a simple root of the equation  f(r)=0,  i.e. if  f(k)=0  but  f(k)0,  then  r:=k  makes the right hand side of (6) to Af(k)ekx, which equals to  R(x)=αekx  by choosing  A:=αf(k).  Then we have found the particular solution


We have still to handle the case when k is the double root of the equation  f(k)=0  and thus  f(k)=0.  Putting  r:=k  into (7), the right hand side reduces to  Af′′(k)ekx=2Aekx; this equals to R(x)=αekx  when choosing A:=α2.  So we have the particular solution


of the given inhomogeneous equation.

5:  Suppose that in (1) the right hand side R(x) is a sum of several functions,

d2ydx2+adydx+by=R1(x)+R2(x)++Rn(x), (8)

and one can find a particular solution yi(x) for each of the equations


Then evidently the sum y1(x)+y2(x)++yn(x) is a particular solution of the equation (8).


  • 1 Ernst Lindelöf: Differentiali- ja integralilasku ja sen sovellutukset III.1.  Mercatorin Kirjapaino Osakeyhtiö, Helsinki (1935).

Title on inhomogeneous second-order linear ODE with constant coefficients
Canonical name OnInhomogeneousSecondorderLinearODEWithConstantCoefficients
Date of creation 2014-03-05 16:25:57
Last modified on 2014-03-05 16:25:57
Owner pahio (2872)
Last modified by pahio (2872)
Numerical id 14
Author pahio (2872)
Entry type Derivation
Classification msc 34A05