How can I write a non-homogeneous equation in self-dajoint form?
such as, for equation with $-1\le x \le1$
$$(1-x^2)u''-xu'+2u=x^4+x$$
What is its self-dajoint form?
Also, for a homogeneous equation e.g
$$p_0(x)u''+p_1(x)u'+p_2(x)u=0 \quad where \quad x\in I $$
How can I find the $p(x),\rho(x)and q(x)$ in the self-adjoint form?
$$\frac{d}{dx}[p(x)\frac{du}{dx}]+[\lambda \rho(x)-q(x)]u=0$$
Suppose you have
$$ y'' + f y' + g y = h $$
By means of an integrating factor, $ \mu =\exp (\int f)$, we obtain
$$ \mu \left ( y'' + fy' + gy \right) = \mu h \iff ( \mu y')' + g\mu y = \mu h$$
Thus, in your example, we have
$$ u'' + \frac{x}{x^2-1} u' +\frac{2}{ 1-x^2} u =x\frac{x^3+1}{1-x^2} $$
So we want to choose an integrating factor like
$$ \mu = \exp \left ( \int \frac{x \ dx}{x^2-1} \right ) = \exp \left( \ln\left(\sqrt{ x^2 -1}\right)\right) = \sqrt{ x^2 -1} $$
Thus the self-adjoint form would be
$$ -( \sqrt{x^2-1} u' )' + \frac{2 u}{\sqrt{x^2-1}}= x \frac{x^3 +1}{\sqrt{x^2-1}} $$