\[ \int \frac {(a+b \text {ArcTan}(c x))^2}{x^2 (d+e x)} \, dx \]
Optimal antiderivative \[ -\frac {\mathrm {I} c \left (a +b \arctan \! \left (c x \right )\right )^{2}}{d}-\frac {\left (a +b \arctan \! \left (c x \right )\right )^{2}}{d x}+\frac {2 e \left (a +b \arctan \! \left (c x \right )\right )^{2} \arctanh \! \left (-1+\frac {2}{1+\mathrm {I} c x}\right )}{d^{2}}-\frac {e \left (a +b \arctan \! \left (c x \right )\right )^{2} \ln \! \left (\frac {2}{1-\mathrm {I} c x}\right )}{d^{2}}+\frac {e \left (a +b \arctan \! \left (c x \right )\right )^{2} \ln \! \left (\frac {2 c \left (e x +d \right )}{\left (c d +\mathrm {I} e \right ) \left (1-\mathrm {I} c x \right )}\right )}{d^{2}}+\frac {2 b c \left (a +b \arctan \! \left (c x \right )\right ) \ln \! \left (2-\frac {2}{1-\mathrm {I} c x}\right )}{d}+\frac {\mathrm {I} b e \left (a +b \arctan \! \left (c x \right )\right ) \polylog \! \left (2, 1-\frac {2}{1-\mathrm {I} c x}\right )}{d^{2}}-\frac {\mathrm {I} b^{2} c \polylog \! \left (2, -1+\frac {2}{1-\mathrm {I} c x}\right )}{d}+\frac {\mathrm {I} b e \left (a +b \arctan \! \left (c x \right )\right ) \polylog \! \left (2, 1-\frac {2}{1+\mathrm {I} c x}\right )}{d^{2}}-\frac {\mathrm {I} b e \left (a +b \arctan \! \left (c x \right )\right ) \polylog \! \left (2, -1+\frac {2}{1+\mathrm {I} c x}\right )}{d^{2}}-\frac {\mathrm {I} b e \left (a +b \arctan \! \left (c x \right )\right ) \polylog \! \left (2, 1-\frac {2 c \left (e x +d \right )}{\left (c d +\mathrm {I} e \right ) \left (1-\mathrm {I} c x \right )}\right )}{d^{2}}-\frac {b^{2} e \polylog \! \left (3, 1-\frac {2}{1-\mathrm {I} c x}\right )}{2 d^{2}}+\frac {b^{2} e \polylog \! \left (3, 1-\frac {2}{1+\mathrm {I} c x}\right )}{2 d^{2}}-\frac {b^{2} e \polylog \! \left (3, -1+\frac {2}{1+\mathrm {I} c x}\right )}{2 d^{2}}+\frac {b^{2} e \polylog \! \left (3, 1-\frac {2 c \left (e x +d \right )}{\left (c d +\mathrm {I} e \right ) \left (1-\mathrm {I} c x \right )}\right )}{2 d^{2}} \]
command
Integrate[(a + b*ArcTan[c*x])^2/(x^2*(d + e*x)),x]
Mathematica 13.1 output
\[ \int \frac {(a+b \text {ArcTan}(c x))^2}{x^2 (d+e x)} \, dx \]
Mathematica 12.3 output
\[ \text {output too large to display} \]