4.31.42 \(-p (p+1) y(x)+\left (x^2+1\right ) y''(x)+2 x y'(x)=0\)

ODE
\[ -p (p+1) y(x)+\left (x^2+1\right ) y''(x)+2 x y'(x)=0 \] ODE Classification

[[_2nd_order, _with_linear_symmetries]]

Book solution method
TO DO

Mathematica
cpu = 0.0162185 (sec), leaf count = 26

\[\left \{\left \{y(x)\to c_1 P_p(i x)+c_2 Q_p(i x)\right \}\right \}\]

Maple
cpu = 0.053 (sec), leaf count = 21

\[ \left \{ y \left ( x \right ) ={\it \_C1}\,{\it LegendreP} \left ( p,ix \right ) +{\it \_C2}\,{\it LegendreQ} \left ( p,ix \right ) \right \} \] Mathematica raw input

DSolve[-(p*(1 + p)*y[x]) + 2*x*y'[x] + (1 + x^2)*y''[x] == 0,y[x],x]

Mathematica raw output

{{y[x] -> C[1]*LegendreP[p, I*x] + C[2]*LegendreQ[p, I*x]}}

Maple raw input

dsolve((x^2+1)*diff(diff(y(x),x),x)+2*x*diff(y(x),x)-p*(p+1)*y(x) = 0, y(x),'implicit')

Maple raw output

y(x) = _C1*LegendreP(p,I*x)+_C2*LegendreQ(p,I*x)