\[ \int \frac {e^{n \text {ArcTan}(a x)}}{c+a^2 c x^2} \, dx \]
Optimal antiderivative \[ \frac {{\mathrm e}^{n \arctan \left (a x \right )}}{a c n} \]
command
integrate(exp(n*atan(a*x))/(a**2*c*x**2+c),x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} \frac {x}{c} & \text {for}\: a = 0 \wedge n = 0 \\\frac {\operatorname {atan}{\left (a x \right )}}{a c} & \text {for}\: n = 0 \\\frac {x}{c} & \text {for}\: a = 0 \\\frac {e^{n \operatorname {atan}{\left (a x \right )}}}{a c n} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \begin {cases} \tilde {\infty } x & \text {for}\: c = 0 \wedge n = 0 \\\tilde {\infty } \int e^{n \operatorname {atan}{\left (a x \right )}}\, dx & \text {for}\: c = 0 \\\frac {\operatorname {atan}{\left (a x \right )}}{a c} & \text {for}\: n = 0 \\\frac {e^{n \operatorname {atan}{\left (a x \right )}}}{a c n} & \text {otherwise} \end {cases} \]________________________________________________________________________________________