Part B, Alternative solution.

Assume the second solution is of the form $y_2=z(t)t$. Plugging that into the ODE, we get that

$tz''+(2+t \frac{-t \cos (t)}{\cos(t)+t \sin(t)})z'=0$ (look at reduction of order at pg 171, formula 30). This is a first order ODE for z'. So, plug for example $u=z'$. This equation is separable and simplifies to

$$tu'=(\frac{t^2 \cos(t)}{\cos(t)+t \sin(t)}-2)u$$

$$\frac{1}{u}du=\frac{1}{t}(\frac{t^2 \cos(t)}{\cos(t)+t \sin(t)}-2)dt$$.

Now "just" integrate and you get

$$\ln u= \ln(t\sin(t)+\cos(t))-2\ln (t) + \ln C_1$$ or

$$z'=u=\frac{t\sin(t)+\cos(t)}{t^2}$$ (forget the constant)

Now we have to integrate once again to get

$z=\frac{-\cos(t)}{t}+C$; so in conclusion we get that $y_2=zy_1=\frac{-\cos(t)}{t}t+Ct=-cos(t)+Ct$

We need $y_2(\frac{\pi}{2})=0$ which yields C=0. So, $y_2=-\cos(t)$ is the function we are looking for. Also note that

$W(y_1,y_2)(\frac{\pi}{2})=-\cos(\frac{\pi}{2})+\frac{\pi}{2}\sin (\frac{\pi}{2})=\frac{\pi}{2}$, so the Wronskian condition is also satisfied.

Comment: I went for this solution idea during my test. Unfortunately, given half a page of room, exam pressure and those nasty integrals, I could not get to the final solution.