Find the laplace transform of
$$f(t)=e^{-2t}\cos^2 3t - 3t^2 e^{3t}$$
The answer is $$\frac{1}{2(s+2)}+ \frac{1}{2} \frac{s+2}{s^2 + 4s + 40} - \frac{6}{(s-3)^3}.$$
This took me about an hour to solve, which seems ridiculously long. I probably did things inefficiently, how can this be solved?
My method: Separate using linearity and then integrate by parts, with partial fraction decomposition.
Remember that
$$\cos^2(3t) = \frac{1+\cos(6t)}{2}$$
and
$$\mathcal{L}(t^n f(t)) = (-1)^n \frac{d^n}{ds^n} F(s).$$