When we solve the equation $z^{2}u''+p(z)zu'+q(z)u=0$ using Frobenius method, we first find zeros of the indicial polynomial $r_1>r_2$ to get a solution $u_1$. In the case that the difference of roots $r_1-r_2$ is an integer, we might need to find a second linearly independent solution using a different method. It is given on the Wikipedia page (and many other places) that $$ u_{2}=Cu_{1}\ln x+\sum _{{k=0}}^{\infty }B_{k}x^{{k+r_{2}}} $$ gives the desired second solution.
My question is: how do we come up with this general form of solution? I try to derive it in various ways, but find it hard to achieve - I have tried to write $u_2 =vu_1$, which reduces the order of the DE and gives $$ v'= u_1^{-2}\exp\left(- \int \frac{p(z)}{z} dz\right), $$ but this looks completely different from the formula above.
I do see some vague intuition about the logarithmic term - we are basically saying: if multiplying by $x^{-r}$ does not make the solution analytic, then something stronger like $\ln x$ will. In other words, we create an essential singularity by adding $\ln x$.
I wish to see a more satisfying explanation of this.