# Show that second linearly independent solution to legendre ODE is $Q_n(x)=P_n(x)\int^x \frac{dx}{(1-x^2)[P_n(x)]^2}$

$$Q_n(x)=P_n(x)\displaystyle\int^x \dfrac{dx}{(1-x^2)[P_n(x)]^2}$$

The form looks like Green's function, or general solution after the variation of parameters method. I couldnot figure it out. I checked every book I know but didnot find anything related, our lecturer asked this in the exam and I am very curious now.

How should we attack it?

Hint: Let $$Q=Pw$$ is the second solution then find $$Q'$$, $$Q''$$ and after substitution in Legendre DE, you will find $$(1-x^2)(2P'w'+Pw'')-2xPw'=0$$ or after dividing on $$Pw'$$ $$2\dfrac{P'}{P}+\dfrac{w''}{w'}=\dfrac{2x}{1-x^2}$$ can you take it from here!