$x''(t) + tx'(t) – (t+1)x = 0$, where $ x(0) = x'(0) = 1. $
The Laplace transform of $tx'$ is $-X(s) – sX'(s)$
The Laplace transform of $tx$ is $-X'(s)$
So we get $s^2X-s-1-X(s)-sX'(s) + X'(s) – X(s) = 0.$
$$X'(s) + X(s) \frac{s^2-2}{s-1} = \frac{s+1}{1-s}.$$
I tried solving this differential equation and then inverse Laplace it but it would't work
The answer is too simple for how much I am complicating it : $ x(t) = e^t.$
Best Answer
You got a sign error in your rearrangement: you should have$$X^\prime+\frac{s^2-2}{\color{blue}{1-s}}X=\frac{s+1}{1-s}.$$If that's still hard to solve, use the Ansatz $X=\frac{Y}{s-1}$ so$$(1+s)Y-Y^\prime=s+1,$$which has obvious root$$Y=1\implies X=\frac{1}{s-1}\implies x=e^t.$$The large-$s$ behaviour of a Laplace transform precludes any other choice of $Y$.