DSolve[(a + x*Cot[x])*y[x] + (x + 2*x^2*Cot[x])*Derivative[1][y][x] + x^2*Derivative[2][y][x] == 0,y[x],x]