Optimal. Leaf size=135 \[ \frac {\left (2 a^2 A+A b^2-3 a b B\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2}}-\frac {(A b-a B) \sinh (x)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2}-\frac {\left (3 a A b-a^2 B-2 b^2 B\right ) \sinh (x)}{2 \left (a^2-b^2\right )^2 (a+b \cosh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {2833, 12, 2738,
214} \begin {gather*} \frac {\left (2 a^2 A-3 a b B+A b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2}}-\frac {\sinh (x) \left (a^2 (-B)+3 a A b-2 b^2 B\right )}{2 \left (a^2-b^2\right )^2 (a+b \cosh (x))}-\frac {\sinh (x) (A b-a B)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 2833
Rubi steps
\begin {align*} \int \frac {A+B \cosh (x)}{(a+b \cosh (x))^3} \, dx &=-\frac {(A b-a B) \sinh (x)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2}-\frac {\int \frac {-2 (a A-b B)+(A b-a B) \cosh (x)}{(a+b \cosh (x))^2} \, dx}{2 \left (a^2-b^2\right )}\\ &=-\frac {(A b-a B) \sinh (x)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2}-\frac {\left (3 a A b-a^2 B-2 b^2 B\right ) \sinh (x)}{2 \left (a^2-b^2\right )^2 (a+b \cosh (x))}+\frac {\int \frac {2 a^2 A+A b^2-3 a b B}{a+b \cosh (x)} \, dx}{2 \left (a^2-b^2\right )^2}\\ &=-\frac {(A b-a B) \sinh (x)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2}-\frac {\left (3 a A b-a^2 B-2 b^2 B\right ) \sinh (x)}{2 \left (a^2-b^2\right )^2 (a+b \cosh (x))}+\frac {\left (2 a^2 A+A b^2-3 a b B\right ) \int \frac {1}{a+b \cosh (x)} \, dx}{2 \left (a^2-b^2\right )^2}\\ &=-\frac {(A b-a B) \sinh (x)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2}-\frac {\left (3 a A b-a^2 B-2 b^2 B\right ) \sinh (x)}{2 \left (a^2-b^2\right )^2 (a+b \cosh (x))}+\frac {\left (2 a^2 A+A b^2-3 a b B\right ) \text {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{\left (a^2-b^2\right )^2}\\ &=\frac {\left (2 a^2 A+A b^2-3 a b B\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2}}-\frac {(A b-a B) \sinh (x)}{2 \left (a^2-b^2\right ) (a+b \cosh (x))^2}-\frac {\left (3 a A b-a^2 B-2 b^2 B\right ) \sinh (x)}{2 \left (a^2-b^2\right )^2 (a+b \cosh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.31, size = 134, normalized size = 0.99 \begin {gather*} \frac {1}{2} \left (-\frac {2 \left (2 a^2 A+A b^2-3 a b B\right ) \text {ArcTan}\left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\left (-a^2+b^2\right )^{5/2}}+\frac {(-A b+a B) \sinh (x)}{(a-b) (a+b) (a+b \cosh (x))^2}+\frac {\left (-3 a A b+a^2 B+2 b^2 B\right ) \sinh (x)}{(a-b)^2 (a+b)^2 (a+b \cosh (x))}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.48, size = 207, normalized size = 1.53
method | result | size |
default | \(-\frac {2 \left (-\frac {\left (4 A a b +A \,b^{2}-2 B \,a^{2}-B a b -2 B \,b^{2}\right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 a b +b^{2}\right )}+\frac {\left (4 A a b -A \,b^{2}-2 B \,a^{2}+B a b -2 B \,b^{2}\right ) \tanh \left (\frac {x}{2}\right )}{2 \left (a +b \right ) \left (a^{2}-2 a b +b^{2}\right )}\right )}{\left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-a -b \right )^{2}}+\frac {\left (2 a^{2} A +A \,b^{2}-3 B a b \right ) \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(207\) |
risch | \(\frac {2 A \,a^{2} b^{2} {\mathrm e}^{3 x}+A \,b^{4} {\mathrm e}^{3 x}-3 B a \,b^{3} {\mathrm e}^{3 x}+6 A \,a^{3} b \,{\mathrm e}^{2 x}+3 A a \,b^{3} {\mathrm e}^{2 x}-2 B \,a^{4} {\mathrm e}^{2 x}-5 B \,a^{2} b^{2} {\mathrm e}^{2 x}-2 B \,b^{4} {\mathrm e}^{2 x}+10 A \,a^{2} b^{2} {\mathrm e}^{x}-A \,b^{4} {\mathrm e}^{x}-4 B \,a^{3} b \,{\mathrm e}^{x}-5 B a \,b^{3} {\mathrm e}^{x}+3 A a \,b^{3}-B \,a^{2} b^{2}-2 B \,b^{4}}{b \left (a^{2}-b^{2}\right )^{2} \left (b \,{\mathrm e}^{2 x}+2 a \,{\mathrm e}^{x}+b \right )^{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 ) a^{2} A}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{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 ) A \,b^{2}}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {3 \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{b \sqrt {a^{2}-b^{2}}}\right ) B a b}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{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 ) a^{2} A}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{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 ) A \,b^{2}}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{b \sqrt {a^{2}-b^{2}}}\right ) B a b}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(597\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1545 vs.
\(2 (120) = 240\).
time = 0.45, size = 3166, normalized size = 23.45 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 249 vs.
\(2 (120) = 240\).
time = 0.41, size = 249, normalized size = 1.84 \begin {gather*} \frac {{\left (2 \, A a^{2} - 3 \, B a b + A b^{2}\right )} \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {-a^{2} + b^{2}}} + \frac {2 \, A a^{2} b^{2} e^{\left (3 \, x\right )} - 3 \, B a b^{3} e^{\left (3 \, x\right )} + A b^{4} e^{\left (3 \, x\right )} - 2 \, B a^{4} e^{\left (2 \, x\right )} + 6 \, A a^{3} b e^{\left (2 \, x\right )} - 5 \, B a^{2} b^{2} e^{\left (2 \, x\right )} + 3 \, A a b^{3} e^{\left (2 \, x\right )} - 2 \, B b^{4} e^{\left (2 \, x\right )} - 4 \, B a^{3} b e^{x} + 10 \, A a^{2} b^{2} e^{x} - 5 \, B a b^{3} e^{x} - A b^{4} e^{x} - B a^{2} b^{2} + 3 \, A a b^{3} - 2 \, B b^{4}}{{\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} {\left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} + b\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {A+B\,\mathrm {cosh}\left (x\right )}{{\left (a+b\,\mathrm {cosh}\left (x\right )\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________