\[ y''(x)=-\frac {y'(x) \left (2 f(x) g(x) g'(x)^2-\left (g(x)^2-1\right ) \left (2 f'(x) g'(x)+f(x) g''(x)\right )\right )}{f(x) \left (g(x)^2-1\right ) g'(x)}-\frac {y(x) \left (\left (g(x)^2-1\right ) \left (f'(x) \left (2 f'(x) g'(x)+f(x) g''(x)\right )-f(x) f''(x) g'(x)\right )-f(x) g'(x)^2 \left (2 g(x) f'(x)+v (v+1) f(x) g'(x)\right )\right )}{f(x)^2 \left (g(x)^2-1\right ) g'(x)} \] ✗ Mathematica : cpu = 1.52307 (sec), leaf count = 0 , could not solve
DSolve[Derivative[2][y][x] == -((Derivative[1][y][x]*(2*f[x]*g[x]*Derivative[1][g][x]^2 - (-1 + g[x]^2)*(2*Derivative[1][f][x]*Derivative[1][g][x] + f[x]*Derivative[2][g][x])))/(f[x]*(-1 + g[x]^2)*Derivative[1][g][x])) - (y[x]*(-(f[x]*Derivative[1][g][x]^2*(2*g[x]*Derivative[1][f][x] + v*(1 + v)*f[x]*Derivative[1][g][x])) + (-1 + g[x]^2)*(-(f[x]*Derivative[1][g][x]*Derivative[2][f][x]) + Derivative[1][f][x]*(2*Derivative[1][f][x]*Derivative[1][g][x] + f[x]*Derivative[2][g][x]))))/(f[x]^2*(-1 + g[x]^2)*Derivative[1][g][x]), y[x], x]
✓ Maple : cpu = 0.305 (sec), leaf count = 20
\[ \left \{ y \left ( x \right ) =f \left ( x \right ) \left ( {\it LegendreP} \left ( v,g \left ( x \right ) \right ) {\it \_C1}+{\it LegendreQ} \left ( v,g \left ( x \right ) \right ) {\it \_C2} \right ) \right \} \]