# Solving 1st order ODE with shift delta function as forcing function

I'm struggling to prove to myself why the answer to $$y'-a\cdot y=\delta(t-T)$$ with initial condition y(0)=0 is $y=0$ for $t < T$ and $y=e^{(a\cdot(t-T))}$.

After solving for the homogeneous equation, and then using variation of parameters, I am left with: $$y=u\cdot y_h$$, where $y_h = k \cdot e^{at}$.

Pluging $y$ into the ODE, and solving for u, I get $$u=e^{-a \cdot T}+k$$ $y$ is then$$y=(e^{-a \cdot T}+k) \cdot e^{a \cdot t}$$ Multiplying this out, I'm left with $$y=e^{a \cdot(t-T)}+k \cdot e^{a \cdot t}$$

Applying the initial condition, then this becomes $$y=e^{a \cdot(t-T)}-e^{a(t-T)}=0$$

I don't know what to do with that. If ignore the constant of integration wen I solve for $u$, then I would get the expected answer, but why would I know (have) to do that?

So, the homogeneous equation has the solution $Ce^{at}$. Apply the constant variation method and seek the solution in the form $c(t) e^{at}$, this gives you the expression $$c'(t) e^{at} + ac(t) e^{at} - a c(t) e^{at} = \delta(t-T),$$ or $$c'(t)e^{at} = \delta(t-T).$$ Multiply both parts by $e^{-at}$ (we have the right to do that because the function $t\to e^{-at}$ is $C^\infty$ and is never zero on $\Bbb R$) to get $$c'(t) =e^{-at}\delta(t-T) = e^{-aT}\delta(t-T).$$ The last equation has a straightforward solution $$c(t) = e^{-aT} H(t-T) + B,$$ where $B$ is constant and $H(t)$ is the Heavyside function $$H(x)=\begin{cases}1, &x\ge 0,\\0,&x<0\end{cases}$$ Therefore, $$y(t) = e^{at} \cdot ( e^{-aT} H(t-T) + B).$$ Apply the initial condition to get $0=y(0) = B$, hence $$y(t) =e^{-a(t-T)} H(t-T) .$$