39.1 Problem number 591

\[ \int \frac {x^2}{(a x \cos (a x)-\sin (a x))^2} \, dx \]

Optimal antiderivative \[ -\frac {\cot \! \left (a x \right )}{a^{3}}+\frac {x \csc \! \left (a x \right )}{a^{2} \left (a x \cos \! \left (a x \right )-\sin \! \left (a x \right )\right )} \]

command

integrate(x**2/(a*x*cos(a*x)-sin(a*x))**2,x)

Sympy 1.10.1 under Python 3.10.4 output

\[ \int \frac {x^{2}}{\left (a x \cos {\left (a x \right )} - \sin {\left (a x \right )}\right )^{2}}\, dx \]

Sympy 1.8 under Python 3.8.8 output

\[ - \frac {2 a x \tan {\left (\frac {a x}{2} \right )}}{a^{4} x \tan ^{2}{\left (\frac {a x}{2} \right )} - a^{4} x + 2 a^{3} \tan {\left (\frac {a x}{2} \right )}} + \frac {\tan ^{2}{\left (\frac {a x}{2} \right )}}{a^{4} x \tan ^{2}{\left (\frac {a x}{2} \right )} - a^{4} x + 2 a^{3} \tan {\left (\frac {a x}{2} \right )}} - \frac {1}{a^{4} x \tan ^{2}{\left (\frac {a x}{2} \right )} - a^{4} x + 2 a^{3} \tan {\left (\frac {a x}{2} \right )}} \]