Optimal. Leaf size=41 \[ \frac{3 x}{2 a}-\frac{2 \sinh (x)}{a}+\frac{3 \sinh (x) \cosh (x)}{2 a}-\frac{\sinh (x) \cosh (x)}{a \text{sech}(x)+a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0796549, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {3819, 3787, 2635, 8, 2637} \[ \frac{3 x}{2 a}-\frac{2 \sinh (x)}{a}+\frac{3 \sinh (x) \cosh (x)}{2 a}-\frac{\sinh (x) \cosh (x)}{a \text{sech}(x)+a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3819
Rule 3787
Rule 2635
Rule 8
Rule 2637
Rubi steps
\begin{align*} \int \frac{\cosh ^2(x)}{a+a \text{sech}(x)} \, dx &=-\frac{\cosh (x) \sinh (x)}{a+a \text{sech}(x)}-\frac{\int \cosh ^2(x) (-3 a+2 a \text{sech}(x)) \, dx}{a^2}\\ &=-\frac{\cosh (x) \sinh (x)}{a+a \text{sech}(x)}-\frac{2 \int \cosh (x) \, dx}{a}+\frac{3 \int \cosh ^2(x) \, dx}{a}\\ &=-\frac{2 \sinh (x)}{a}+\frac{3 \cosh (x) \sinh (x)}{2 a}-\frac{\cosh (x) \sinh (x)}{a+a \text{sech}(x)}+\frac{3 \int 1 \, dx}{2 a}\\ &=\frac{3 x}{2 a}-\frac{2 \sinh (x)}{a}+\frac{3 \cosh (x) \sinh (x)}{2 a}-\frac{\cosh (x) \sinh (x)}{a+a \text{sech}(x)}\\ \end{align*}
Mathematica [A] time = 0.0480794, size = 45, normalized size = 1.1 \[ \frac{\text{sech}\left (\frac{x}{2}\right ) \left (-12 \sinh \left (\frac{x}{2}\right )-3 \sinh \left (\frac{3 x}{2}\right )+\sinh \left (\frac{5 x}{2}\right )+12 x \cosh \left (\frac{x}{2}\right )\right )}{8 a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.029, size = 87, normalized size = 2.1 \begin{align*} -{\frac{1}{a}\tanh \left ({\frac{x}{2}} \right ) }-{\frac{1}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+{\frac{3}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}+{\frac{3}{2\,a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{1}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}+{\frac{3}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}-{\frac{3}{2\,a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.1507, size = 76, normalized size = 1.85 \begin{align*} \frac{3 \, x}{2 \, a} + \frac{4 \, e^{\left (-x\right )} - e^{\left (-2 \, x\right )}}{8 \, a} - \frac{3 \, e^{\left (-x\right )} + 20 \, e^{\left (-2 \, x\right )} - 1}{8 \,{\left (a e^{\left (-2 \, x\right )} + a e^{\left (-3 \, x\right )}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.17091, size = 242, normalized size = 5.9 \begin{align*} \frac{\cosh \left (x\right )^{3} +{\left (3 \, \cosh \left (x\right ) - 4\right )} \sinh \left (x\right )^{2} + \sinh \left (x\right )^{3} +{\left (12 \, x - 1\right )} \cosh \left (x\right ) - 4 \, \cosh \left (x\right )^{2} +{\left (3 \, \cosh \left (x\right )^{2} + 12 \, x - 4 \, \cosh \left (x\right ) - 7\right )} \sinh \left (x\right ) + 12 \, x + 20}{8 \,{\left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + a\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*} \frac{\int \frac{\cosh ^{2}{\left (x \right )}}{\operatorname{sech}{\left (x \right )} + 1}\, dx}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12272, size = 69, normalized size = 1.68 \begin{align*} \frac{3 \, x}{2 \, a} + \frac{{\left (20 \, e^{\left (2 \, x\right )} + 3 \, e^{x} - 1\right )} e^{\left (-2 \, x\right )}}{8 \, a{\left (e^{x} + 1\right )}} + \frac{a e^{\left (2 \, x\right )} - 4 \, a e^{x}}{8 \, a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]