Optimal. Leaf size=27 \[ -B x+\frac {(i A-B) \cosh (x)}{i-\sinh (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2814, 2727}
\begin {gather*} -B x+\frac {(-B+i A) \cosh (x)}{-\sinh (x)+i} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2727
Rule 2814
Rubi steps
\begin {align*} \int \frac {A+B \sinh (x)}{i-\sinh (x)} \, dx &=-B x+(A+i B) \int \frac {1}{i-\sinh (x)} \, dx\\ &=-B x+\frac {(i A-B) \cosh (x)}{i-\sinh (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(59\) vs. \(2(27)=54\).
time = 0.06, size = 59, normalized size = 2.19 \begin {gather*} \frac {\left (i \cosh \left (\frac {x}{2}\right )-\sinh \left (\frac {x}{2}\right )\right ) \left (B x \cosh \left (\frac {x}{2}\right )+i (2 A+B (2 i+x)) \sinh \left (\frac {x}{2}\right )\right )}{-i+\sinh (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.44, size = 39, normalized size = 1.44
method | result | size |
risch | \(-B x +\frac {2 A}{{\mathrm e}^{x}-i}+\frac {2 i B}{{\mathrm e}^{x}-i}\) | \(27\) |
default | \(-\frac {2 i \left (i B +A \right )}{\tanh \left (\frac {x}{2}\right )-i}+B \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-B \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )\) | \(39\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 27, normalized size = 1.00 \begin {gather*} -B {\left (x - \frac {2 i}{e^{\left (-x\right )} + i}\right )} + \frac {2 \, A}{e^{\left (-x\right )} + i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 24, normalized size = 0.89 \begin {gather*} -\frac {B x e^{x} - i \, B x - 2 \, A - 2 i \, B}{e^{x} - i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.06, size = 15, normalized size = 0.56 \begin {gather*} - B x + \frac {2 A + 2 i B}{e^{x} - i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 18, normalized size = 0.67 \begin {gather*} -B x + \frac {2 \, {\left (A + i \, B\right )}}{e^{x} - i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 21, normalized size = 0.78 \begin {gather*} -B\,x+\frac {2\,A+B\,2{}\mathrm {i}}{{\mathrm {e}}^x-\mathrm {i}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________