Solve equation taking Laplace transforms I'm solving this equation using Laplace transform
$$ Y''(t) + (t+1)Y'(t) + tY(t) = 0 $$
and I know that $Y(0)=1$ and $Y`(0)=-1$, so I start solving it taking Laplace transform
$$ \mathcal{L}\{Y''(t)\} + \mathcal{L}\{tY'(t)\} + \mathcal{L}\{Y'(t)\} + \mathcal{L}\{tY(t)\} $$
calculating the transforms,
$$ \mathcal{L}\{Y(t)\} = f(s) $$ $$ \mathcal{L}\{Y'(t)\} = sf(s)-1 $$ $$ \mathcal{L}\{Y''(t)\} = s^2f(s)-s+1 $$ $$ \mathcal{L}\{tY(t)\} = -f'(s) $$ $$ \mathcal{L}\{tY'(t)\} = -f(s)-sf'(s)$$
I get
$$ s^2f(s) + sf(s) - f(s) -s -sf'(s) - f'(s) = 0 $$
what I have to do now?
 A: The general solution from the differential equation
\begin{align}
\left[ \partial_{t}^{2} + (t+1) \partial_{t} + t \right] y(t) = 0
\end{align}
is
\begin{align}
y(t) &= c_{1} e^{-t^{2}/2} H_{-1}\left( \frac{t-1}{\sqrt{2}} \right) + c_{2} e^{1/2 -t} \\
&= e^{-t} \left[ A \,\,  erf\left(\frac{t-1}{\sqrt{2}}\right) + B \right].
\end{align}
Now the Laplace transform of the equation is as follows.
\begin{align}
L\{ \left[ \partial_{t}^{2} + (t+1) \partial_{t} + t \right] y(t) \} = 0
\end{align}
which becomes
\begin{align}
(s+1) \partial_{s} y(s) - (s^{2} + s -1) y(s) = -y(0)(s+1) - y^{'}(0)
\end{align}
or
\begin{align}
\partial_{s} y(s) - \left( s - \frac{1}{s+1} \right) y(s) &= -y(0) - \frac{y^{'}(0)}{s+1} \\
\frac{1}{s+1} \, e^{s^{2}/2} \partial_{s} \left[ (s+1) e^{-s^{2}/2} y(s) \right] &=  -y(0) - \frac{y^{'}(0)}{s+1}  \\
\partial_{s} \left[ (s+1) e^{-s^{2}/2} y(s) \right] &= y(0)(s+1) \, e^{-s^{2}/2}
- y^{'}(0) e^{-s^{2}/2} \\
(s+1) e^{-s^{2}/2} y(s) &= y(0) e^{-s^{2}/2} - (y(0) + y^{'}(0)) \int^{s} e^{-u^{2}/2} du 
\end{align}
which gives
\begin{align}
y(s) &= \frac{y(0)}{s+1} - \sqrt{ \frac{\pi}{2} }(y(0) + y^{'}(0)) \, \frac{1}{s+1} \, e^{-s^{2}/2} \,  erf\left(\frac{s}{\sqrt{2}}\right). 
\end{align}
Inverting the transform yields
\begin{align}
y(t) &= y(0) e^{-t} - \sqrt{ \frac{\pi}{2} }(y(0) + y^{'}(0)) L^{-1}\{\frac{1}{s+1} \, e^{-s^{2}/2} \,  erf\left(\frac{s}{\sqrt{2}}\right) \} \\
&= y(0) e^{-t} - \sqrt{ \frac{\pi}{2} }(y(0) + y^{'}(0)) \, e^{-t^{2}/2} \,\,\cdot \frac{1}{2\pi i} \int_{\gamma-i \infty}^{\gamma + i \infty} e^{(s+t)^{2}/2} \, erf(s+t/\sqrt{2}) \frac{ds}{s+1} \\ 
&= y(0) e^{-t} - \sqrt{ \frac{\pi}{2} }(y(0) + y^{'}(0)) \, e^{-t^{2}/2} \,\, e^{(t-1)^{2}/2} \, erf(t-1/\sqrt{2}) \\ 
y(t) &= e^{-t} \left[ y(0) - \sqrt{ \frac{\pi}{2} }(y(0) + y^{'}(0)) \,\, erf\left(\frac{t-1}{\sqrt{2}}\right) \right].
\end{align}
Since the initial conditions are $y(0) =1$ and $y^{'}(0) = -1$ then the solution is
\begin{align}
y(t) = e^{-t}.
\end{align}
A: Try solving the ODE! We have
$\frac{s^2+s-1}{s+1}f(s) - f'(s) = \frac{s}{s+1}$
Now you can apply the standard method: factorize the LHS into $(-g(s)f(s))'/g(s)$ where $g(s) = \exp(-\int \frac{s^2+s+1}{s+1})$ and then integrate up and solve. From experience it looks like the solution should be something like
$f(s) = \frac{A}{s+1}$
Plugging this in gives $A=1$ so this is indeed the correct solution
Now just invert this to find $Y(t) = \exp(-t)$
