Optimal. Leaf size=62 \[ \frac {2 (a A-b B) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b}}+\frac {B \tan ^{-1}(\sinh (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 62, normalized size of antiderivative = 1.00, 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 A-b B) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b}}+\frac {B \tan ^{-1}(\sinh (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 2659
Rule 2828
Rule 3001
Rule 3770
Rubi steps
\begin {align*} \int \frac {A+B \text {sech}(x)}{a+b \cosh (x)} \, dx &=\int \frac {(B+A \cosh (x)) \text {sech}(x)}{a+b \cosh (x)} \, dx\\ &=\frac {B \int \text {sech}(x) \, dx}{a}+\frac {(a A-b B) \int \frac {1}{a+b \cosh (x)} \, dx}{a}\\ &=\frac {B \tan ^{-1}(\sinh (x))}{a}+\frac {(2 (a A-b B)) \operatorname {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a}\\ &=\frac {B \tan ^{-1}(\sinh (x))}{a}+\frac {2 (a A-b B) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 63, normalized size = 1.02 \[ \frac {2 \left (\frac {(b B-a A) \tan ^{-1}\left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}}+B \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )\right )}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.98, size = 249, normalized size = 4.02 \[ \left [-\frac {{\left (A a - B b\right )} \sqrt {a^{2} - b^{2}} \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 ) - 2 \, {\left (B a^{2} - B b^{2}\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right )}{a^{3} - a b^{2}}, -\frac {2 \, {\left ({\left (A a - B b\right )} \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 ) - {\left (B a^{2} - B b^{2}\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right )\right )}}{a^{3} - a b^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.13, size = 53, normalized size = 0.85 \[ \frac {2 \, B \arctan \left (e^{x}\right )}{a} + \frac {2 \, {\left (A a - B b\right )} \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}} a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 89, normalized size = 1.44 \[ \frac {2 A \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 )}}-\frac {2 B b \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 B \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \]
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 = 6.41, size = 636, normalized size = 10.26 \[ \frac {\ln \left (\frac {\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )\,\left (\frac {32\,\left (A^2\,a^2\,b-2\,A\,B\,a\,b^2-4\,{\mathrm {e}}^x\,B^2\,a^3-2\,B^2\,a^2\,b+3\,{\mathrm {e}}^x\,B^2\,a\,b^2+2\,B^2\,b^3\right )}{b^5}+\frac {\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )\,\left (\frac {32\,a^2\,\left (2\,B\,b^2-4\,A\,a^2\,{\mathrm {e}}^x+A\,b^2\,{\mathrm {e}}^x-2\,A\,a\,b+3\,B\,a\,b\,{\mathrm {e}}^x\right )}{b^5}-\frac {32\,a^2\,\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )\,\left (4\,{\mathrm {e}}^x\,a^3+3\,a^2\,b-3\,{\mathrm {e}}^x\,a\,b^2-2\,b^3\right )}{b^5\,\left (a\,b^2-a^3\right )}\right )}{a\,b^2-a^3}\right )}{a\,b^2-a^3}-\frac {32\,B\,\left (A\,a-B\,b\right )\,\left (2\,B\,b-A\,b\,{\mathrm {e}}^x+4\,B\,a\,{\mathrm {e}}^x\right )}{b^5}\right )\,\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )}{a\,b^2-a^3}-\frac {\ln \left (-\frac {\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )\,\left (\frac {32\,\left (A^2\,a^2\,b-2\,A\,B\,a\,b^2-4\,{\mathrm {e}}^x\,B^2\,a^3-2\,B^2\,a^2\,b+3\,{\mathrm {e}}^x\,B^2\,a\,b^2+2\,B^2\,b^3\right )}{b^5}-\frac {\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )\,\left (\frac {32\,a^2\,\left (2\,B\,b^2-4\,A\,a^2\,{\mathrm {e}}^x+A\,b^2\,{\mathrm {e}}^x-2\,A\,a\,b+3\,B\,a\,b\,{\mathrm {e}}^x\right )}{b^5}+\frac {32\,a^2\,\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )\,\left (4\,{\mathrm {e}}^x\,a^3+3\,a^2\,b-3\,{\mathrm {e}}^x\,a\,b^2-2\,b^3\right )}{b^5\,\left (a\,b^2-a^3\right )}\right )}{a\,b^2-a^3}\right )}{a\,b^2-a^3}-\frac {32\,B\,\left (A\,a-B\,b\right )\,\left (2\,B\,b-A\,b\,{\mathrm {e}}^x+4\,B\,a\,{\mathrm {e}}^x\right )}{b^5}\right )\,\sqrt {\left (a+b\right )\,\left (a-b\right )}\,\left (A\,a-B\,b\right )}{a\,b^2-a^3}-\frac {B\,\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,1{}\mathrm {i}}{a}+\frac {B\,\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {A + B \operatorname {sech}{\relax (x )}}{a + b \cosh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________