Answer
The solution is
$$y(t)=\frac{1}{t^{2}}[-t . cos(t)+sin(t)+ c]=\frac{sin(t)}{t^{2}}-\frac{-cos(t)}{t}+\frac{c}{t^{2}}.
$$
where $c$ is a constant.
Work Step by Step
$$ty^{'}+2y=sin(t), t\gt0$$
dividing by $t$ we have :
$$y^{'}+\frac{2}{t}y=\frac{1}{t}sin(t), t\gt0 , (* )$$
we know that :
$$p(t)=\frac{2}{t}, g(t)=\frac{1}{t}sin(t)$$
The homogeneous solution is
$$y(t)=Ae^{\int{-p(t)dt}}=Ae^{\int{-\frac{2}{t}dt}}=Ae^{-2ln{t}}=A t^{-2}
$$
where $A$ is a constant.
By using the method of variation of parameters, we assume that the solution of Eq. (*) is of the form
$$ y(t)=A(t)e^{\int{-p(t)dt}}=A(t). t^{-2}, (**)
$$
where A is now a function of t. By substituting for y in the given differential equation, show that A(t) must satisfy the condition
$$A^{'}(t)=g(t)e^{\int{p(t)dt}}=\frac{1}{t}sin(t). t^{2}=t. sin(t)
$$
by integration we find
$$A(t)=\int {t. sin(t)dt }
$$
integration by parts shows that :
$$A(t)=-t. cos(t)+sin(t)+c
$$
where $c$ is a constant.
Then substitute for A(t) in Eq. (**) and determine y.
$$y(t)=\frac{1}{t^{2}}[-t . cos(t)+sin(t)+ c]=\frac{sin(t)}{t^{2}}-\frac{-cos(t)}{t}+\frac{c}{t^{2}}.
$$