Variation of constants on a second order DE Given is the DE $$\frac{d^2z}{dx^2}+z=\frac{\mu}{x^2}z$$
I have to prove that for $0<a\leqslant x$, $$z(x)=z(a)\cos(x-a)+z'(a)\sin(x-a) + \int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi$$
I think it is a good idea to use variation of constants. So first I solved $\frac{d^2z}{dx^2}+z=0$, giving me $z(x)=c_1\sin(x)+c_2\cos(x)$, with $c_1, c_2$ constants. Then, I wrote $z(x)=u_1(x)\sin(x)+u_2(x)\cos(x)$ and calculated $z'(x)$ and $z''(x)$ accordingly. But here I got lost.
Can anybody help me?
 A: $$z(x)=z(a)\cos(x-a)+z'(a)\sin(x-a) + \int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi$$
$$z''(x)=-z(a)\cos(x-a)-z'(a)\sin(x-a) +  \frac {\partial^2}{\partial x^2} \int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi$$
Use Leibniz rule for the derivative of the integral... Then check if z is a solution of the equation..
$$\frac {\partial}{\partial x} \int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi= \int_a^x \frac {\partial}{\partial x}\sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi= \int_a^x  \cos(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi$$
$$\frac {\partial}{\partial x} \int_a^x \cos(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi= -\int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi+\frac{z(x)\mu}{x^2}$$
Therefore
$$\frac {\partial^2}{\partial x^2} \int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi=-\int_a^x \sin(x-\xi)\frac{\mu}{\xi^2}z(\xi) \, d\xi+\frac{z(x)\mu}{x^2}$$
The variation of constants is for differential equation with constants coefficients...Here you have a function of x.
A: Variation of constant does not work here, because the right hand side has a $z$ in it.  In fact this is a homogeneous differential equation.$$\frac{d^2z}{dx^2}+z=\frac{\mu}{x^2}z \iff   \frac{d^2z}{dx^2}+(1-\frac{\mu}{x^2})z=0            $$
