Answer
$$u= t^3- t^2$$
Work Step by Step
Given $$t \frac{d u}{d t}=t^{2}+3 u, \quad t>0, \quad u(2)=4$$
Rewriting the equation as
$$ \frac{d u}{d t}-\frac{3}{t}u =t $$
Since the equation is linear and $p(t)= \frac{-3}{t}$ and $q(t)=t$, then
\begin{align*}
\mu &=e^{\int p(t)}dt\\
&= e^{\int \frac{-3}{t}dt}\\
&=e^{-3\ln t}\\
&=t^{-3}
\end{align*}
Hence the general solution given by
\begin{align*}
\mu(t)u&=\int \mu(t)q(t)dt\\
t^{-3}u&= \int t^{-3} tdt\ \ \\
&= \int t^{-2} dt\ \ \\
&=\frac{-1}{t}+C
\end{align*}
Then
$$u=- t^2+Ct^3$$
Since $u(2 )=4 $, then $C=1$, hence
$$u=- t^2+ t^3$$