Method of Undetermined Coefficients/Exponential

Proof Technique
Consider the nonhomogeneous linear second order ODE with constant coefficients:
 * $(1): \quad y'' + p y' + q y = R \left({x}\right)$

Let $R \left({x}\right)$ be of the form of an exponential function:
 * $R \left({x}\right) = K e^{a x}$

The Method of Undetermined Coefficients can be used to solve $(1)$ in the following manner.

Method and Proof
Let $y_g \left({x}\right)$ be the general solution to:
 * $y'' + p y' + q y = 0$

From Solution of Constant Coefficient Homogeneous LSOODE, $y_g \left({x}\right)$ can be found systematically.

Let $y_p \left({x}\right)$ be a particular solution to $(1)$.

Then from General Solution of Linear 2nd Order ODE from Homogeneous 2nd Order ODE and Particular Solution:
 * $y_g \left({x}\right) + y_p \left({x}\right)$

is the general solution to $(1)$.

It remains to find $y_p \left({x}\right)$.

Let $R \left({x}\right) = K e^{a x}$.

Consider the auxiliary equation to $(1)$:
 * $(2): \quad m^2 + p m + q = 0$

There are three cases to consider.


 * $a$ is not a root of $(2)$

Assume that there is a particular solution to $(1)$ of the form:
 * $y_p = A e^{a x}$

We have:

Inserting into $(1)$:

Hence:
 * $y_p = \dfrac {K e^{a x} } {a^2 + p a + q}$

From Solution of Constant Coefficient Homogeneous LSOODE, $y_g$ depends on whether $(2)$ has equal or unequal roots.

Let $m_1$ and $m_2$ be the roots of $(2)$.

Then:
 * $y = \begin{cases}

C_1 e^{m_1 x} + C_2 e^{m_2 x} + \dfrac {K e^{a x} } {a^2 + p a + q} & : m_1 \ne m_2: m_1, m_2 \in \R \\ C_1 e^{m_1 x} + C_2 x e^{m_1 x} + \dfrac {K e^{a x} } {a^2 + p a + q} & : m_1 = m_2 \\ e^{r x} \left({C_1 \cos s x + C_2 \sin s x}\right) + \dfrac {K e^{a x} } {a^2 + p a + q} & : m_1 = r + i s, m_2 = r - i s \end{cases}$

is the general solution to $(1)$.


 * $a$ is a root of $(2)$

If $a$ is a root of $(2)$, then $a^2 + p a + q = 0$ and so $\dfrac {K e^{a x} } {a^2 + p a + q}$ is undefined.

Let the auxiliary equation to $(2)$ have two unequal real roots $a$ and $b$.

Assume that there is a particular solution to $(1)$ of the form:
 * $y_p = A x e^{a x}$

We have:

Inserting into $(1)$:

Hence:
 * $y_p = \dfrac {K x e^{a x} } {2 a + p}$

and so from Solution of Constant Coefficient Homogeneous LSOODE:
 * $y = C_1 e^{a x} + C_2 e^{b x} + \dfrac {K x e^{a x} } {2 a + p}$

is the general solution to $(1)$.


 * $a$ is a repeated root of $(2)$

If the auxiliary equation to $(2)$ has two equal real roots $a$, then:
 * $a = - \dfrac p 2$

and so not only:
 * $a^2 + p a + q = 0$

but also:
 * $2 a + p = 0$

and so neither of the above expressions involving $e^{a x}$ and $x e^{a x}$ will work as particular solution to $(1)$.

So, assume that there is a particular solution to $(1)$ of the form:
 * $y_p = A x^2 e^{a x}$

We have:

Inserting into $(1)$:

Hence:
 * $y_p = \dfrac {K x^2 e^{a x} } 2$

and so:
 * $y = y_g + \dfrac {K x^2 e^{a x} } 2$

and so from Solution of Constant Coefficient Homogeneous LSOODE:
 * $y = C_1 e^{a x} + C_2 x e^{a x} + \dfrac {K x^2 e^{a x} } 2$

is the general solution to $(1)$.