Optimal. Leaf size=56 \[ \frac {\sqrt {2} (A-B) \text {ArcTan}\left (\frac {\sqrt {a} \sinh (x)}{\sqrt {2} \sqrt {a+a \cosh (x)}}\right )}{\sqrt {a}}+\frac {2 B \sinh (x)}{\sqrt {a+a \cosh (x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {2830, 2728,
212} \begin {gather*} \frac {\sqrt {2} (A-B) \text {ArcTan}\left (\frac {\sqrt {a} \sinh (x)}{\sqrt {2} \sqrt {a \cosh (x)+a}}\right )}{\sqrt {a}}+\frac {2 B \sinh (x)}{\sqrt {a \cosh (x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2830
Rubi steps
\begin {align*} \int \frac {A+B \cosh (x)}{\sqrt {a+a \cosh (x)}} \, dx &=\frac {2 B \sinh (x)}{\sqrt {a+a \cosh (x)}}+(A-B) \int \frac {1}{\sqrt {a+a \cosh (x)}} \, dx\\ &=\frac {2 B \sinh (x)}{\sqrt {a+a \cosh (x)}}+(2 i (A-B)) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,-\frac {i a \sinh (x)}{\sqrt {a+a \cosh (x)}}\right )\\ &=\frac {\sqrt {2} (A-B) \tan ^{-1}\left (\frac {\sqrt {a} \sinh (x)}{\sqrt {2} \sqrt {a+a \cosh (x)}}\right )}{\sqrt {a}}+\frac {2 B \sinh (x)}{\sqrt {a+a \cosh (x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 41, normalized size = 0.73 \begin {gather*} \frac {2 \cosh \left (\frac {x}{2}\right ) \left ((A-B) \text {ArcTan}\left (\sinh \left (\frac {x}{2}\right )\right )+2 B \sinh \left (\frac {x}{2}\right )\right )}{\sqrt {a (1+\cosh (x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(127\) vs.
\(2(45)=90\).
time = 1.31, size = 128, normalized size = 2.29
method | result | size |
default | \(-\frac {\cosh \left (\frac {x}{2}\right ) \sqrt {\left (\sinh ^{2}\left (\frac {x}{2}\right )\right ) a}\, \left (\ln \left (\frac {2 \sqrt {-a}\, \sqrt {\left (\sinh ^{2}\left (\frac {x}{2}\right )\right ) a}-2 a}{\cosh \left (\frac {x}{2}\right )}\right ) a A -2 B \sqrt {\left (\sinh ^{2}\left (\frac {x}{2}\right )\right ) a}\, \sqrt {-a}-\ln \left (\frac {2 \sqrt {-a}\, \sqrt {\left (\sinh ^{2}\left (\frac {x}{2}\right )\right ) a}-2 a}{\cosh \left (\frac {x}{2}\right )}\right ) a B \right ) \sqrt {2}}{a \sqrt {-a}\, \sinh \left (\frac {x}{2}\right ) \sqrt {a \left (\cosh ^{2}\left (\frac {x}{2}\right )\right )}}\) | \(128\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 174 vs.
\(2 (45) = 90\).
time = 0.56, size = 174, normalized size = 3.11 \begin {gather*} 2 \, {\left (\sqrt {2} {\left (\frac {\arctan \left (e^{\left (\frac {1}{2} \, x\right )}\right )}{\sqrt {a}} + \frac {e^{\left (\frac {1}{2} \, x\right )}}{\sqrt {a} e^{x} + \sqrt {a}}\right )} - \frac {\sqrt {2} e^{\left (\frac {1}{2} \, x\right )}}{\sqrt {a} e^{x} + \sqrt {a}}\right )} A - \frac {1}{3} \, {\left (3 \, \sqrt {2} {\left (\frac {\arctan \left (e^{\left (\frac {1}{2} \, x\right )}\right )}{\sqrt {a}} - \frac {e^{\left (\frac {1}{2} \, x\right )}}{\sqrt {a} e^{x} + \sqrt {a}}\right )} - \sqrt {2} {\left (\frac {3 \, \arctan \left (e^{\left (-\frac {1}{2} \, x\right )}\right )}{\sqrt {a}} - \frac {2 \, e^{\left (-\frac {1}{2} \, x\right )}}{\sqrt {a}} - \frac {e^{\left (-\frac {1}{2} \, x\right )}}{\sqrt {a} e^{\left (-x\right )} + \sqrt {a}}\right )} - \frac {3 \, \sqrt {2} \sqrt {a} e^{\left (\frac {3}{2} \, x\right )} - \sqrt {2} \sqrt {a} e^{\left (-\frac {1}{2} \, x\right )}}{a e^{x} + a}\right )} B \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.44, size = 72, normalized size = 1.29 \begin {gather*} \frac {2 \, {\left (\sqrt {2} {\left (A - B\right )} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {1}{2}} \sqrt {\frac {a}{\cosh \left (x\right ) + \sinh \left (x\right )}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}}{\sqrt {a}}\right ) + \sqrt {\frac {1}{2}} {\left (B \cosh \left (x\right ) + B \sinh \left (x\right ) - B\right )} \sqrt {\frac {a}{\cosh \left (x\right ) + \sinh \left (x\right )}}\right )}}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + B \cosh {\left (x \right )}}{\sqrt {a \left (\cosh {\left (x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 44, normalized size = 0.79 \begin {gather*} \frac {2 \, \sqrt {2} {\left (A - B\right )} \arctan \left (e^{\left (\frac {1}{2} \, x\right )}\right )}{\sqrt {a}} + \frac {\sqrt {2} B e^{\left (\frac {1}{2} \, x\right )}}{\sqrt {a}} - \frac {\sqrt {2} B e^{\left (-\frac {1}{2} \, x\right )}}{\sqrt {a}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {A+B\,\mathrm {cosh}\left (x\right )}{\sqrt {a+a\,\mathrm {cosh}\left (x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________