The answer is given by using properties of Laplace transform.

Step 2

\(y'-y=t e^t \sin(t)\)

\(y(0)=0\)

Apply the laplace transform

\(L\left\{y'\right\}-L\left\{y\right\}=L\left\{t e^t \sin(t)\right\}\)

\(\Rightarrow (sY(s)-y(0))-Y(s)=\frac{2(s-1)}{(s^2-2s+2)^2}\)

\(\Rightarrow sY(s)-Y(s)=\frac{2(s-1)}{(s^2-2s+2)^2}\)

\(\Rightarrow (s-1)Y(s)=\frac{2(s-1)}{(s^2-2s+2)^2}\)

\(\Rightarrow Y(s)=\frac{2}{(s^2-2s+2)^2}\)

Now apply inverse laplace transform

\(\Rightarrow L^{-1}\left\{Y(s)\right\}=L^{-1}\left\{\frac{2}{(s^2-2s+2)^2}\right\}\)

\(\Rightarrow y(t)=L^{-1}\left\{\frac{2}{((s-1)^2+1)^2}\right\}\)

\(\Rightarrow y(t)=e^t \sin(t)-t e^t \cos(t)\)

\(\Rightarrow y(t)=e^t(\sin(t)-t\cos(t))\)