a) Find Wronskian $W(y_1, y_2)(x)$ of a fundamental set of solutions $y_1(x)$, $y_2(x)$ for ODE $x^2y'' -2xy' + (x^2+2)y = 0$
b) Check that $y_1(x) = xcosx$ is a solution and find another linearly independent solution.
c) Write the general solution, and find solution that $y(\frac{\pi}{2}) = 1, y'(\frac{\pi}{2}) = 0$
a)
$$y'' - \frac{2}{x}y' + (1 + \frac{2}{x^2}) = 0$$
We see that $p(x) = -\frac{2}{x}$ is continuous everywhere except at $x=0$, $q(x) = (1 + \frac{2}{x^2})$ is continuous everywhere except at $x=0$.
Then by Abel's Theorem,
$$W(y_1, y_2)(x) = ce^{-\int p(x)dx} = ce^{\int(\frac{2}{x})dx} = ce^{2lnx} = cx^2$$
b)
Let's verify $y_1(x) = xcosx$ is a valid solution.
Since $y_1(x) = xcosx$, $y'_1(x) = cosx-xsinx$, $y''_1(x) = -sinx-xcosx-sinx = -xcosx-2sinx$
Plug in: $x^2y'' -2xy' + (x^2+2)y = 0 = -x^3cosx-2x^2sinx - 2xcosx + 2x^2sinx + x^3cosx + 2xcosx = 0$
So $y_1(x) = xcosx$ is a solution.
Take $c = 1, W(y_1, y_2)(x) = x^2$.
By Reduction of Order, we have:
$$y_2 = y_1\int(\frac{ce^{-\int p(x)dx}}{(y_1)^2})dx = xcosx\int(\frac{x^2}{(x^2cos^2x})dx = xcosx\int sec^2xdx = xcosx tanx = xsinx$$
c)
Then by part b, the general solution is $y = c_1xcosx +c_2xsinx$
The derivative is given by $y' = c_1(cosx -xsinx) + c_2(xcosx + sinx)$
Plug in the initial conditions $y(\frac{\pi}{2}) = 1, y'(\frac{\pi}{2}) = 0$, we have
$1 = \frac{\pi}{2}c_2$ and $0 = (-\frac{\pi}{2})c_1 + c_2$
So $c_2 = \frac{2}{\pi}$ and $c_1 = \frac{4}{(\pi)^2}$
The particular solution is,
$$y = \frac{4}{(\pi)^2}xcosx +\frac{2}{\pi}xsinx$$