Undetermined Coefficients

So far, we have seen how to find solution to homogeneous ODEs $$ L[y] = 0.$$ We are now going to learn what to do when the right hand side is not zero. There will be two main strategies we will employ, and both of them will rely on the linear superposition principle.

If $y$ is a solution to the inhomogenous linear ode $$L[y] = f(t),$$ then we will write $y$ as a sum of two pieces, $y = y_p + y_c.$ The complementary solution $y_c$ satisfies $L[y_c] = 0,$ while the particular solution $y_p$ satisfies $L[y_p]=f(t).$ At first glance, it may look like the particular solution $y_p$ is all we need, but notice that $$L[y_p]+L[y_c] = 0 + f(t),$$ so $y_p+ y_c$ also solves the inhomogeneous ODE. So if we are to find the most general solution, we must include $y_c$.

For certain forms of $f(t),$ we can make an educated guess about the form that $y_p$ will take. That guess will typically be a linear combination of $f(t)$ along with derivatives of $f(t).$

Example: Find the solution to the IVP $$\frac{d^2y}{dt^2} - y = \sin(t), \qquad y(0) = 0, ~~y'(0) = 1.$$ First we will find the complementary solution $y_c,$ which satisfies $$\frac{d^2y_c}{dt^2} - y_c = 0.$$ As we have seen in an earlier class, the general solution to this equation is $y_c = C_1 e^{t}+C_2 e^{-t}.$

To find a particular solution we will choose to look for a function in the form of $y_p = A\sin(t) +B\cos(t).$ Substituting this guess into the ODE gives \begin{align} \frac{d^2}{dt^2}(A\sin(t)+B\cos(t))-A\sin(t)-B\cos(t) &= \sin(t)\\ -2A\sin(t)-2B\cos(t) = \sin(t). \end{align} By matching coefficients on the left and right, we have $A=-1/2$ and $B=0.$ Therefore we have $y_c = -\frac{1}{2}\sin(t)$ and the general solution is \begin{align} y &= y_c+y_p \\ &= C_1e^t+C_2e^{-t}-\frac{1}{2}\sin(t). \end{align} To satisfy the initial conditions, we need \begin{align} y(0) &= C_1 e^0+C_2e^{-0}-\frac{1}{2}\sin(0)\\ 0 &= C_1 + C_2, \end{align} and \begin{align} y'(0) &= C_1 e^0-C_2e^{-0}-\frac{1}{2}\cos(0)\\ 1 &= C_1 - C_2 -\frac{1}{2}, \end{align} Solving gives $C_1 = 3/4$ and $C_2=-3/4$, and therefore $$y(t) = \frac{3}{4} e^{t}-\frac{3}{4}e^{-t}-\frac{1}{2}\sin(t)$$ is the solution to the initial value problem.

Example: Find the general solution to $$ \frac{d^2y}{dt^2} +2\frac{dy}{dt}-3y = e^t $$ First, we look for the complementary solution $y_c$ in the form $y_c = e^{\lambda t}.$ \begin{align} \frac{d^2y_c}{dt^2}+2\frac{dy_c}{dt} - 3y_c &= 0 \\ e^{\lambda t} (\lambda^2+2\lambda - 3) &= 0\\ e^{\lambda t} ( \lambda +3)(\lambda - 1) &= 0.\\ \end{align} Therefore we have $y_c = C_1e^{-3t}+C_2e^{t}.$

To find the particular solution $y_p,$ we should want to assume $y_p = A e^{t}.$ However, this guess for the particular solution is linearly dependent on the fundamental solution set for $L[y_c] = 0$. In particular, if we substitute $y_p = Ae^{t}$ into the ODE, we will just get zero. We need to find something linearly independent of the complementary solution set.

As before, we can get a linearly independent function by multiplying the old function by $t$. Therefore, we will guess $y_p = A t e^{t}.$ Then \begin{align} \frac{d^2 y_p }{dt^2}+2\frac{dy_p}{dt}-3y_p &= e^t\\ (Ate^t+ 2Ae^t)+2(Ate^t+Ae^t)-3(Ate^t) &=e^t\\ 3Ae^t &= e^t. \end{align} Matching coefficients tells us $A = 1/3,$ and therefore the general solution is $$ y(t) = C_1e^{-3t}+C_2e^{t}+\frac{1}{3}te^t.$$

Practice Problems

Find the general solution to each of the following ODEs.
  1. $$\frac{d^2y}{dt^2}-\frac{dy}{dt} = \cos(t)$$
  2. $$\frac{d^2y}{dt^2}+2\frac{dy}{dt}+5y = t^2+1$$
  3. $$\frac{d^2y}{dt^2}+6\frac{dy}{dt}+9y = e^{-3t}$$