Laplace Transform for Solving Differential Equation I solved the following task, but since I am new in this field I need to check if it is correct or if there is anything I am missing or doing wrong.
Task : Solve differential equation using Laplace transform.
$$y^{''}-y^{'}-2y=2t+1 \\y^\;(0)=1, \; y^{'}(0)=2$$
First i got the following equation : $$\mathcal{L}(y)=\frac{s^3+s^2+s+2}{s^2(s^2-s-2)}$$
Now this is the part that was kinda tricky. When i fractioned equation i got this : $$\frac{A}{s}+\frac{B}{s^2}+\frac{C}{s+1}+\frac{D}{s-2}$$
The fractions were : $$A=0,\;B=-1,\;C=1,\;D=0$$ Finally the result is : $$y(t)=-t + e^{-t}$$
 A: $$y''(t)-y'(t)-2y(t)=2t+1\Longleftrightarrow$$
$$\mathcal{L}_t\left[y''(t)-y'(t)-2y(t)\right]_{(s)}=\mathcal{L}_t\left[2t+1\right]_{(s)}\Longleftrightarrow$$
$$\mathcal{L}_t\left[y''(t)\right]_{(s)}-\mathcal{L}_t\left[y'(t)\right]_{(s)}-\mathcal{L}_t\left[2y(t)\right]_{(s)}=\mathcal{L}_t\left[2t\right]_{(s)}+\mathcal{L}_t\left[1\right]_{(s)}\Longleftrightarrow$$
$$\mathcal{L}_t\left[y''(t)\right]_{(s)}-\mathcal{L}_t\left[y'(t)\right]_{(s)}-2\cdot\mathcal{L}_t\left[y(t)\right]_{(s)}=2\cdot\mathcal{L}_t\left[t\right]_{(s)}+\mathcal{L}_t\left[1\right]_{(s)}\Longleftrightarrow$$

Now, use:


*

*$$\mathcal{L}_t\left[y(t)\right]_{(s)}=\text{Y}(s)$$

*$$\mathcal{L}_t\left[y'(t)\right]_{(s)}=s\text{Y}(s)-y(0)$$

*$$\mathcal{L}_t\left[y''(t)\right]_{(s)}=s^2\text{Y}(s)-sy(0)-y'(0)$$


And:


*

*$$\mathcal{L}_t\left[1\right]_{(s)}=\frac{1}{s}$$

*$$\mathcal{L}_t\left[t\right]_{(s)}=\frac{1}{s^2}$$


$$\left[s^2\text{Y}(s)-sy(0)-y'(0)\right]-\left[s\text{Y}(s)-y(0)\right]-2\cdot\left[\text{Y}(s)\right]=2\cdot\left[\frac{1}{s^2}\right]+\left[\frac{1}{s}\right]\Longleftrightarrow$$

Now, use the initial conditions, $y(0)=1$ and $y'(0)=2$:

$$\left[s^2\text{Y}(s)-1\cdot s-2\right]-\left[s\text{Y}(s)-1\right]-2\cdot\left[\text{Y}(s)\right]=2\cdot\left[\frac{1}{s^2}\right]+\left[\frac{1}{s}\right]\Longleftrightarrow$$
$$s^2\text{Y}(s)-s-2-s\text{Y}(s)+1-2\text{Y}(s)=\frac{2}{s^2}+\frac{1}{s}\Longleftrightarrow$$
$$\text{Y}(s)\left[s^2-s-2\right]=\frac{2}{s^2}+\frac{1}{s}+s+2-1\Longleftrightarrow$$
$$\text{Y}(s)=\frac{\frac{2}{s^2}+\frac{1}{s}+s+1}{s^2-s-2}=\frac{4}{3(s-2)}-\frac{1}{3(1+s)}-\frac{1}{s^2}$$
Now, using Inverse Laplace transform we find that:
$$y(t)=\frac{4e^{2t}}{3}-\frac{e^{-t}}{3}-t$$ 

EDIT:
$$\frac{\frac{2}{s^2}+\frac{1}{s}+s+1}{s^2-s-2}=\frac{s^3+s^2+s+2}{(s-2)s^2(s+1)}=\frac{\text{C}}{s^2}+\frac{\text{A}}{s-2}+\frac{\text{B}}{s}+\frac{\text{D}}{s+1}$$
Now, follow the steps:


*

*Multiply both sides by $(s-2)s^2(s+1)$;

*Expand and collect in terms of powers of $s$;

*Equate coefficients on both sides, yielding 4 equations in 4
unknowns:


$$
\begin{cases}
-2\text{C}=2\\
-2\text{B}-\text{C}=1\\
\text{A}-\text{B}+\text{C}-2\text{D}=1\\
\text{A}+\text{B}+\text{D}=1
\end{cases}\Longleftrightarrow
\begin{cases}
\text{A}=\frac{4}{3}\\
\text{B}=0\\
\text{C}=-1\\
\text{D}=-\frac{1}{3}
\end{cases}
$$
I tink that you can solve this further.
