Optimal. Leaf size=74 \[ \frac{2 \left (a c^2+b d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c^2 \sqrt{c-d} \sqrt{c+d}}-\frac{b d \tan ^{-1}(\sinh (x))}{c^2}+\frac{b \tanh (x)}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.245407, antiderivative size = 74, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {4234, 3056, 3001, 3770, 2659, 208} \[ \frac{2 \left (a c^2+b d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c^2 \sqrt{c-d} \sqrt{c+d}}-\frac{b d \tan ^{-1}(\sinh (x))}{c^2}+\frac{b \tanh (x)}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4234
Rule 3056
Rule 3001
Rule 3770
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{a+b \text{sech}^2(x)}{c+d \cosh (x)} \, dx &=\int \frac{\left (b+a \cosh ^2(x)\right ) \text{sech}^2(x)}{c+d \cosh (x)} \, dx\\ &=\frac{b \tanh (x)}{c}+\frac{\int \frac{(-b d+a c \cosh (x)) \text{sech}(x)}{c+d \cosh (x)} \, dx}{c}\\ &=\frac{b \tanh (x)}{c}-\frac{(b d) \int \text{sech}(x) \, dx}{c^2}+\left (a+\frac{b d^2}{c^2}\right ) \int \frac{1}{c+d \cosh (x)} \, dx\\ &=-\frac{b d \tan ^{-1}(\sinh (x))}{c^2}+\frac{b \tanh (x)}{c}+\left (2 \left (a+\frac{b d^2}{c^2}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{c+d-(c-d) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )\\ &=-\frac{b d \tan ^{-1}(\sinh (x))}{c^2}+\frac{2 \left (a+\frac{b d^2}{c^2}\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{\sqrt{c-d} \sqrt{c+d}}+\frac{b \tanh (x)}{c}\\ \end{align*}
Mathematica [A] time = 0.217917, size = 127, normalized size = 1.72 \[ -\frac{2 \text{sech}(x) \left (a \cosh ^2(x)+b\right ) \left (2 \cosh (x) \left (\left (a c^2+b d^2\right ) \tan ^{-1}\left (\frac{(c-d) \tanh \left (\frac{x}{2}\right )}{\sqrt{d^2-c^2}}\right )+b d \sqrt{d^2-c^2} \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )\right )-b c \sqrt{d^2-c^2} \sinh (x)\right )}{c^2 \sqrt{d^2-c^2} (a \cosh (2 x)+a+2 b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 112, normalized size = 1.5 \begin{align*} 2\,{\frac{\tanh \left ( x/2 \right ) b}{c \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) }}-2\,{\frac{bd\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{{c}^{2}}}+2\,{\frac{a}{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{ \left ( c-d \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) }+2\,{\frac{b{d}^{2}}{{c}^{2}\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{ \left ( c-d \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 6.2375, size = 1480, normalized size = 20. \begin{align*} \text{result too large to display} \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 \frac{a + b \operatorname{sech}^{2}{\left (x \right )}}{c + d \cosh{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.13716, size = 96, normalized size = 1.3 \begin{align*} -\frac{2 \, b d \arctan \left (e^{x}\right )}{c^{2}} + \frac{2 \,{\left (a c^{2} + b d^{2}\right )} \arctan \left (\frac{d e^{x} + c}{\sqrt{-c^{2} + d^{2}}}\right )}{\sqrt{-c^{2} + d^{2}} c^{2}} - \frac{2 \, b}{c{\left (e^{\left (2 \, x\right )} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]