Optimal. Leaf size=77 \[ -\frac {\cos (1) \text {CosIntegral}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \text {CosIntegral}(1+\tanh (a+b x))}{2 b}-\frac {\sin (1) \text {Si}(1-\tanh (a+b x))}{2 b}+\frac {\sin (1) \text {Si}(1+\tanh (a+b x))}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 4, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {3415, 3384,
3380, 3383} \begin {gather*} -\frac {\cos (1) \text {CosIntegral}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \text {CosIntegral}(\tanh (a+b x)+1)}{2 b}-\frac {\sin (1) \text {Si}(1-\tanh (a+b x))}{2 b}+\frac {\sin (1) \text {Si}(\tanh (a+b x)+1)}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3380
Rule 3383
Rule 3384
Rule 3415
Rubi steps
\begin {align*} \int \cos (\tanh (a+b x)) \, dx &=\frac {\text {Subst}\left (\int \frac {\cos (x)}{1-x^2} \, dx,x,\tanh (a+b x)\right )}{b}\\ &=\frac {\text {Subst}\left (\int \left (\frac {\cos (x)}{2 (1-x)}+\frac {\cos (x)}{2 (1+x)}\right ) \, dx,x,\tanh (a+b x)\right )}{b}\\ &=\frac {\text {Subst}\left (\int \frac {\cos (x)}{1-x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\text {Subst}\left (\int \frac {\cos (x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}\\ &=\frac {\cos (1) \text {Subst}\left (\int \frac {\cos (1-x)}{1-x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\cos (1) \text {Subst}\left (\int \frac {\cos (1+x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\sin (1) \text {Subst}\left (\int \frac {\sin (1-x)}{1-x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\sin (1) \text {Subst}\left (\int \frac {\sin (1+x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}\\ &=-\frac {\cos (1) \text {Ci}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \text {Ci}(1+\tanh (a+b x))}{2 b}-\frac {\sin (1) \text {Si}(1-\tanh (a+b x))}{2 b}+\frac {\sin (1) \text {Si}(1+\tanh (a+b x))}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 62, normalized size = 0.81 \begin {gather*} \frac {-\cos (1) \text {CosIntegral}(1-\tanh (a+b x))+\cos (1) \text {CosIntegral}(1+\tanh (a+b x))-\sin (1) \text {Si}(1-\tanh (a+b x))+\sin (1) \text {Si}(1+\tanh (a+b x))}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.99, size = 58, normalized size = 0.75
method | result | size |
derivativedivides | \(\frac {\frac {\sinIntegral \left (-1+\tanh \left (b x +a \right )\right ) \sin \left (1\right )}{2}-\frac {\cosineIntegral \left (-1+\tanh \left (b x +a \right )\right ) \cos \left (1\right )}{2}+\frac {\sinIntegral \left (\tanh \left (b x +a \right )+1\right ) \sin \left (1\right )}{2}+\frac {\cosineIntegral \left (\tanh \left (b x +a \right )+1\right ) \cos \left (1\right )}{2}}{b}\) | \(58\) |
default | \(\frac {\frac {\sinIntegral \left (-1+\tanh \left (b x +a \right )\right ) \sin \left (1\right )}{2}-\frac {\cosineIntegral \left (-1+\tanh \left (b x +a \right )\right ) \cos \left (1\right )}{2}+\frac {\sinIntegral \left (\tanh \left (b x +a \right )+1\right ) \sin \left (1\right )}{2}+\frac {\cosineIntegral \left (\tanh \left (b x +a \right )+1\right ) \cos \left (1\right )}{2}}{b}\) | \(58\) |
risch | \(\frac {{\mathrm e}^{-i} \expIntegral \left (1, -\frac {2 i}{{\mathrm e}^{2 b x +2 a}+1}\right )}{4 b}-\frac {{\mathrm e}^{i} \expIntegral \left (1, -\frac {2 i}{{\mathrm e}^{2 b x +2 a}+1}+2 i\right )}{4 b}+\frac {{\mathrm e}^{i} \expIntegral \left (1, \frac {2 i}{{\mathrm e}^{2 b x +2 a}+1}\right )}{4 b}-\frac {{\mathrm e}^{-i} \expIntegral \left (1, \frac {2 i}{{\mathrm e}^{2 b x +2 a}+1}-2 i\right )}{4 b}\) | \(112\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \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. 151 vs.
\(2 (67) = 134\).
time = 0.37, size = 151, normalized size = 1.96 \begin {gather*} \frac {\cos \left (1\right ) \operatorname {Ci}\left (\frac {2 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + \cos \left (1\right ) \operatorname {Ci}\left (-\frac {2 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \left (1\right ) \operatorname {Ci}\left (\frac {2}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \left (1\right ) \operatorname {Ci}\left (-\frac {2}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + 2 \, \sin \left (1\right ) \operatorname {Si}\left (\frac {2 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - 2 \, \sin \left (1\right ) \operatorname {Si}\left (\frac {2}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right )}{4 \, b} \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 \cos {\left (\tanh {\left (a + b x \right )} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \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 \cos \left (\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________