# Variation of parameters

I solved the differential equation $y'+ky=e^{rt}$ and found $y=\frac{e^{rt} }{r+k}+\lambda e^{-kt}$, for $r+k\neq0$

But I need to solve the missing case $r=-k$. I was thinking of using the method of variation of parameters but I don't really know how to use it here.

Thank you

The general solution of the homogeneous equation $y'+ky=0$ is $$y_h(t)=\lambda e^{-kt}.$$

When $r=-k$, the rhs of the ode belongs to this set. So we can't look for a particular solution of the form $Ae^{-kt}$. In this case, one looks for a particular solution of the form $$y_p(t)=Ate^{-kt}.$$ Plugging this in the lhs of the ODE yields $$-Akte^{-kt}+Ae^{-kt}+Akte^{-kt}=Ae^{-kt}.$$ So we take $A=1$, and $$y_p(t)=te^{-kt}.$$

The general solution of the ode is $$y(t)=y_h(t)+y_p(t)=\lambda e^{-kt}+te^{-kt}=(\lambda +t)e^{-kt}.$$

Note: the method to find $y_p$ is known as the method of undetermined coefficients.

You could also solve this first order linear ODE by the integrating factor method.

The variation of parameter is not bad either, since $y(t)=u(t)e^{-kt}$ is solution if and only if $$u'(t)e^{-kt}=e^{-kt}\quad\Leftrightarrow\quad u'(t)=1 \quad\Leftrightarrow\quad u(t)=t+\lambda.$$ Of course, you get the same result.

• @Carpediem You're welcome. See my edit: I've added a note about the integrating factor method and the variation of parameter. – Julien Mar 1 '13 at 21:33