How to solve $y''(t) + 4 y (t) = 2t \cos (2t)$ on time in the exam? I'm solving this ODE, which is from last year final exam

Solve in $\mathbb R$ the ODE $$y''(t) + 4 y (t) = 2t \cos (2t)$$

This ODE is not hard to solve, but it takes me a lot of time to compute the derivative $y',y''$ and simplifies them. This process is unfortunately likely to cause mistake.
The last year exam contains a total of $4$ questions, and has a duration of $1$ hour and $30$ minutes. Solving this ODE is just one of $4$ questions.

I would like to ask for a faster way to solve this ODE. Maybe it has a special characteristics that I'm unable to recognize.


My attempt:
The solution is of the form $$\begin{aligned} y (t) &= \big ( a \cos (2t) + b \sin (2t) \big ) + t(ct+d) \cos (2t) + t(gt+h) \sin (2t)\\
&= a \cos (2t) + b \sin (2t) + dt \cos (2t) +ht \sin (2t) + ct^2 \cos (2t) + gt^2 \sin (2t) \end{aligned}$$
where $a,b,c,d,g,h \in \mathbb R$. It follows that $$\begin{aligned}
y' (t) &= (2b+d) \cos (2t) + (h-2a) \sin (2t)\\
       & \qquad + 2(h+c) t \cos (2t) +2(g-d) t \sin (2t)\\
       & \qquad + 2g t^2 \cos (2t)  -2c t^2 \sin (2t)
\end{aligned}$$ and $$\begin{aligned}
y'' (t) &= 2(2h-2a+c) \cos (2t) -2 (2b+2d-g) \sin (2t)\\
       & \qquad + 4(2g-d) t \cos (2t) -4(h+2c) t \sin (2t)\\
       & \qquad -4c t^2 \cos (2t)  -4g t^2 \sin (2t)
\end{aligned}$$
Hence $$\begin{cases}
2(2h-2a+c) + 4a &=0 \\
-2 (2b+2d-g) +4b &=0 \\
4(2g-d) + 4d &=0 \\
-4(h+2c) + 4h  &=0 \\
-4c +4c &=0 \\
-4g+4g  &=0 \\
\end{cases} \iff
\begin{cases}
c &=0 \\
g &=1/4 \\
h &=0 \\
d  &=1/8 \\
\end{cases}$$
In conclusion, the solution is $$y(t) = a \cos (2t) + b \sin (2t) + \frac{1}{8} t \cos (2t)   + \frac{1}{4} t^2 \sin (2t)$$
 A: You can reduce the effort to one half by considering $y$ as the real part of the complex-valued solution to 
$$
z''+4z=2te^{2it}
$$
Then one particular solution is of the form $z_p(t)=t(At+B)e^{2it}$ by the method of undetermined coefficients, and the root structure that you correctly found. Now inserting this gives simply a $2\times 2$ linear system to solve,
\begin{align}
z_p'(t)&=(2At+B+2i(At^2+Bt))e^{2it}\\
z_p''(t)&=(4iAt+2(A+iB)-4At^2+4i(A+iB)t+2iB)e^{2it}\\
\hline
2t&=[-4At^2+4i(2A+B)t+2(A+2iB)] + 4[At^2+Bt]\\
&=8iAt+2(A+2iB)\\
\implies A&=-\frac{i}4,~~B=\frac{i}2A=\frac18
\end{align}
and thus
$$
y_p(t)=Re(z_p(t))=\frac{t^2}4\sin(2t)+\frac{t}8\cos(2t)
$$
A: Use the Metho of Variation of Parameters:
$y_1=\sin 2t, y_2= \cos 2t$ are the solutions of the homogeneous part
$$y''(t)+4y(t)=0$$
Then the solution of $$Y''+2tY(t)=f(t)$$ is given by
$$Y=C_1(t) y_1(t)+C_2(t) y_2(t),~~~(1)$$
where $$C_1(t)=\int \frac{-y_2(t)~ f(t)}{W}dt+D_1,~~ C_2=\int \frac{y_1(t)~ f(t)}{W}dt+D_2$$
Here $W$ is the Wronskian of $y_1$ and $y_2$ which is $-2$ and $f(t)=2t \cos 2t$
So we have $$C_1(t)=\int \cos 2t~ t ~\cos 2t~ dt+D_1= \frac{t^2}{4}+\frac{1}{32}\cos 4t+\frac{1}{8}t \sin 4t +D_1$$
Next, $$C_2(t)= -\int \sin 2t  ~t ~ \cos 2t ~dt+D_2= -\int \frac{t}{2} \sin 4t ~ dt +D_2=$$
$$\implies C_2(t)= \frac{t}{8} \cos 4t-\frac{1}{32} \sin 4t +D_2$$
So, the final solution is given by (1) as
$$Y(t)=\left[\frac{t^2}{4}+\frac{1}{32}\cos 4t+\frac{1}{8}t \sin 4t +D_1 \right] \sin 2t+\left[\frac{t}{8} \cos 4t-\frac{1}{32} \sin 4t +D_2 \right] \cos2 t$$
$$\implies Y(t)= \left( \frac{t^2}{4} \sin 2t-\frac{1}{32} \sin 2t+\frac{t}{8}\cos2t \right)+\left( D_1\sin 2t + D_2 \cos 2t \right)$$
Mathematica gives
{{y[x] -> (x/8 + C[1]) Cos[2 x] + 
    1/32 (-1 + 8 x^2 + 32 C[2]) Sin[2 x]}}
