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.164118 (sec), leaf count = 26

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

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

\[[y \left (x \right ) = \textit {\_C1} \LegendreP \left (p , i x \right )+\textit {\_C2} \LegendreQ \left (p , i x \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))

Maple raw output

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