Optimal. Leaf size=41 \[ \frac {2 \tanh ^{-1}\left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}} \]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 42, normalized size of antiderivative = 1.02, number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2659, 208} \[ \frac {2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 2659
Rubi steps
\begin {align*} \int \frac {1}{a+b \cosh (x)} \, dx &=2 \operatorname {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )\\ &=\frac {2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 41, normalized size = 1.00 \[ -\frac {2 \tan ^{-1}\left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{a+b \cosh (x)} \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.15, size = 175, normalized size = 4.27 \[ \left [\frac {\log \left (\frac {b^{2} \cosh \relax (x)^{2} + b^{2} \sinh \relax (x)^{2} + 2 \, a b \cosh \relax (x) + 2 \, a^{2} - b^{2} + 2 \, {\left (b^{2} \cosh \relax (x) + a b\right )} \sinh \relax (x) - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cosh \relax (x) + b \sinh \relax (x) + a\right )}}{b \cosh \relax (x)^{2} + b \sinh \relax (x)^{2} + 2 \, a \cosh \relax (x) + 2 \, {\left (b \cosh \relax (x) + a\right )} \sinh \relax (x) + b}\right )}{\sqrt {a^{2} - b^{2}}}, -\frac {2 \, \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cosh \relax (x) + b \sinh \relax (x) + a\right )}}{a^{2} - b^{2}}\right )}{a^{2} - b^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.59, size = 32, normalized size = 0.78 \[ \frac {2 \, \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 36, normalized size = 0.88
method | result | size |
default | \(\frac {2 \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(36\) |
risch | \(\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}\) | \(109\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.16, size = 43, normalized size = 1.05 \[ \frac {2\,\mathrm {atan}\left (\frac {a}{\sqrt {b^2-a^2}}+\frac {b\,{\mathrm {e}}^x}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 4.41, size = 126, normalized size = 3.07 \[ \begin {cases} \tilde {\infty } \operatorname {atan}{\left (\tanh {\left (\frac {x}{2} \right )} \right )} & \text {for}\: a = 0 \wedge b = 0 \\- \frac {1}{b \tanh {\left (\frac {x}{2} \right )}} & \text {for}\: a = - b \\\frac {\tanh {\left (\frac {x}{2} \right )}}{b} & \text {for}\: a = b \\- \frac {\log {\left (- \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{a \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} - b \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} + \frac {\log {\left (\sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{a \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} - b \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________