\[ \int \frac {e^{2 \text {sech}^{-1}(a x)}}{x^2} \, dx \]
Optimal antiderivative \[ -\frac {4 a}{3 \left (1-\sqrt {\frac {-a x +1}{a x +1}}\right )^{3}}+\frac {2 a}{\left (1-\sqrt {\frac {-a x +1}{a x +1}}\right )^{2}} \]
command
integrate((1/a/x+(1/a/x-1)^(1/2)*(1+1/a/x)^(1/2))^2/x^2,x, algorithm="giac")
Giac 1.9.0-11 via sagemath 9.6 output
\[ \text {could not integrate} \]
Giac 1.7.0 via sagemath 9.3 output
\[ \frac {3 \, {\left (a^{2} + \frac {a}{x}\right )} a^{2} - {\left (9 \, a^{2} + {\left (a^{2} + \frac {a}{x}\right )} {\left (\frac {2 \, {\left (a^{2} + \frac {a}{x}\right )}}{a^{2}} - 7\right )}\right )} \sqrt {a^{2} + \frac {a}{x}} \sqrt {-a^{2} + \frac {a}{x}} + 3 \, {\left (2 \, a^{2} - \frac {a}{x}\right )} \sqrt {a^{2} + \frac {a}{x}} \sqrt {-a^{2} + \frac {a}{x}} - \frac {2 \, a}{x^{3}}}{3 \, a^{3}} \]