Answer
The solution of the initial value problem is $y=\dfrac {\sin{t}}{t^2}$.
Work Step by Step
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{\cos{t}}{t^2}$
Now integrate on both sides
We get, $ e^{2\,ln(t)}y=\int e^{2\,ln(t)}\cdot\frac{\cos{t}}{t^2}\,dt$
Now simplify as follows;
$ e^{ln(t^2)}y=\int e^{ln(t^2)}\cdot\frac{\cos{t}}{t^2}\,dt$
$\implies t^2y=\int t^2\cdot\frac{\cos{t}}{t^2}\,dt$
$\implies t^2y=\int \cos{t}\,dt$
$\implies t^2y= \sin{t}+c$
Substitute the initial condition $y(\pi)=0$
We get, $\pi^20= \sin{\pi}+c$
$\implies c=0$
Hence, the solution of the initial value problem is $y=\dfrac {\sin{t}}{t^2}$.