Optimal. Leaf size=190 \[ -\frac {1}{x \left (1+e^{2 a} x^4\right )}-\frac {2 e^{2 a} x^3}{1+e^{2 a} x^4}+\frac {e^{a/2} \text {ArcTan}\left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{a/2} \text {ArcTan}\left (1+\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{a/2} \log \left (1-\sqrt {2} e^{a/2} x+e^a x^2\right )}{4 \sqrt {2}}+\frac {e^{a/2} \log \left (1+\sqrt {2} e^{a/2} x+e^a x^2\right )}{4 \sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 190, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 9, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.692, Rules used = {5656, 473,
468, 303, 1176, 631, 210, 1179, 642} \begin {gather*} \frac {e^{a/2} \text {ArcTan}\left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{a/2} \text {ArcTan}\left (\sqrt {2} e^{a/2} x+1\right )}{2 \sqrt {2}}-\frac {1}{x \left (e^{2 a} x^4+1\right )}-\frac {e^{a/2} \log \left (e^a x^2-\sqrt {2} e^{a/2} x+1\right )}{4 \sqrt {2}}+\frac {e^{a/2} \log \left (e^a x^2+\sqrt {2} e^{a/2} x+1\right )}{4 \sqrt {2}}-\frac {2 e^{2 a} x^3}{e^{2 a} x^4+1} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 303
Rule 468
Rule 473
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 5656
Rubi steps
\begin {align*} \int \frac {\tanh ^2(a+2 \log (x))}{x^2} \, dx &=\int \frac {\tanh ^2(a+2 \log (x))}{x^2} \, dx\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 181, normalized size = 0.95 \begin {gather*} \frac {1}{4} \left (-\frac {4}{x}-\frac {4}{\frac {e^{-2 a}}{x^3}+x}+(-1)^{3/4} e^{a/2} \log \left (\frac {e^{-2 a} \left (\sqrt [4]{-1}-e^{a/2} x\right )}{x^4}\right )+\sqrt [4]{-1} e^{a/2} \log \left (\frac {e^{-2 a} \left ((-1)^{3/4}-e^{a/2} x\right )}{x^4}\right )-(-1)^{3/4} e^{a/2} \log \left (\frac {e^{-2 a} \left (\sqrt [4]{-1}+e^{a/2} x\right )}{x^4}\right )-\sqrt [4]{-1} e^{a/2} \log \left (\frac {e^{-2 a} \left ((-1)^{3/4}+e^{a/2} x\right )}{x^4}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.49, size = 64, normalized size = 0.34
method | result | size |
risch | \(\frac {-2 \,{\mathrm e}^{2 a} x^{4}-1}{x \left (1+{\mathrm e}^{2 a} x^{4}\right )}+\frac {\left (\munderset {\textit {\_R} =\RootOf \left (\textit {\_Z}^{4}+{\mathrm e}^{2 a}\right )}{\sum }\textit {\_R} \ln \left (\left (5 \textit {\_R}^{4}+4 \,{\mathrm e}^{2 a}\right ) x +\textit {\_R}^{3}\right )\right )}{4}\) | \(64\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 146, normalized size = 0.77 \begin {gather*} \frac {1}{4} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} e^{\left (\frac {1}{2} \, a\right )} + \frac {2}{x}\right )} e^{\left (-\frac {1}{2} \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} + \frac {1}{4} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} e^{\left (\frac {1}{2} \, a\right )} - \frac {2}{x}\right )} e^{\left (-\frac {1}{2} \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} + \frac {1}{8} \, \sqrt {2} e^{\left (\frac {1}{2} \, a\right )} \log \left (\frac {\sqrt {2} e^{\left (\frac {1}{2} \, a\right )}}{x} + \frac {1}{x^{2}} + e^{a}\right ) - \frac {1}{8} \, \sqrt {2} e^{\left (\frac {1}{2} \, a\right )} \log \left (-\frac {\sqrt {2} e^{\left (\frac {1}{2} \, a\right )}}{x} + \frac {1}{x^{2}} + e^{a}\right ) - \frac {1}{x} - \frac {e^{\left (2 \, a\right )}}{x {\left (\frac {1}{x^{4}} + e^{\left (2 \, a\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 274 vs.
\(2 (136) = 272\).
time = 0.40, size = 274, normalized size = 1.44 \begin {gather*} -\frac {16 \, x^{4} e^{\left (2 \, a\right )} - 4 \, {\left (\sqrt {2} x^{5} e^{\left (2 \, a\right )} + \sqrt {2} x\right )} \arctan \left (-{\left (\sqrt {2} x e^{\left (\frac {5}{2} \, a\right )} - \sqrt {2} \sqrt {x^{2} e^{\left (4 \, a\right )} + \sqrt {2} x e^{\left (\frac {7}{2} \, a\right )} + e^{\left (3 \, a\right )}} e^{\left (\frac {1}{2} \, a\right )} + e^{\left (2 \, a\right )}\right )} e^{\left (-2 \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} - 4 \, {\left (\sqrt {2} x^{5} e^{\left (2 \, a\right )} + \sqrt {2} x\right )} \arctan \left (-{\left (\sqrt {2} x e^{\left (\frac {5}{2} \, a\right )} - \sqrt {2} \sqrt {x^{2} e^{\left (4 \, a\right )} - \sqrt {2} x e^{\left (\frac {7}{2} \, a\right )} + e^{\left (3 \, a\right )}} e^{\left (\frac {1}{2} \, a\right )} - e^{\left (2 \, a\right )}\right )} e^{\left (-2 \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} - {\left (\sqrt {2} x^{5} e^{\left (2 \, a\right )} + \sqrt {2} x\right )} e^{\left (\frac {1}{2} \, a\right )} \log \left (x^{2} e^{\left (4 \, a\right )} + \sqrt {2} x e^{\left (\frac {7}{2} \, a\right )} + e^{\left (3 \, a\right )}\right ) + {\left (\sqrt {2} x^{5} e^{\left (2 \, a\right )} + \sqrt {2} x\right )} e^{\left (\frac {1}{2} \, a\right )} \log \left (x^{2} e^{\left (4 \, a\right )} - \sqrt {2} x e^{\left (\frac {7}{2} \, a\right )} + e^{\left (3 \, a\right )}\right ) + 8}{8 \, {\left (x^{5} e^{\left (2 \, a\right )} + x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tanh ^{2}{\left (a + 2 \log {\left (x \right )} \right )}}{x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 143, normalized size = 0.75 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} + 2 \, x\right )} e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} - \frac {1}{4} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} - 2 \, x\right )} e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} + \frac {1}{8} \, \sqrt {2} e^{\left (\frac {1}{2} \, a\right )} \log \left (\sqrt {2} x e^{\left (-\frac {1}{2} \, a\right )} + x^{2} + e^{\left (-a\right )}\right ) - \frac {1}{8} \, \sqrt {2} e^{\left (\frac {1}{2} \, a\right )} \log \left (-\sqrt {2} x e^{\left (-\frac {1}{2} \, a\right )} + x^{2} + e^{\left (-a\right )}\right ) - \frac {2 \, x^{4} e^{\left (2 \, a\right )} + 1}{x^{5} e^{\left (2 \, a\right )} + x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.10, size = 68, normalized size = 0.36 \begin {gather*} \frac {\mathrm {atanh}\left (x\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}\right )\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}}{2}-\frac {\mathrm {atan}\left (x\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}\right )\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}}{2}-\frac {2\,{\mathrm {e}}^{2\,a}\,x^4+1}{{\mathrm {e}}^{2\,a}\,x^5+x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________