DSolve[(-(n*LegendreQ[-1 + n, x]) + n*x*LegendreQ[n, x])/(-1 + x^2) - n*(1 + n)*y[x] + (-1 + x^2)*Derivative[2][y][x] == 0,y[x],x]