\[ \int \frac {1}{b^2 \cos ^2(x)+\sin ^2(x)} \, dx \]
Optimal antiderivative \[ \frac {\arctan \left (\frac {\tan \left (x \right )}{b}\right )}{b} \]
command
integrate(1/(b**2*cos(x)**2+sin(x)**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} \]_____________________________________________________