Integrand size = 9, antiderivative size = 165 \[ \int \tanh ^2(a+2 \log (x)) \, dx=x+\frac {x}{1+e^{2 a} x^4}+\frac {e^{-a/2} \arctan \left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{-a/2} \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]
Time = 0.10 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {5652, 398, 294, 217, 1179, 642, 1176, 631, 210} \[ \int \tanh ^2(a+2 \log (x)) \, dx=\frac {e^{-a/2} \arctan \left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{-a/2} \arctan \left (\sqrt {2} e^{a/2} x+1\right )}{2 \sqrt {2}}+\frac {x}{e^{2 a} x^4+1}+\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}}+x \]
[In]
[Out]
Rule 210
Rule 217
Rule 294
Rule 398
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 5652
Rubi steps \begin{align*} \text {integral}& = \int \frac {\left (-1+e^{2 a} x^4\right )^2}{\left (1+e^{2 a} x^4\right )^2} \, dx \\ & = \int \left (1-\frac {4 e^{2 a} x^4}{\left (1+e^{2 a} x^4\right )^2}\right ) \, dx \\ & = x-\left (4 e^{2 a}\right ) \int \frac {x^4}{\left (1+e^{2 a} x^4\right )^2} \, dx \\ & = x+\frac {x}{1+e^{2 a} x^4}-\int \frac {1}{1+e^{2 a} x^4} \, dx \\ & = x+\frac {x}{1+e^{2 a} x^4}-\frac {1}{2} \int \frac {1-e^a x^2}{1+e^{2 a} x^4} \, dx-\frac {1}{2} \int \frac {1+e^a x^2}{1+e^{2 a} x^4} \, dx \\ & = x+\frac {x}{1+e^{2 a} x^4}-\frac {1}{4} e^{-a} \int \frac {1}{e^{-a}-\sqrt {2} e^{-a/2} x+x^2} \, dx-\frac {1}{4} e^{-a} \int \frac {1}{e^{-a}+\sqrt {2} e^{-a/2} x+x^2} \, dx+\frac {e^{-a/2} \int \frac {\sqrt {2} e^{-a/2}+2 x}{-e^{-a}-\sqrt {2} e^{-a/2} x-x^2} \, dx}{4 \sqrt {2}}+\frac {e^{-a/2} \int \frac {\sqrt {2} e^{-a/2}-2 x}{-e^{-a}+\sqrt {2} e^{-a/2} x-x^2} \, dx}{4 \sqrt {2}} \\ & = x+\frac {x}{1+e^{2 a} x^4}+\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}}-\frac {e^{-a/2} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}+\frac {e^{-a/2} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}} \\ & = x+\frac {x}{1+e^{2 a} x^4}+\frac {e^{-a/2} \arctan \left (1-\sqrt {2} e^{a/2} x\right )}{2 \sqrt {2}}-\frac {e^{-a/2} \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}} \\ \end{align*}
Time = 0.44 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.88 \[ \int \tanh ^2(a+2 \log (x)) \, dx=\frac {1}{4} \left (4 x+\frac {4 x}{1+e^{2 a} x^4}+\sqrt [4]{-1} e^{-a/2} \log \left (\sqrt [4]{-1} e^{-a/2}-x\right )+(-1)^{3/4} e^{-a/2} \log \left ((-1)^{3/4} e^{-a/2}-x\right )-\sqrt [4]{-1} e^{-a/2} \log \left (\sqrt [4]{-1} e^{-a/2}+x\right )-(-1)^{3/4} e^{-a/2} \log \left ((-1)^{3/4} e^{-a/2}+x\right )\right ) \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.05 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.28
method | result | size |
risch | \(x +\frac {x}{1+{\mathrm e}^{2 a} x^{4}}-\frac {{\mathrm e}^{-2 a} \left (\munderset {\textit {\_R} =\operatorname {RootOf}\left ({\mathrm e}^{2 a} \textit {\_Z}^{4}+1\right )}{\sum }\frac {\ln \left (x -\textit {\_R} \right )}{\textit {\_R}^{3}}\right )}{4}\) | \(47\) |
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.25 (sec) , antiderivative size = 156, normalized size of antiderivative = 0.95 \[ \int \tanh ^2(a+2 \log (x)) \, dx=\frac {4 \, x^{5} e^{\left (2 \, a\right )} - {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}} \log \left (x + \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}}\right ) + {\left (-i \, x^{4} e^{\left (2 \, a\right )} - i\right )} \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}} \log \left (x + i \, \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}}\right ) + {\left (i \, x^{4} e^{\left (2 \, a\right )} + i\right )} \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}} \log \left (x - i \, \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}}\right ) + {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}} \log \left (x - \left (-e^{\left (-2 \, a\right )}\right )^{\frac {1}{4}}\right ) + 8 \, x}{4 \, {\left (x^{4} e^{\left (2 \, a\right )} + 1\right )}} \]
[In]
[Out]
\[ \int \tanh ^2(a+2 \log (x)) \, dx=\int \tanh ^{2}{\left (a + 2 \log {\left (x \right )} \right )}\, dx \]
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.84 \[ \int \tanh ^2(a+2 \log (x)) \, dx=-\frac {1}{4} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x e^{a} + \sqrt {2} e^{\left (\frac {1}{2} \, a\right )}\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 (2 \, x e^{a} - \sqrt {2} e^{\left (\frac {1}{2} \, a\right )}\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 (x^{2} e^{a} + \sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) + \frac {1}{8} \, \sqrt {2} e^{\left (-\frac {1}{2} \, a\right )} \log \left (x^{2} e^{a} - \sqrt {2} x e^{\left (\frac {1}{2} \, a\right )} + 1\right ) + x + \frac {x}{x^{4} e^{\left (2 \, a\right )} + 1} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 133, normalized size of antiderivative = 0.81 \[ \int \tanh ^2(a+2 \log (x)) \, dx=-\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 ) + x + \frac {x}{x^{4} e^{\left (2 \, a\right )} + 1} \]
[In]
[Out]
Time = 1.72 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.37 \[ \int \tanh ^2(a+2 \log (x)) \, dx=x-\frac {\mathrm {atan}\left (x\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}\right )}{2\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}}+\frac {x}{{\mathrm {e}}^{2\,a}\,x^4+1}+\frac {\mathrm {atan}\left (x\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,{\left (-{\mathrm {e}}^{2\,a}\right )}^{1/4}} \]
[In]
[Out]