Answer
The solution to the differential equation is $y=\dfrac{3\sin(2t)}{2}+\dfrac{3}{4t}\cos(2t)$.
Work Step by Step
By comparing the differential equation with the linear form $y'+p(t)y=g(t)$
We get, $p(t)=\dfrac{1}{t}$ and $g(t)=3 \cos (2t)$
Now use the equation (iv) $A'(t)=g(t)e^{\int p(t)\,dt}$.
We get, $A'(t)=3\cos(2t)e^{\int \frac{1}{t}\,dt}=3\cos(2t)e^{ln(t)+c}=3e^ct\cos(2t)$
Now, integrate using by parts as follows:
$A(t)=3e^c\int t\cos(2t)\,dt$
$\implies A(t)=3e^ct\int \cos(2t)\,dt-3e^c\int\left(\int \cos(2t)\,dt\right)\,dt$
$\implies A(t)=\dfrac{3e^ct\sin(2t)}{2}-\dfrac{3e^c}{2}\int \sin(2t)\,dt$
$\implies A(t)=\dfrac{3e^ct\sin(2t)}{2}+\dfrac{3e^c}{4}\cos(2t)$
Now solve equation (iii) $y=A(t)e^{-\int p(t)dt}$
$y=\left(\dfrac{3e^ct\sin(2t)}{2}+\dfrac{3e^c}{4}\cos(2t)\right)e^{-c}t^{-1}$
$y=\dfrac{3\sin(2t)}{2}+\dfrac{3}{4t}\cos(2t)$
Hence, the solution to the differential equation is $y=\dfrac{3\sin(2t)}{2}+\dfrac{3}{4t}\cos(2t)$.