DSolve[Derivative[2][y][x] == -(Csc[x]^2*Sec[x]^2*(-((-1 + n)*n*Cos[x]^2) - (-1 + m)*m*Sin[x]^2 - a*Cos[x]^2*Sin[x]^2)*y[x]),y[x],x]