Optimal. Leaf size=58 \[ -\frac {2 (a A-b B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2}}-\frac {B \tanh ^{-1}(\cosh (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {2828, 3001, 3770, 2660, 618, 206} \[ -\frac {2 (a A-b B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2}}-\frac {B \tanh ^{-1}(\cosh (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 2660
Rule 2828
Rule 3001
Rule 3770
Rubi steps
\begin {align*} \int \frac {A+B \text {csch}(x)}{a+b \sinh (x)} \, dx &=-\left (i \int \frac {\text {csch}(x) (i B+i A \sinh (x))}{a+b \sinh (x)} \, dx\right )\\ &=\frac {B \int \text {csch}(x) \, dx}{a}+\frac {(a A-b B) \int \frac {1}{a+b \sinh (x)} \, dx}{a}\\ &=-\frac {B \tanh ^{-1}(\cosh (x))}{a}+\frac {(2 (a A-b B)) \operatorname {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a}\\ &=-\frac {B \tanh ^{-1}(\cosh (x))}{a}-\frac {(4 (a A-b B)) \operatorname {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{a}\\ &=-\frac {B \tanh ^{-1}(\cosh (x))}{a}-\frac {2 (a A-b B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.12, size = 67, normalized size = 1.16 \[ \frac {\frac {2 (a A-b B) \tan ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+B \log \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.47, size = 172, normalized size = 2.97 \[ -\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 ) + {\left (B a^{2} + B b^{2}\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) + 1\right ) - {\left (B a^{2} + B b^{2}\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) - 1\right )}{a^{3} + a b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 90, normalized size = 1.55 \[ -\frac {B \log \left (e^{x} + 1\right )}{a} + \frac {B \log \left ({\left | e^{x} - 1 \right |}\right )}{a} + \frac {{\left (A a - B b\right )} \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 86, normalized size = 1.48 \[ \frac {2 \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right ) A}{\sqrt {a^{2}+b^{2}}}-\frac {2 B b \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{a \sqrt {a^{2}+b^{2}}}+\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.46, size = 141, normalized size = 2.43 \[ -B {\left (\frac {b \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} a} + \frac {\log \left (e^{\left (-x\right )} + 1\right )}{a} - \frac {\log \left (e^{\left (-x\right )} - 1\right )}{a}\right )} + \frac {A \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.18, size = 539, normalized size = 9.29 \[ \frac {B\,\ln \left ({\mathrm {e}}^x-1\right )}{a}-\frac {B\,\ln \left ({\mathrm {e}}^x+1\right )}{a}-\frac {\ln \left (\frac {\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 {\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\,\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\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}+\frac {32\,B\,\left (A\,a-B\,b\right )\,\left (A\,b\,{\mathrm {e}}^x-2\,B\,b+4\,B\,a\,{\mathrm {e}}^x\right )}{b^5}\right )\,\left (A\,a-B\,b\right )\,\sqrt {a^2+b^2}}{a^3+a\,b^2}+\frac {\ln \left (\frac {32\,B\,\left (A\,a-B\,b\right )\,\left (A\,b\,{\mathrm {e}}^x-2\,B\,b+4\,B\,a\,{\mathrm {e}}^x\right )}{b^5}-\frac {\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 {\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\,\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\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}\right )\,\left (A\,a-B\,b\right )\,\sqrt {a^2+b^2}}{a^3+a\,b^2} \]
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 \sinh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________