Integrand size = 13, antiderivative size = 19 \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=-x+\sqrt {2} \text {arctanh}\left (\sqrt {2} \tanh (x)\right ) \]
[Out]
Time = 0.02 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {1107, 213} \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=\sqrt {2} \text {arctanh}\left (\sqrt {2} \tanh (x)\right )-x \]
[In]
[Out]
Rule 213
Rule 1107
Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{1-3 x^2+2 x^4} \, dx,x,\tanh (x)\right ) \\ & = 2 \text {Subst}\left (\int \frac {1}{-2+2 x^2} \, dx,x,\tanh (x)\right )-2 \text {Subst}\left (\int \frac {1}{-1+2 x^2} \, dx,x,\tanh (x)\right ) \\ & = -x+\sqrt {2} \text {arctanh}\left (\sqrt {2} \tanh (x)\right ) \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.67 (sec) , antiderivative size = 529, normalized size of antiderivative = 27.84 \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=\frac {\text {sech}(x) \left (\sqrt {2+2 i} \arcsin \left (\frac {1}{2} \sqrt {1+i} \sqrt {(-1-i) (i+\sinh (x))}\right ) \sqrt {(-1-i) (i+\sinh (x))}-2 \text {arctanh}\left (\frac {\sqrt {(-1-i) (i+\sinh (x))}}{\sqrt {(1+i)-(1-i) \sinh (x)}}\right ) \sqrt {(1+i)-(1-i) \sinh (x)} \sqrt {1+i \sinh (x)} \sqrt {(-1-i) (i+\sinh (x))}+2 (-1)^{3/4} \text {arctanh}\left (\frac {(-1)^{3/4} \sqrt {(-1-i) (i+\sinh (x))}}{\sqrt {(1+i)-(1-i) \sinh (x)}}\right ) \sqrt {(1+i)-(1-i) \sinh (x)} \sqrt {1+i \sinh (x)} \sqrt {(-1-i) (i+\sinh (x))}+i \sqrt {2+2 i} \arcsin \left (\frac {1}{2} \sqrt {1+i} \sqrt {(-1-i) (i+\sinh (x))}\right ) \sinh (x) \sqrt {(-1-i) (i+\sinh (x))}+\sqrt {-2+2 i} \text {arcsinh}\left (\frac {1}{2} \sqrt {-1+i} \sqrt {(1-i) (i+\sinh (x))}\right ) \sqrt {(1-i) (i+\sinh (x))}+i \sqrt {-2+2 i} \text {arcsinh}\left (\frac {1}{2} \sqrt {-1+i} \sqrt {(1-i) (i+\sinh (x))}\right ) \sinh (x) \sqrt {(1-i) (i+\sinh (x))}+2 (-1)^{3/4} \arctan \left (\frac {(-1)^{3/4} \sqrt {(1-i) (i+\sinh (x))}}{\sqrt {(1+i) (-i+\sinh (x))}}\right ) \sqrt {1+i \sinh (x)} \sqrt {(1+i) (-i+\sinh (x))} \sqrt {(1-i) (i+\sinh (x))}+2 \text {arctanh}\left (\frac {\sqrt {(1-i) (i+\sinh (x))}}{\sqrt {(1+i) (-i+\sinh (x))}}\right ) \sqrt {1+i \sinh (x)} \sqrt {(1+i) (-i+\sinh (x))} \sqrt {(1-i) (i+\sinh (x))}\right )}{2 \sqrt {1+i \sinh (x)}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(38\) vs. \(2(15)=30\).
Time = 0.46 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.05
method | result | size |
risch | \(-x +\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}+2 \sqrt {2}-3\right )}{2}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}-3-2 \sqrt {2}\right )}{2}\) | \(39\) |
default | \(-\ln \left (1+\tanh \left (\frac {x}{2}\right )\right )+\sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )+2\right ) \sqrt {2}}{4}\right )+\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )+\sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )-2\right ) \sqrt {2}}{4}\right )\) | \(54\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (15) = 30\).
Time = 0.28 (sec) , antiderivative size = 70, normalized size of antiderivative = 3.68 \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (-\frac {3 \, {\left (2 \, \sqrt {2} - 3\right )} \cosh \left (x\right )^{2} - 4 \, {\left (3 \, \sqrt {2} - 4\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 3 \, {\left (2 \, \sqrt {2} - 3\right )} \sinh \left (x\right )^{2} - 2 \, \sqrt {2} + 3}{\cosh \left (x\right )^{2} + \sinh \left (x\right )^{2} - 3}\right ) - x \]
[In]
[Out]
\[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=\int \frac {1}{\left (- \tanh {\left (x \right )} + \operatorname {sech}{\left (x \right )}\right ) \left (\tanh {\left (x \right )} + \operatorname {sech}{\left (x \right )}\right )}\, dx \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 64 vs. \(2 (15) = 30\).
Time = 0.28 (sec) , antiderivative size = 64, normalized size of antiderivative = 3.37 \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} + 1}{\sqrt {2} + e^{\left (-x\right )} - 1}\right ) - \frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} - 1}{\sqrt {2} + e^{\left (-x\right )} + 1}\right ) - x \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (15) = 30\).
Time = 0.27 (sec) , antiderivative size = 41, normalized size of antiderivative = 2.16 \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=-\frac {1}{2} \, \sqrt {2} \log \left (\frac {{\left | -4 \, \sqrt {2} + 2 \, e^{\left (2 \, x\right )} - 6 \right |}}{{\left | 4 \, \sqrt {2} + 2 \, e^{\left (2 \, x\right )} - 6 \right |}}\right ) - x \]
[In]
[Out]
Time = 0.19 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.95 \[ \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx=\frac {\sqrt {2}\,\ln \left (8\,{\mathrm {e}}^{2\,x}+\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{2}\right )}{2}-\frac {\sqrt {2}\,\ln \left (8\,{\mathrm {e}}^{2\,x}-\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{2}\right )}{2}-x \]
[In]
[Out]