Optimal. Leaf size=22 \[ -\frac {3 x}{2}+\frac {3 \tanh (x)}{2}+\frac {1}{2} \sinh ^2(x) \tanh (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.02, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {288, 321, 206} \[ -\frac {3 x}{2}+\frac {3 \tanh (x)}{2}+\frac {1}{2} \sinh ^2(x) \tanh (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 288
Rule 321
Rubi steps
\begin {align*} \int (-\cosh (x)+\text {sech}(x))^2 \, dx &=\operatorname {Subst}\left (\int \frac {x^4}{\left (1-x^2\right )^2} \, dx,x,\tanh (x)\right )\\ &=\frac {1}{2} \sinh ^2(x) \tanh (x)-\frac {3}{2} \operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\tanh (x)\right )\\ &=\frac {3 \tanh (x)}{2}+\frac {1}{2} \sinh ^2(x) \tanh (x)-\frac {3}{2} \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (x)\right )\\ &=-\frac {3 x}{2}+\frac {3 \tanh (x)}{2}+\frac {1}{2} \sinh ^2(x) \tanh (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 16, normalized size = 0.73 \[ -\frac {3 x}{2}+\frac {1}{4} \sinh (2 x)+\tanh (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.48, size = 30, normalized size = 1.36 \[ \frac {\sinh \relax (x)^{3} - 4 \, {\left (3 \, x + 2\right )} \cosh \relax (x) + 3 \, {\left (\cosh \relax (x)^{2} + 3\right )} \sinh \relax (x)}{8 \, \cosh \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.15, size = 37, normalized size = 1.68 \[ -\frac {3}{2} \, x + \frac {3 \, e^{\left (4 \, x\right )} - 14 \, e^{\left (2 \, x\right )} - 1}{8 \, {\left (e^{\left (4 \, x\right )} + e^{\left (2 \, x\right )}\right )}} + \frac {1}{8} \, e^{\left (2 \, x\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.35, size = 13, normalized size = 0.59 \[ \frac {\cosh \relax (x ) \sinh \relax (x )}{2}-\frac {3 x}{2}+\tanh \relax (x ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 26, normalized size = 1.18 \[ -\frac {3}{2} \, x + \frac {2}{e^{\left (-2 \, x\right )} + 1} + \frac {1}{8} \, e^{\left (2 \, x\right )} - \frac {1}{8} \, e^{\left (-2 \, x\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.54, size = 26, normalized size = 1.18 \[ \frac {{\mathrm {e}}^{2\,x}}{8}-\frac {{\mathrm {e}}^{-2\,x}}{8}-\frac {3\,x}{2}-\frac {2}{{\mathrm {e}}^{2\,x}+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (- \cosh {\relax (x )} + \operatorname {sech}{\relax (x )}\right )^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________