\[ y''(x)=-\frac {y'(x) \left (-x (a (\delta +\text {gamma1})+\alpha +\beta -\delta +1)+a \text {gamma1}+x^2 (\alpha +\beta +1)\right )}{(x-1) x (x-a)}-\frac {y(x) (\alpha \beta x-q)}{(x-1) x (x-a)} \] ✓ Mathematica : cpu = 0.591775 (sec), leaf count = 67
DSolve[Derivative[2][y][x] == -(((-q + alpha*beta*x)*y[x])/((-1 + x)*x*(-a + x))) - ((a*gamma1 - (1 + alpha + beta - delta + a*(delta + gamma1))*x + (1 + alpha + beta)*x^2)*Derivative[1][y][x])/((-1 + x)*x*(-a + x)),y[x],x]
\[\left \{\left \{y(x)\to c_2 x^{1-\text {gamma1}} \text {HeunG}[a,q-(\text {gamma1}-1) ((a-1) \delta +\alpha +\beta -\text {gamma1}+1),\beta -\text {gamma1}+1,\alpha -\text {gamma1}+1,2-\text {gamma1},\delta ,x]+c_1 \text {HeunG}[a,q,\alpha ,\beta ,\text {gamma1},\delta ,x]\right \}\right \}\] ✓ Maple : cpu = 0.243 (sec), leaf count = 64
dsolve(diff(diff(y(x),x),x) = -((alpha+beta+1)*x^2-(alpha+beta+1+a*(gamma1+delta)-delta)*x+a*gamma1)/x/(x-1)/(x-a)*diff(y(x),x)-(alpha*beta*x-q)/x/(x-1)/(x-a)*y(x),y(x))
\[y \left (x \right ) = c_{1} \mathit {HG}\left (a , q , \alpha , \beta , \gamma 1 , \delta , x\right )+c_{2} x^{1-\gamma 1} \mathit {HG}\left (a , q -\left (-1+\gamma 1 \right ) \left (\delta \left (a -1\right )+\alpha +\beta -\gamma 1 +1\right ), \beta +1-\gamma 1 , \alpha +1-\gamma 1 , -\gamma 1 +2, \delta , x\right )\]