Specific Solution to Differential Equation I am looking to solve
$$
x ( x - 1 )^2 g''(x) + ( x - 1 ) g'(x) -x g(x)=\frac{x-1}{x} , \qquad x \geq 1 . 
$$
I already know the general solutions to this as
$$
g(x) = c_1 P(x) + c_2 Q(x)  + g_s(x) .
$$
Here,
$$
P(x) = x P_\alpha^2(2 x-1) , \qquad Q(x) = x Q_\alpha^2(2 x-1) , \qquad \alpha = \frac{\sqrt{5}-1}{2}
$$
$P$ and $Q$ are the associated Legendre functions and $g_s(x)$ is a special solution to this equation. I also know that the special solution can be determined by an integral
$$
g_s(x)  = 2 Q(x) \int \frac{P(x)}{x^3}dx  - 2 P(x) \int \frac{Q(x)}{x^3} dx .
$$
However, I am struggling to actually evaluate this integral. Can anyone help me find a particular solution to this equation? Any special solution would do!
PS - This is NOT for homework. It's a differential equation that came up during research. I have posted related questions about this before here and here.
 A: I am not sure there exists a good analytical form of the specific solution. But I am going to show how to obtain at least a series expansion of this function.
By letting $g_s(x) = \frac{f_1(x)+1}{x-1}$, you can get:
$$
x(x-1) f_1''-(2 x-1) f_1'+f_1 = -\frac1x.
$$
If you let $f_1=\frac{a_1}x+f_2$, then:
$$
x(x-1) f_2''-(2 x-1) f_2'+f_2 = -\frac{1+5a_1}x+\frac{3a_1}{x^2}.
$$
We set $a_1=-1/5$ to discard the first term. Then we do $f_2=\frac{a_2}{x^2}+f_3$:
$$
x(x-1) f_3''-(2 x-1) f_3'+f_3 = -\frac{3/5+11a_2}{x^2}+\frac{8a_2}{x^3}.
$$
We set $a_2=-3/55$. And so on. In general, we find a recursive relation:
$$
a_1 = -\frac15,\qquad a_{n+1} = a_n\frac{n(n+2)}{n^2+5n+5}.
$$
You can solve this recursive relation using raising factorials:
$$
a_n = -\frac1{5}\frac{1^{(n-1)}3^{(n-1)}}{(1+r_1)^{(n-1)}(1+r_2)^{(n-1)}}=
-\frac{(n-1)!(n+1)!}{10}\frac{\Gamma(r_1+1)\Gamma(r_2+1)}{\Gamma(r_1+n)\Gamma(r_2+n)},
$$
where $r_{1,2}=\frac12\left(5\pm\sqrt5\right)$ are roots of $n^2+5n+5=0$.
First terms of $f_1(x)$ are:
$$
f_1(x) = -\frac{1}{5 x}-\frac{3}{55 x^2}-\frac{24}{1045 x^3}-\frac{72}{6061 x^4}-\frac{1728}{248501 x^5}
 + o(x^{-5})$$
