Answer
The solution of the initial value problem is $t^2y=-t \cos{t}+\sin{t}+\dfrac{\pi^2-4}{4}$ or $y=- \dfrac{\cos{t}}{t}+\dfrac{\sin{t}}{t^2}+\dfrac{\pi^2-4}{4t^2}$.
Work Step by Step
Firstly, divide the equation by $t$ on both sides.
We get, $y'+\dfrac{2}{t}y=\dfrac{\sin{t}}{t}$
By, comparing the differential equation with the linear form $y'+P(t)y=Q(t)$
We get, $P(t)=\dfrac{2}{t}$
Thus, the integrating factor $u(t)=e^{\int \frac{2}{t}\, dt}$
$\implies u(t)=e^{2\,ln(t)+c}=e^{2\,ln(t)}e^c$
Now multiply the equation by $u(t)$ on both sides.
We get, $e^{2\,ln(t)}e^cy'+e^{2\,ln(t)}e^c\dfrac{2}{t}y=e^{2\,ln(t)}e^c\cdot \dfrac{\sin{t}}{t}$
Now integrate on both sides
We get, $ e^{2\,ln(t)}y=\int e^{2\,ln(t)}\cdot \dfrac{\sin{t}}{t}\,dt$
Now simplify as follows;
$ e^{ln(t^2)}y=\int e^{ln(t^2)}\cdot \dfrac{\sin{t}}{t}\,dt$
$\implies t^2y=\int t^2\cdot \dfrac{\sin{t}}{t}\,dt$
$\implies t^2y=\int t\cdot \sin{t}\,dt$
Now integrate using by parts as follow:
$\implies t^2y=t\int \sin{t}\,dt-\int\left(\int \sin{t}\,dt\right)dt$
$\implies t^2y=-t \cos{t}-\int\left(- \cos{t}\right)dt$
$\implies t^2y=-t \cos{t}+\sin{t}+c$
Substitute the initial condition $y(\pi/2)=1$
We get, $\dfrac{\pi^2}{4}\cdot1=-\dfrac{\pi}{2} \cos{\dfrac{\pi}{2}}+\sin{\dfrac{\pi}{2}}+c$
$\implies c=\dfrac{\pi^2}{4}-1=\dfrac{\pi^2-4}{4}$
Hence, the solution of the initial value problem is $t^2y=-t \cos{t}+\sin{t}+\dfrac{\pi^2-4}{4}$ or $y=- \dfrac{\cos{t}}{t}+\dfrac{\sin{t}}{t^2}+\dfrac{\pi^2-4}{4t^2}$.