Optimal. Leaf size=62 \[ \frac{2 (a c-b d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c \sqrt{c-d} \sqrt{c+d}}+\frac{b \tan ^{-1}(\sinh (x))}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.156827, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {2828, 3001, 3770, 2659, 208} \[ \frac{2 (a c-b d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c \sqrt{c-d} \sqrt{c+d}}+\frac{b \tan ^{-1}(\sinh (x))}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2828
Rule 3001
Rule 3770
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{a+b \text{sech}(x)}{c+d \cosh (x)} \, dx &=\int \frac{(b+a \cosh (x)) \text{sech}(x)}{c+d \cosh (x)} \, dx\\ &=\frac{b \int \text{sech}(x) \, dx}{c}+\frac{(a c-b d) \int \frac{1}{c+d \cosh (x)} \, dx}{c}\\ &=\frac{b \tan ^{-1}(\sinh (x))}{c}+\frac{(2 (a c-b d)) \operatorname{Subst}\left (\int \frac{1}{c+d-(c-d) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{c}\\ &=\frac{b \tan ^{-1}(\sinh (x))}{c}+\frac{2 (a c-b d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c \sqrt{c-d} \sqrt{c+d}}\\ \end{align*}
Mathematica [A] time = 0.124403, size = 63, normalized size = 1.02 \[ \frac{2 \left (\frac{(b d-a c) \tan ^{-1}\left (\frac{(c-d) \tanh \left (\frac{x}{2}\right )}{\sqrt{d^2-c^2}}\right )}{\sqrt{d^2-c^2}}+b \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )\right )}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 89, normalized size = 1.4 \begin{align*} 2\,{\frac{b\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{c}}+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{bd}{c\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 [A] time = 5.78853, size = 643, normalized size = 10.37 \begin{align*} \left [-\frac{{\left (a c - b d\right )} \sqrt{c^{2} - d^{2}} \log \left (\frac{d^{2} \cosh \left (x\right )^{2} + d^{2} \sinh \left (x\right )^{2} + 2 \, c d \cosh \left (x\right ) + 2 \, c^{2} - d^{2} + 2 \,{\left (d^{2} \cosh \left (x\right ) + c d\right )} \sinh \left (x\right ) + 2 \, \sqrt{c^{2} - d^{2}}{\left (d \cosh \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{d \cosh \left (x\right )^{2} + d \sinh \left (x\right )^{2} + 2 \, c \cosh \left (x\right ) + 2 \,{\left (d \cosh \left (x\right ) + c\right )} \sinh \left (x\right ) + d}\right ) - 2 \,{\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{c^{3} - c d^{2}}, -\frac{2 \,{\left ({\left (a c - b d\right )} \sqrt{-c^{2} + d^{2}} \arctan \left (-\frac{\sqrt{-c^{2} + d^{2}}{\left (d \cosh \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{c^{2} - d^{2}}\right ) -{\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{c^{3} - c d^{2}}\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 \frac{a + b \operatorname{sech}{\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.15093, size = 72, normalized size = 1.16 \begin{align*} \frac{2 \, b \arctan \left (e^{x}\right )}{c} + \frac{2 \,{\left (a c - b d\right )} \arctan \left (\frac{d e^{x} + c}{\sqrt{-c^{2} + d^{2}}}\right )}{\sqrt{-c^{2} + d^{2}} c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]