# Is this Sturm-Liouville problem self-adjoint?

We are interested in determining whether the problem $$\begin{cases}xu''-u'+u = \cos(x)\\u(0) = 0 \\ u(1) = u'(1)\end{cases}$$ is self-adjoint.

This is not a Sturm-Liouville problem, the corresponding SL problem is $$\begin{cases}(\frac{1}{x}u')'+\frac{1}{x^2}u = \frac{\cos(x)}{x^2}\\u(0) = 0 \\ u(1) = u'(1)\end{cases}$$

According to literature and videos on the subject, it appears that the SL problem $$(p(x)u')'+q(x)u=0$$ with boundary constraints on $$x=a$$ and $$x=b$$ is self-adjoint if

$$p(b)[u'(b)v(b)-v'(b)u(b)]-p(a)[u'(a)v(a)-v'(a)u(a)] = 0$$

In our case however, $$p(x) = \frac{1}{x}$$ so $$p(0)$$ is undefined. What do I do?

Are you considering the operator $$Lu=(\frac{1}{x}u')'+\frac{1}{x^2}u$$ on $$L^2[0,1]$$? Or on $$L^2_w[0,1]$$ for some weight $$w\ne 1$$? A true Sturm-Liouville problem has a spectral parameter $$\lambda$$, and the multiplier of $$\lambda$$ in the symmetric form dictates the space where you are studying the equation. Without that, there is no natural way to determine $$w$$, and you must specify it. So this is not really a Sturm-Liouville problem.
You have an ODE that you want to solve, and you are reasonably questioning whether or not the general solution will allow you to impose endpoint conditions. This has a lot to do with the homogeneous equation $$xu''-u'+u=0, \tag{\dagger}$$ which can be written in the form $$x^2u''-xu'+xu=0.$$ This is an equation with a regular singular point at $$0$$. By the method of Frobenius, it has one solution of the form $$u=x^2v$$ where $$v=\sum_{n=0}^{\infty}a_n x^n$$. The coefficient equation is $$\sum_{n=2}^{\infty}a_n (n+2)(n+1)x^{n}-\sum_{n=1}^{\infty}a_n(n+1)x^{n}+\sum_{n=0}^{\infty}a_n x^{n+1}=0 \\ a_n(n+1)^2=-a_{n-1} \\ a_{n+1} = -\frac{1}{(n+2)^2}a_n,\;\; n \ge 0.$$ So you have one solution $$u=x^2v$$ where $$v$$ is a power series. A second solution $$w$$ is obtained by variation of parameters: $$w=qu$$. Substituting into the equation gives
$$x^2(qu)''-x(qu)'+x(qu)=0 \\ (x^2u''-xu'+xu)q+x^2(q'u'+q''u)=0 \\ q'u'+q''u=0 \\ \frac{u'}{u} +\frac{q''}{q'}=0 \\ \ln(uq')=C \\ uq' = D \\ q = D\int \frac{1}{u} dx+E$$ So a general second solution of equation $$(\dagger)$$ is $$w = \left(D\int \frac{1}{u} dx+E\right)u$$ From this it can be seen that both of the solutions $$w$$ and $$u$$ vanish at $$0$$. Using variation of parameters, you can then solve for $$xu''-u'+u=\cos(x)$$ of the form $$u=Q(x)q(x)+W(x)w(x)$$. So it appears that you'll have a solution, because it appears that $$Qq+Qw$$ will vanish at $$0$$, and you'll be able to add a general homogeneous solution to match conditions at $$x=1$$.