\[ y''(x) \left (-6 x (\text {a1}+\text {a2}+\text {a3})+3 \text {a1} \text {a2}+3 \text {a1} \text {a3}+3 \text {a2} \text {a3}+9 x^2\right )+2 (x-\text {a1}) (x-\text {a2}) (x-\text {a3}) y^{(3)}(x)-2 \left (b+\left (n^2+n-3\right ) x\right ) y'(x)-n (n+1) y(x)=0 \] ✓ Mathematica : cpu = 4.22051 (sec), leaf count = 534
DSolve[-(n*(1 + n)*y[x]) - 2*(b + (-3 + n + n^2)*x)*Derivative[1][y][x] + (3*a1*a2 + 3*a1*a3 + 3*a2*a3 - 6*(a1 + a2 + a3)*x + 9*x^2)*Derivative[2][y][x] + 2*(-a1 + x)*(-a2 + x)*(-a3 + x)*Derivative[3][y][x] == 0,y[x],x]
\[\left \{\left \{y(x)\to c_1 \text {HeunG}\left [\frac {\text {a3}-\text {a1}}{\text {a2}-\text {a1}},\frac {\frac {1}{4} (\text {a1}+\text {a2}+\text {a3}-b)+\frac {1}{4} \text {a1} \left (-n^2-n\right )}{\text {a1}-\text {a2}},\frac {1}{2} \left (\frac {1}{2}-\sqrt {n^2+n+\frac {1}{4}}\right ),\frac {1}{2} \left (\sqrt {n^2+n+\frac {1}{4}}+\frac {1}{2}\right ),\frac {1}{2},\frac {1}{2},\frac {x-\text {a1}}{\text {a2}-\text {a1}}\right ]^2+c_2 \sqrt {\frac {x-\text {a1}}{\text {a2}-\text {a1}}} \text {HeunG}\left [\frac {\text {a3}-\text {a1}}{\text {a2}-\text {a1}},\frac {\frac {1}{4} (\text {a1}+\text {a2}+\text {a3}-b)+\frac {1}{4} \text {a1} \left (-n^2-n\right )}{\text {a1}-\text {a2}}+\frac {1}{2} \left (\frac {\text {a3}-\text {a1}}{2 (\text {a2}-\text {a1})}+\frac {1}{2}\right ),\frac {1}{2} \left (\sqrt {n^2+n+\frac {1}{4}}+\frac {3}{2}\right ),\frac {1}{2} \left (\frac {3}{2}-\sqrt {n^2+n+\frac {1}{4}}\right ),\frac {3}{2},\frac {1}{2},\frac {x-\text {a1}}{\text {a2}-\text {a1}}\right ] \text {HeunG}\left [\frac {\text {a3}-\text {a1}}{\text {a2}-\text {a1}},\frac {\frac {1}{4} (\text {a1}+\text {a2}+\text {a3}-b)+\frac {1}{4} \text {a1} \left (-n^2-n\right )}{\text {a1}-\text {a2}},\frac {1}{2} \left (\frac {1}{2}-\sqrt {n^2+n+\frac {1}{4}}\right ),\frac {1}{2} \left (\sqrt {n^2+n+\frac {1}{4}}+\frac {1}{2}\right ),\frac {1}{2},\frac {1}{2},\frac {x-\text {a1}}{\text {a2}-\text {a1}}\right ]+\frac {c_3 (x-\text {a1}) \text {HeunG}\left [\frac {\text {a3}-\text {a1}}{\text {a2}-\text {a1}},\frac {\frac {1}{4} (\text {a1}+\text {a2}+\text {a3}-b)+\frac {1}{4} \text {a1} \left (-n^2-n\right )}{\text {a1}-\text {a2}}+\frac {1}{2} \left (\frac {\text {a3}-\text {a1}}{2 (\text {a2}-\text {a1})}+\frac {1}{2}\right ),\frac {1}{2} \left (\sqrt {n^2+n+\frac {1}{4}}+\frac {3}{2}\right ),\frac {1}{2} \left (\frac {3}{2}-\sqrt {n^2+n+\frac {1}{4}}\right ),\frac {3}{2},\frac {1}{2},\frac {x-\text {a1}}{\text {a2}-\text {a1}}\right ]^2}{\text {a2}-\text {a1}}\right \}\right \}\] ✓ Maple : cpu = 0.371 (sec), leaf count = 288
dsolve(2*(x-a1)*(x-a2)*(x-a3)*diff(diff(diff(y(x),x),x),x)+(9*x^2-6*(a1+a2+a3)*x+3*a1*a2+3*a1*a3+3*a2*a3)*diff(diff(y(x),x),x)-2*((n^2+n-3)*x+b)*diff(y(x),x)-n*(n+1)*y(x)=0,y(x))
\[y \left (x \right ) = -c_{2} \left (x -\mathit {a1} \right ) \mathit {HG}\left (\frac {-\mathit {a3} +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}, \frac {\left (-n^{2}-n +3\right ) \mathit {a1} -b}{-4 \mathit {a2} +4 \mathit {a1}}, \frac {n}{2}+1, -\frac {n}{2}+\frac {1}{2}, \frac {3}{2}, \frac {1}{2}, \frac {-x +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}\right )^{2}+c_{3} \mathit {HG}\left (\frac {-\mathit {a3} +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}, \frac {\left (-n^{2}-n +1\right ) \mathit {a1} -b +\mathit {a2} +\mathit {a3}}{-4 \mathit {a2} +4 \mathit {a1}}, -\frac {n}{2}, \frac {n}{2}+\frac {1}{2}, \frac {1}{2}, \frac {1}{2}, \frac {-x +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}\right ) \mathit {HG}\left (\frac {-\mathit {a3} +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}, \frac {\left (-n^{2}-n +3\right ) \mathit {a1} -b}{-4 \mathit {a2} +4 \mathit {a1}}, \frac {n}{2}+1, -\frac {n}{2}+\frac {1}{2}, \frac {3}{2}, \frac {1}{2}, \frac {-x +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}\right ) \sqrt {-x +\mathit {a1}}+c_{1} \mathit {HG}\left (\frac {-\mathit {a3} +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}, \frac {\left (-n^{2}-n +1\right ) \mathit {a1} -b +\mathit {a2} +\mathit {a3}}{-4 \mathit {a2} +4 \mathit {a1}}, -\frac {n}{2}, \frac {n}{2}+\frac {1}{2}, \frac {1}{2}, \frac {1}{2}, \frac {-x +\mathit {a1}}{-\mathit {a2} +\mathit {a1}}\right )^{2}\]