Optimal. Leaf size=99 \[ \frac {b B \log (a+b \cosh (x))}{a^2-b^2}+\frac {2 A \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {B \log (1-\cosh (x))}{2 (a+b)}-\frac {B \log (\cosh (x)+1)}{2 (a-b)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.31, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.533, Rules used = {4225, 4401, 2659, 208, 2668, 706, 31, 633} \[ \frac {b B \log (a+b \cosh (x))}{a^2-b^2}+\frac {2 A \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {B \log (1-\cosh (x))}{2 (a+b)}-\frac {B \log (\cosh (x)+1)}{2 (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 208
Rule 633
Rule 706
Rule 2659
Rule 2668
Rule 4225
Rule 4401
Rubi steps
\begin {align*} \int \frac {A+B \text {csch}(x)}{a+b \cosh (x)} \, dx &=-\left (i \int \frac {\text {csch}(x) (i B+i A \sinh (x))}{a+b \cosh (x)} \, dx\right )\\ &=\int \left (\frac {A}{a+b \cosh (x)}+\frac {B \text {csch}(x)}{a+b \cosh (x)}\right ) \, dx\\ &=A \int \frac {1}{a+b \cosh (x)} \, dx+B \int \frac {\text {csch}(x)}{a+b \cosh (x)} \, dx\\ &=(2 A) \operatorname {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )-(b B) \operatorname {Subst}\left (\int \frac {1}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \cosh (x)\right )\\ &=\frac {2 A \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {(b B) \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \cosh (x)\right )}{a^2-b^2}+\frac {(b B) \operatorname {Subst}\left (\int \frac {-a+x}{b^2-x^2} \, dx,x,b \cosh (x)\right )}{a^2-b^2}\\ &=\frac {2 A \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {b B \log (a+b \cosh (x))}{a^2-b^2}+\frac {B \operatorname {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \cosh (x)\right )}{2 (a-b)}-\frac {B \operatorname {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \cosh (x)\right )}{2 (a+b)}\\ &=\frac {2 A \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {B \log (1-\cosh (x))}{2 (a+b)}-\frac {B \log (1+\cosh (x))}{2 (a-b)}+\frac {b B \log (a+b \cosh (x))}{a^2-b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.20, size = 81, normalized size = 0.82 \[ \frac {B \left (b \log (a+b \cosh (x))+a \log \left (\tanh \left (\frac {x}{2}\right )\right )-b \log (\sinh (x))\right )}{a^2-b^2}-\frac {2 A \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]
________________________________________________________________________________________
fricas [A] time = 3.25, size = 298, normalized size = 3.01 \[ \left [\frac {B b \log \left (\frac {2 \, {\left (b \cosh \relax (x) + a\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + \sqrt {a^{2} - b^{2}} A \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 ) - {\left (B a + B b\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) + 1\right ) + {\left (B a - B b\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) - 1\right )}{a^{2} - b^{2}}, \frac {B b \log \left (\frac {2 \, {\left (b \cosh \relax (x) + a\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) - 2 \, \sqrt {-a^{2} + b^{2}} A \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 + B b\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) + 1\right ) + {\left (B a - B b\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) - 1\right )}{a^{2} - b^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 90, normalized size = 0.91 \[ \frac {B b \log \left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} + b\right )}{a^{2} - b^{2}} + \frac {2 \, A \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}}} - \frac {B \log \left (e^{x} + 1\right )}{a - b} + \frac {B \log \left ({\left | e^{x} - 1 \right |}\right )}{a + b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 138, normalized size = 1.39 \[ \frac {B b \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b -a -b \right )}{\left (a +b \right ) \left (a -b \right )}+\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 ) A a}{\left (a +b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}+\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 ) A b}{\left (a +b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a +b} \]
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 = 3.33, size = 983, normalized size = 9.93 \[ \frac {\ln \left (\frac {\left (\frac {32\,\left (A^2\,a^2\,b+2\,{\mathrm {e}}^x\,A^2\,a\,b^2+A^2\,b^3-8\,{\mathrm {e}}^x\,A\,B\,a^2\,b-4\,A\,B\,a\,b^2+2\,{\mathrm {e}}^x\,A\,B\,b^3+4\,{\mathrm {e}}^x\,B^2\,a^3+2\,B^2\,a^2\,b+3\,{\mathrm {e}}^x\,B^2\,a\,b^2\right )}{b^5}+\frac {\left (\frac {32\,\left (2\,B\,b^4+B\,a^2\,b^2-4\,A\,a^4\,{\mathrm {e}}^x-A\,b^4\,{\mathrm {e}}^x+2\,A\,a\,b^3-2\,A\,a^3\,b+6\,B\,a\,b^3\,{\mathrm {e}}^x-3\,B\,a^3\,b\,{\mathrm {e}}^x+5\,A\,a^2\,b^2\,{\mathrm {e}}^x\right )}{b^5}-\frac {32\,\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,b^3+B\,a^2\,b\right )\,\left (4\,{\mathrm {e}}^x\,a^5+3\,a^4\,b-5\,{\mathrm {e}}^x\,a^3\,b^2-3\,a^2\,b^3+{\mathrm {e}}^x\,a\,b^4\right )}{b^5\,\left (a^4-2\,a^2\,b^2+b^4\right )}\right )\,\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,b^3+B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}\right )\,\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,b^3+B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {32\,\left ({\mathrm {e}}^x\,A^2\,B\,a\,b+A^2\,B\,b^2-4\,{\mathrm {e}}^x\,A\,B^2\,a^2-2\,A\,B^2\,a\,b+{\mathrm {e}}^x\,A\,B^2\,b^2+4\,{\mathrm {e}}^x\,B^3\,a\,b+2\,B^3\,b^2\right )}{b^5}\right )\,\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,b^3+B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {B\,\ln \left ({\mathrm {e}}^x+1\right )}{a-b}-\frac {\ln \left (-\frac {32\,\left ({\mathrm {e}}^x\,A^2\,B\,a\,b+A^2\,B\,b^2-4\,{\mathrm {e}}^x\,A\,B^2\,a^2-2\,A\,B^2\,a\,b+{\mathrm {e}}^x\,A\,B^2\,b^2+4\,{\mathrm {e}}^x\,B^3\,a\,b+2\,B^3\,b^2\right )}{b^5}-\frac {\left (\frac {32\,\left (A^2\,a^2\,b+2\,{\mathrm {e}}^x\,A^2\,a\,b^2+A^2\,b^3-8\,{\mathrm {e}}^x\,A\,B\,a^2\,b-4\,A\,B\,a\,b^2+2\,{\mathrm {e}}^x\,A\,B\,b^3+4\,{\mathrm {e}}^x\,B^2\,a^3+2\,B^2\,a^2\,b+3\,{\mathrm {e}}^x\,B^2\,a\,b^2\right )}{b^5}-\frac {\left (\frac {32\,\left (2\,B\,b^4+B\,a^2\,b^2-4\,A\,a^4\,{\mathrm {e}}^x-A\,b^4\,{\mathrm {e}}^x+2\,A\,a\,b^3-2\,A\,a^3\,b+6\,B\,a\,b^3\,{\mathrm {e}}^x-3\,B\,a^3\,b\,{\mathrm {e}}^x+5\,A\,a^2\,b^2\,{\mathrm {e}}^x\right )}{b^5}+\frac {32\,\left (B\,b^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^2\,b\right )\,\left (4\,{\mathrm {e}}^x\,a^5+3\,a^4\,b-5\,{\mathrm {e}}^x\,a^3\,b^2-3\,a^2\,b^3+{\mathrm {e}}^x\,a\,b^4\right )}{b^5\,\left (a^4-2\,a^2\,b^2+b^4\right )}\right )\,\left (B\,b^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}\right )\,\left (B\,b^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}\right )\,\left (B\,b^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^2\,b\right )}{a^4-2\,a^2\,b^2+b^4}+\frac {B\,\ln \left ({\mathrm {e}}^x-1\right )}{a+b} \]
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 {csch}{\relax (x )}}{a + b \cosh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________