Optimal. Leaf size=38 \[ \frac {3 x}{8}+\frac {1}{8 (1-\tanh (x))}-\frac {1}{8 (1+\tanh (x))^2}-\frac {1}{4 (1+\tanh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 38, 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 = {3568, 46, 213}
\begin {gather*} \frac {3 x}{8}+\frac {1}{8 (1-\tanh (x))}-\frac {1}{4 (\tanh (x)+1)}-\frac {1}{8 (\tanh (x)+1)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 213
Rule 3568
Rubi steps
\begin {align*} \int \frac {\cosh ^2(x)}{1+\tanh (x)} \, dx &=\text {Subst}\left (\int \frac {1}{(1-x)^2 (1+x)^3} \, dx,x,\tanh (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {1}{8 (-1+x)^2}+\frac {1}{4 (1+x)^3}+\frac {1}{4 (1+x)^2}-\frac {3}{8 \left (-1+x^2\right )}\right ) \, dx,x,\tanh (x)\right )\\ &=\frac {1}{8 (1-\tanh (x))}-\frac {1}{8 (1+\tanh (x))^2}-\frac {1}{4 (1+\tanh (x))}-\frac {3}{8} \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\tanh (x)\right )\\ &=\frac {3 x}{8}+\frac {1}{8 (1-\tanh (x))}-\frac {1}{8 (1+\tanh (x))^2}-\frac {1}{4 (1+\tanh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 30, normalized size = 0.79 \begin {gather*} \frac {1}{32} (12 x-4 \cosh (2 x)-\cosh (4 x)+8 \sinh (2 x)+\sinh (4 x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(75\) vs.
\(2(30)=60\).
time = 0.50, size = 76, normalized size = 2.00
method | result | size |
risch | \(\frac {3 x}{8}+\frac {{\mathrm e}^{2 x}}{16}-\frac {3 \,{\mathrm e}^{-2 x}}{16}-\frac {{\mathrm e}^{-4 x}}{32}\) | \(23\) |
default | \(-\frac {1}{2 \left (\tanh \left (\frac {x}{2}\right )+1\right )^{4}}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {3}{2 \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {1}{\tanh \left (\frac {x}{2}\right )+1}+\frac {3 \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{8}+\frac {1}{4 \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {1}{4 \tanh \left (\frac {x}{2}\right )-4}-\frac {3 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8}\) | \(76\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 22, normalized size = 0.58 \begin {gather*} \frac {3}{8} \, x + \frac {1}{16} \, e^{\left (2 \, x\right )} - \frac {3}{16} \, e^{\left (-2 \, x\right )} - \frac {1}{32} \, e^{\left (-4 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 52, normalized size = 1.37 \begin {gather*} \frac {\cosh \left (x\right )^{3} + 3 \, \cosh \left (x\right ) \sinh \left (x\right )^{2} + 3 \, \sinh \left (x\right )^{3} + 6 \, {\left (2 \, x - 1\right )} \cosh \left (x\right ) + 3 \, {\left (3 \, \cosh \left (x\right )^{2} + 4 \, x + 2\right )} \sinh \left (x\right )}{32 \, {\left (\cosh \left (x\right ) + \sinh \left (x\right )\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 {\cosh ^{2}{\left (x \right )}}{\tanh {\left (x \right )} + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 30, normalized size = 0.79 \begin {gather*} -\frac {1}{32} \, {\left (9 \, e^{\left (4 \, x\right )} + 6 \, e^{\left (2 \, x\right )} + 1\right )} e^{\left (-4 \, x\right )} + \frac {3}{8} \, x + \frac {1}{16} \, e^{\left (2 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.13, size = 22, normalized size = 0.58 \begin {gather*} \frac {3\,x}{8}-\frac {3\,{\mathrm {e}}^{-2\,x}}{16}+\frac {{\mathrm {e}}^{2\,x}}{16}-\frac {{\mathrm {e}}^{-4\,x}}{32} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________