\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{amssymb}
%\usepackage{microtype}
\begin{document}
In this note we present a fast method for solving non-homogeneous higher order differential equations with constant coefficients. While such methods as undetermined coefficients and variation of parameters are valid techniques to solve such equations, they are often computationally intense. To put it in simple words, you will not have enough time to apply these methods on a test!
Let us consider a differential equation
\begin{equation*}
y'' - 2y' + y = xe^x + e^x.
\end{equation*}
One can verify that the characteristic polynomial to a corresponding homogeneous equation is given by $Q(r) = (r - 1)^2$ and its general solution is
\begin{equation*}
y(x) = C_1e^x + C_2xe^x.
\end{equation*}
Instead of proceeding, using the method of undetermined coefficients or method of variation of parameters, we apply the following trick. If we let $\mathcal{L}(y) = y'' - 2y' + y$, then
\begin{multline*}
\mathcal{L} \left( A \frac{x^m}{m!} e^{rx} \right) = \\
Ae^{rx} \left( Q(r) \frac{x^m}{m!} + Q'(r) \frac{x^{m-1}}{(m-1)!} + Q''(r) \frac{x^{m-2}}{2!(m-2)!} + Q'''(r) \frac{x^{m-3}}{3!(m-3)!} + \cdots \right).
\end{multline*}
Using this, we would like to find $A$, $r$, and $m$ such that
\begin{equation*}
\mathcal{L} \left( A \frac{x^m}{m!} e^{rx} \right) = xe^x.
\end{equation*}
We note that $Q(1) = Q'(1) = 0$ and $Q''(1) = 2$, so taking $r = 1$ we have that
\begin{equation*}
\mathcal{L} \left( A \frac{x^m}{m!} e^x \right) = AQ''(1) \frac{x^{m-2}}{2!(m-2)!} e^x,
\end{equation*}
so we need to take $A = 1$ and $m - 2 = 1$ (or $m = 3$). Similarly, we would like to find $A$, $r$, and $m$ such that
\begin{equation*}
\mathcal{L} \left( A \frac{x^m}{m!} e^{rx} \right) = e^x.
\end{equation*}
Again taking $r = 1$, we get that
\begin{equation*}
\mathcal{L} \left( A \frac{x^m}{m!} e^x \right) = AQ''(1) \frac{x^{m-2}}{2!(m-2)!} e^x,
\end{equation*}
so taking $A = 1$, $m - 2 = 0$ (or $m = 2$) gives the desired result. One can now verify that a general solution to our original equation is given by
\begin{equation*}
y(x) = C_1e^x + C_2xe^x + \frac{x^3}{3!} e^x + \frac{x^2}{2!} e^x.
\end{equation*}
Once you understand and master this technique, it can take you seconds to solve equations like this one (unlike other methods which involve long computations which often lead to mistakes). Again, it is up to you which method you use to solve an equation, but some methods may be more efficient than others. \\
\bigskip\noindent
\textbf{Exercise:} Solve the equation $y'' - 2y' + y = x$.
\end{document}