# on inhomogeneous second-order linear ODE with constant coefficients

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

$\frac{{d}^{2}y}{d{x}^{2}}}+a{\displaystyle \frac{dy}{dx}}+by=R(x)$ | (1) |

which is inhomogeneous (http://planetmath.org/HomogeneousLinearDifferentialEquation), i.e. $R(x)\not\equiv 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)

$\frac{{d}^{2}y}{d{x}^{2}}}+a{\displaystyle \frac{dy}{dx}}+by=\mathrm{\hspace{0.33em}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 parameters^{}, but
in many cases there exist simpler ways to find a particular
solution of (1).

${1}^{\circ}$: $R(x)$ is a nonzero constant function
$x\mapsto c$. In this case, apparently $y=\frac{c}{b}$ is
a solution of (1), supposing that $b\ne 0$. If $b=0$
but $a\ne 0$, a particular solution is $y=\frac{c}{a}x$.
If $a=b=0$, a solution is gotten via two consecutive
integrations.

${2}^{\circ}$: $R(x)$ is a polynomial function of degree
$n\ge 1$. Now (1) has as solution a polynomial^{} which can be
found by using indetermined coefficients. If $b\ne 0$,
the polynomial is of degree $n$ and is uniquely determined.
If $b=0$ and $a\ne 0$, 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}^{\circ}$: Let $R(x)$ in (1) be of the form $\alpha \mathrm{sin}nx+\beta \mathrm{cos}nx$ with $\alpha $, $\beta $, $n$ constants. We try to find a solution of the same form and put into (1) the expression

$y:=A\mathrm{sin}nx+B\mathrm{cos}nx.$ | (3) |

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

$$[(b-{n}^{2})A-anB]\mathrm{sin}nx+[anA+(b-{n}^{2})B]\mathrm{cos}nx.$$ |

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

$$(b-{n}^{2})A-anB=\alpha \mathit{\hspace{1em}}\text{and}\mathit{\hspace{1em}}anA+(b-{n}^{2})B=\beta .$$ |

These determine uniquely the values of $A$ and $B$ provided that
the determinant^{}

$$\left|\begin{array}{cc}\hfill b-{n}^{2}\hfill & \hfill -an\hfill \\ \hfill an\hfill & \hfill b-{n}^{2}\hfill \end{array}\right|={a}^{2}{n}^{2}+{(b-{n}^{2})}^{2}$$ |

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

$\frac{{d}^{2}y}{d{x}^{2}}}+{n}^{2}y=\alpha \mathrm{sin}nx+\beta \mathrm{cos}nx.$ | (4) |

Unless we have $\alpha =\beta =0$, the equation (4) has no solution of the form (3), since

$\frac{{d}^{2}}{d{x}^{2}}}(A\mathrm{sin}nx+B\mathrm{cos}nx)+{n}^{2}(A\mathrm{sin}nx+B\mathrm{cos}nx)=\mathrm{\hspace{0.33em}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

$$\frac{{d}^{2}}{d{x}^{2}}(Ax\mathrm{cos}nx-Bx\mathrm{sin}nx)+{n}^{2}(Ax\mathrm{cos}nx-Bx\mathrm{sin}nx)=-2nA\mathrm{sin}nx-2nB\mathrm{cos}nx.$$ |

The right hand side coincides with the right hand side of (4) iff $-2nA=\alpha $ and $-2nB=\beta $, and thus (4) has the solution

$$y:=-\frac{\alpha}{2n}x\mathrm{cos}nx+\frac{\beta}{2n}x\mathrm{sin}nx.$$ |

${4}^{\circ}$: Let $R(x)$ in (1) now be $\alpha {e}^{kx}$ where $\alpha $ and $k$ are constants. Denote the left hand side of (1) briefly $\frac{{d}^{2}y}{d{x}^{2}}+a\frac{dy}{dx}+by=:F(y)$. We seek again a solution of the same form $A{e}^{kx}$ as $R(x)$.

First we have

$$F(A{e}^{kx})=A\underset{f(k)}{\underset{\u23df}{({k}^{2}+ak+b)}}{e}^{kx}=Af(k){e}^{kx}.$$ |

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

$$y:=\frac{\alpha}{f(k)}{e}^{kx}=\frac{\alpha}{{k}^{2}+ak+b}{e}^{kx}$$ |

of the inhomogeneous equation (1).

If $f(k)=0$, then ${e}^{kx}$ and $A{e}^{kx}$ satisfy the homogeneous equation $F(y)=0$. Now we may start from the identity

$$F(A{e}^{rx})=Af(r){e}^{rx}$$ |

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

$F(Ax{e}^{rx})=A{e}^{rx}[{f}^{\prime}(r)+xf(r)],$ | (6) |

and differentiating anew,

$F(A{x}^{2}{e}^{rx})=A{e}^{rx}[{f}^{\prime \prime}(r)+2x{f}^{\prime}(r)+{x}^{2}f(r)].$ | (7) |

If $k$ is a simple root of the equation $f(r)=0$, i.e. if $f(k)=0$ but ${f}^{\prime}(k)\ne 0$, then $r:=k$ makes the right hand side of (6) to $A{f}^{\prime}(k){e}^{kx}$, which equals to $R(x)=\alpha {e}^{kx}$ by choosing $A:=\frac{\alpha}{{f}^{\prime}(k)}$. Then we have found the particular solution

$$y:=\frac{\alpha}{{f}^{\prime}(k)}x{e}^{kx}=\frac{\alpha}{2k+a}x{e}^{kx}.$$ |

We have still to handle the case when $k$ is the double root of the equation $f(k)=0$ and thus ${f}^{\prime}(k)=0$. Putting $r:=k$ into (7), the right hand side reduces to $A{f}^{\prime \prime}(k){e}^{kx}=2A{e}^{kx}$; this equals to $R(x)=\alpha {e}^{kx}$ when choosing $A:=\frac{\alpha}{2}$. So we have the particular solution

$$y:=\frac{\alpha}{2}{x}^{2}{e}^{kx}$$ |

of the given inhomogeneous equation.

${5}^{\circ}$: Suppose that in (1) the right hand side $R(x)$ is a sum of several functions,

$\frac{{d}^{2}y}{d{x}^{2}}}+a{\displaystyle \frac{dy}{dx}}+by={R}_{1}(x)+{R}_{2}(x)+\mathrm{\dots}+{R}_{n}(x),$ | (8) |

and one can find a particular solution ${y}_{i}(x)$ for each of the equations

$$\frac{{d}^{2}y}{d{x}^{2}}+a\frac{dy}{dx}+by={R}_{i}(x).$$ |

Then evidently the sum ${y}_{1}(x)+{y}_{2}(x)+\mathrm{\dots}+{y}_{n}(x)$ is a
particular solution of the equation (8).

## References

- 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 |