Solution to first order ODE representing simple physics system Can you lead me to the solution to the following problem?
$$\left\{
\begin{array}{>{\displaystyle\tallstrut}l@{}}
y'(t)+ay(t)=f(t)\\
f(t)=\delta (t-t_0)\\
y(0)=y_0
\end{array}
\right.$$

Following the standard rules for first order ordinary differential equations
$$y(t)=y_0e^{-at}+e^{-at}\int^t_0f(s)e^{as}ds=y_0e^{-at}+F(t)\\
F(t)=\int^t_0f(s)e^{-a(t-s)}ds\\
$$
The book suggests the solution
$$F(t)=
\left\{
\begin{array}{>{\displaystyle\tallstrut}l@{}}
0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \ t<t_0\\
e^{-a(t-t_0)}\ \ \ \ \ if\ \ t<t_0\\
\end{array}
\right. $$
but I can't understand why, as integrating myself I obtain
$$F(t)=\frac{\delta}{a^2}[e^{-a t_0} (1 + a t_0)-e^{-a t} (1 + a t)]$$.
 A: What's important here is the property of the Dirac delta function $\delta(t)$ to "pick out" a single value under the integral sign:
$$\int_{-\infty}^{\infty}\delta(s-t_0)\,g(s)\,ds=g(t_0),$$
although the integral need not be the whole real line - it just needs to include $t_0.$ Applying this to your formula for the solution of the first-order ODE:
\begin{align*}
y(t)
&=y_0e^{-at}+e^{-at}\int^t_0f(s)\,e^{as}\,ds\\
&=y_0e^{-at}+e^{-at}\int^t_0\delta(s-t_0)\,e^{as}\,ds\\
&=y_0e^{-at}+e^{-at}e^{at_0},\quad t>t_0\\
&=y_0e^{-at}+e^{-a(t-t_0)},\quad t>t_0.
\end{align*}
A: An alternative solution is via the Laplace transform $\mathcal{L}[f](s)=\int_0^\infty e^{-s t}f(t)\,dt$. Writing $Y(s)=\mathcal{L}[y](s)$ (and assuming $e^{-st}f(t)\to 0$ as $t\to \infty$ for any $s>0$), we integrate by parts to obtain
$$\mathcal{L}[y'](s)=\int_0^\infty e^{-st} y'(t)\,dt = \left[e^{-s t}y(t)\right]_0^\infty-s\int_0^\infty e^{-s t}y(t)\,dt = sY(t)-y_0$$
which is a standard result in Laplace transforms. Moreover, the defining property of the Dirac delta function yields $$F(s)=\mathcal{L}[f](s)=\int_0^\infty e^{-st}\delta(t-t_0)\,dt = e^{-s t_0}.$$
Thus the stated IVP becomes, upon Laplace transform, the algebraic system
$$sY(s) - y_0 + aY(s)=e^{-s t_0}\implies Y(s) = \frac{y_0+e^{-s t_0}}{s+a}$$
To invert this transform, one typically looks at a Laplace transform table and applies certain 'simple' results. But in this case some simple observations suffice. First , we have $$\int_0^\infty e^{-st}e^{-at}\,dt=\frac{1}{s+a}.$$ If we multiply both sides by $y_0+e^{-st_0}$ for $t_0>0$, we therefore have
\begin{align}
Y(s)
&=\int_0^\infty (y_0+e^{-st_0})e^{-st}e^{-at}\,dt\\
&=\int_0^\infty e^{-s t}y_0 e^{-at}+\int_{t_0}^\infty e^{-s t}e^{-a(t-t_0)}\,dt\\
&=\int_0 e^{-st}(y_0 e^{-at}+ u(t-t_0)e^{-a(t-t_0)})\,dt
\end{align}
where in the second line I've shifted the second integral as $t\mapsto t-t_0$ and in the third I've used the unit step function $u(t)$ (i.e., $1$ if $t\geq 0$ and zero otherwise.). Therefore we may identify the solution as
$$y(t) = y_0 e^{-at}+e^{-a(t-t_0)}u(t-t_0)
=\left\{
\begin{array}{cc} 
y_0 e^{- a t}, & 0\leq t <t_0\\
y_0 e^{-a t}+e^{-a(t-t_0)}, & t\geq t_0
\end{array}\right.
$$
One could also replace $f(t)=\delta(t-t_0)$ by some generic $f(t)$ with support on $t\geq 0$, in which case we will need to invert $F(s)/(s+a)$. This is most readily accomplished via the convolution theorem and in this manner we recover the 'standard solution' quoted by the OP.
