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.0249294, antiderivative size = 22, normalized size of antiderivative = 1., 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 288
Rule 321
Rule 206
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.0274479, size = 16, normalized size = 0.73 \[ -\frac{3 x}{2}+\frac{1}{4} \sinh (2 x)+\tanh (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.015, size = 13, normalized size = 0.6 \begin{align*}{\frac{\cosh \left ( x \right ) \sinh \left ( x \right ) }{2}}-{\frac{3\,x}{2}}+\tanh \left ( x \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.1983, size = 35, normalized size = 1.59 \begin{align*} -\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 )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.9106, size = 101, normalized size = 4.59 \begin{align*} \frac{\sinh \left (x\right )^{3} - 4 \,{\left (3 \, x + 2\right )} \cosh \left (x\right ) + 3 \,{\left (\cosh \left (x\right )^{2} + 3\right )} \sinh \left (x\right )}{8 \, \cosh \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (- \cosh{\left (x \right )} + \operatorname{sech}{\left (x \right )}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.14546, size = 50, normalized size = 2.27 \begin{align*} -\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 )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]