$$\begin{cases}y'+y=\delta(t) \\ y(0)=0\end{cases}$$
I have used Laplace transform:
$$\mathscr{L} \{ \delta(t) \}=1$$ $$\mathscr{L} \{ y'+y \}=sY(s)-0 +Y(s)=sY(s)+Y(s)$$
$$sY(s)+Y(s)=1$$ $$(s+1) Y(s)=1$$ $$Y(s)=\frac{1}{s+1}$$
Inverse Laplace transform:
$$y(t)=e^{-t}$$
But, $y(0)=1 \ne 0 $
Where is the problem?
Thanks!
Your solution is mostly fine.
The only thing you have to remember is that pointwise value of $y(t)$, especially at $t = 0$, means almost nothing in this business. This is because it is meaningless to interpret $\delta$ in pointwise sense around $t = 0$. Consequently the initial condition is mathematically not well-defined.
Indeed, since the derivative of $y'$ is mostly driven by the impulse $\delta(t)$ near $t = 0$, you should expect that there is a unit jump at $t = 0$. Now by the same computation as LutzL's solution, the general solution is
$$ y(t) = ce^{-t} + e^{-t}u(t) $$
where $u(t)$ is the unit step function. If we interpret the initial condition as $y(0^-) = 0$, then $c = 0$ and we indeed obtain $y(t) = e^{-t} u(t)$. Other interpretation of the condition $y(0) = 0$ will lead to different answers, however, even though they may lead to the value $c\neq 0$ which is physically not plausible.