\[ \int \frac {1}{(a+i a \tan (e+f x))^3 (c+d \tan (e+f x))^2} \, dx \]
Optimal antiderivative \[ \frac {\left (5 i c^{4} d -10 i c^{2} d^{3}+25 i d^{5}+c^{5}-10 c^{3} d^{2}-35 c \,d^{4}\right ) x}{8 a^{3} \left (-i d +c \right )^{2} \left (i d +c \right )^{5}}+\frac {\left (-3 i d +5 c \right ) d^{4} \ln \left (c \cos \left (f x +e \right )+d \sin \left (f x +e \right )\right )}{a^{3} \left (i c -d \right )^{5} \left (-i d +c \right )^{2} f}+\frac {d \left (5 i c^{2} d +25 i d^{3}+c^{3}-11 c \,d^{2}\right )}{8 a^{3} \left (-i d +c \right ) \left (i d +c \right )^{4} f \left (c +d \tan \left (f x +e \right )\right )}-\frac {1}{6 \left (i c -d \right ) f \left (a +i a \tan \left (f x +e \right )\right )^{3} \left (c +d \tan \left (f x +e \right )\right )}+\frac {3 i c -11 d}{24 a \left (i d +c \right )^{2} f \left (a +i a \tan \left (f x +e \right )\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {5 i c d +c^{2}-12 d^{2}}{8 \left (i c -d \right )^{3} f \left (a^{3}+i a^{3} \tan \left (f x +e \right )\right ) \left (c +d \tan \left (f x +e \right )\right )} \]
command
integrate(1/(a+I*a*tan(f*x+e))**3/(c+d*tan(f*x+e))**2,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {output too large to display} \]
Sympy 1.8 under Python 3.8.8 output \[ \text {Timed out} \]_____________________________________________________