Optimal. Leaf size=36 \[ -\frac {1}{4} i \text {ArcTan}(\sinh (x))-\frac {1}{4 (i+\sinh (x))^2}-\frac {i}{4 (i+\sinh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2786, 78, 209}
\begin {gather*} -\frac {1}{4} i \text {ArcTan}(\sinh (x))-\frac {i}{4 (\sinh (x)+i)}-\frac {1}{4 (\sinh (x)+i)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 209
Rule 2786
Rubi steps
\begin {align*} \int \frac {\tanh (x)}{(i+\sinh (x))^2} \, dx &=-\text {Subst}\left (\int \frac {x}{(i-x) (i+x)^3} \, dx,x,\sinh (x)\right )\\ &=-\text {Subst}\left (\int \left (-\frac {1}{2 (i+x)^3}-\frac {i}{4 (i+x)^2}+\frac {i}{4 \left (1+x^2\right )}\right ) \, dx,x,\sinh (x)\right )\\ &=-\frac {1}{4 (i+\sinh (x))^2}-\frac {i}{4 (i+\sinh (x))}-\frac {1}{4} i \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sinh (x)\right )\\ &=-\frac {1}{4} i \tan ^{-1}(\sinh (x))-\frac {1}{4 (i+\sinh (x))^2}-\frac {i}{4 (i+\sinh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 29, normalized size = 0.81 \begin {gather*} -\frac {i \left (\sinh (x)+\text {ArcTan}(\sinh (x)) (i+\sinh (x))^2\right )}{4 (i+\sinh (x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 65 vs. \(2 (26 ) = 52\).
time = 0.69, size = 66, normalized size = 1.83
method | result | size |
risch | \(-\frac {i {\mathrm e}^{x} \left ({\mathrm e}^{2 x}-1\right )}{2 \left ({\mathrm e}^{x}+i\right )^{4}}+\frac {\ln \left ({\mathrm e}^{x}+i\right )}{4}-\frac {\ln \left ({\mathrm e}^{x}-i\right )}{4}\) | \(36\) |
default | \(\frac {2 i}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{3}}-\frac {i}{2 \left (\tanh \left (\frac {x}{2}\right )+i\right )}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{4}}-\frac {3}{2 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+i\right )}{4}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-i\right )}{4}\) | \(66\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 61 vs. \(2 (22) = 44\).
time = 0.27, size = 61, normalized size = 1.69 \begin {gather*} \frac {-i \, e^{\left (-x\right )} + i \, e^{\left (-3 \, x\right )}}{8 i \, e^{\left (-x\right )} - 12 \, e^{\left (-2 \, x\right )} - 8 i \, e^{\left (-3 \, x\right )} + 2 \, e^{\left (-4 \, x\right )} + 2} - \frac {1}{4} \, \log \left (e^{\left (-x\right )} + i\right ) + \frac {1}{4} \, \log \left (e^{\left (-x\right )} - i\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 94 vs. \(2 (22) = 44\).
time = 0.37, size = 94, normalized size = 2.61 \begin {gather*} \frac {{\left (e^{\left (4 \, x\right )} + 4 i \, e^{\left (3 \, x\right )} - 6 \, e^{\left (2 \, x\right )} - 4 i \, e^{x} + 1\right )} \log \left (e^{x} + i\right ) - {\left (e^{\left (4 \, x\right )} + 4 i \, e^{\left (3 \, x\right )} - 6 \, e^{\left (2 \, x\right )} - 4 i \, e^{x} + 1\right )} \log \left (e^{x} - i\right ) - 2 i \, e^{\left (3 \, x\right )} + 2 i \, e^{x}}{4 \, {\left (e^{\left (4 \, x\right )} + 4 i \, e^{\left (3 \, x\right )} - 6 \, e^{\left (2 \, x\right )} - 4 i \, e^{x} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.10, size = 58, normalized size = 1.61 \begin {gather*} \frac {- i e^{3 x} + i e^{x}}{2 e^{4 x} + 8 i e^{3 x} - 12 e^{2 x} - 8 i e^{x} + 2} - \frac {\log {\left (e^{x} - i \right )}}{4} + \frac {\log {\left (e^{x} + i \right )}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 66 vs. \(2 (22) = 44\).
time = 0.44, size = 66, normalized size = 1.83 \begin {gather*} -\frac {3 \, {\left (e^{\left (-x\right )} - e^{x}\right )}^{2} - 20 i \, e^{\left (-x\right )} + 20 i \, e^{x} - 12}{16 \, {\left (e^{\left (-x\right )} - e^{x} - 2 i\right )}^{2}} + \frac {1}{8} \, \log \left (-e^{\left (-x\right )} + e^{x} + 2 i\right ) - \frac {1}{8} \, \log \left (-e^{\left (-x\right )} + e^{x} - 2 i\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.87, size = 99, normalized size = 2.75 \begin {gather*} \frac {\ln \left (-\frac {1}{2}+\frac {{\mathrm {e}}^x\,1{}\mathrm {i}}{2}\right )}{4}-\frac {\ln \left (\frac {1}{2}+\frac {{\mathrm {e}}^x\,1{}\mathrm {i}}{2}\right )}{4}-\frac {3}{2\,\left ({\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}\right )}+\frac {1}{{\mathrm {e}}^{4\,x}-6\,{\mathrm {e}}^{2\,x}+1+{\mathrm {e}}^{3\,x}\,4{}\mathrm {i}-{\mathrm {e}}^x\,4{}\mathrm {i}}-\frac {1{}\mathrm {i}}{2\,\left ({\mathrm {e}}^x+1{}\mathrm {i}\right )}+\frac {2{}\mathrm {i}}{{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}+{\mathrm {e}}^{3\,x}-3\,{\mathrm {e}}^x-\mathrm {i}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________