Optimal. Leaf size=115 \[ -\frac{\cos (2) \text{CosIntegral}(2-2 \tanh (a+b x))}{4 b}+\frac{\cos (2) \text{CosIntegral}(2 \tanh (a+b x)+2)}{4 b}-\frac{\sin (2) \text{Si}(2-2 \tanh (a+b x))}{4 b}+\frac{\sin (2) \text{Si}(2 \tanh (a+b x)+2)}{4 b}-\frac{\log (1-\tanh (a+b x))}{4 b}+\frac{\log (\tanh (a+b x)+1)}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.249996, antiderivative size = 115, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 5, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.556, Rules used = {6725, 3312, 3303, 3299, 3302} \[ -\frac{\cos (2) \text{CosIntegral}(2-2 \tanh (a+b x))}{4 b}+\frac{\cos (2) \text{CosIntegral}(2 \tanh (a+b x)+2)}{4 b}-\frac{\sin (2) \text{Si}(2-2 \tanh (a+b x))}{4 b}+\frac{\sin (2) \text{Si}(2 \tanh (a+b x)+2)}{4 b}-\frac{\log (1-\tanh (a+b x))}{4 b}+\frac{\log (\tanh (a+b x)+1)}{4 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6725
Rule 3312
Rule 3303
Rule 3299
Rule 3302
Rubi steps
\begin{align*} \int \cos ^2(\tanh (a+b x)) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\cos ^2(x)}{1-x^2} \, dx,x,\tanh (a+b x)\right )}{b}\\ &=\frac{\operatorname{Subst}\left (\int \left (-\frac{\cos ^2(x)}{2 (-1+x)}+\frac{\cos ^2(x)}{2 (1+x)}\right ) \, dx,x,\tanh (a+b x)\right )}{b}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{\cos ^2(x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac{\operatorname{Subst}\left (\int \frac{\cos ^2(x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{1}{2 (-1+x)}+\frac{\cos (2 x)}{2 (-1+x)}\right ) \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac{\operatorname{Subst}\left (\int \left (\frac{1}{2 (1+x)}+\frac{\cos (2 x)}{2 (1+x)}\right ) \, dx,x,\tanh (a+b x)\right )}{2 b}\\ &=-\frac{\log (1-\tanh (a+b x))}{4 b}+\frac{\log (1+\tanh (a+b x))}{4 b}-\frac{\operatorname{Subst}\left (\int \frac{\cos (2 x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}+\frac{\operatorname{Subst}\left (\int \frac{\cos (2 x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}\\ &=-\frac{\log (1-\tanh (a+b x))}{4 b}+\frac{\log (1+\tanh (a+b x))}{4 b}-\frac{\cos (2) \operatorname{Subst}\left (\int \frac{\cos (2-2 x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}+\frac{\cos (2) \operatorname{Subst}\left (\int \frac{\cos (2+2 x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}-\frac{\sin (2) \operatorname{Subst}\left (\int \frac{\sin (2-2 x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}+\frac{\sin (2) \operatorname{Subst}\left (\int \frac{\sin (2+2 x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}\\ &=-\frac{\cos (2) \text{Ci}(2-2 \tanh (a+b x))}{4 b}+\frac{\cos (2) \text{Ci}(2+2 \tanh (a+b x))}{4 b}-\frac{\log (1-\tanh (a+b x))}{4 b}+\frac{\log (1+\tanh (a+b x))}{4 b}-\frac{\sin (2) \text{Si}(2-2 \tanh (a+b x))}{4 b}+\frac{\sin (2) \text{Si}(2+2 \tanh (a+b x))}{4 b}\\ \end{align*}
Mathematica [A] time = 0.158163, size = 88, normalized size = 0.77 \[ \frac{-\cos (2) \text{CosIntegral}(2-2 \tanh (a+b x))+\cos (2) \text{CosIntegral}(2 (\tanh (a+b x)+1))-\sin (2) \text{Si}(2-2 \tanh (a+b x))+\sin (2) \text{Si}(2 (\tanh (a+b x)+1))-\log (1-\tanh (a+b x))+\log (\tanh (a+b x)+1)}{4 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.022, size = 102, normalized size = 0.9 \begin{align*}{\frac{{\it Si} \left ( 2+2\,\tanh \left ( bx+a \right ) \right ) \sin \left ( 2 \right ) }{4\,b}}+{\frac{{\it Ci} \left ( 2+2\,\tanh \left ( bx+a \right ) \right ) \cos \left ( 2 \right ) }{4\,b}}+{\frac{{\it Si} \left ( -2+2\,\tanh \left ( bx+a \right ) \right ) \sin \left ( 2 \right ) }{4\,b}}-{\frac{{\it Ci} \left ( -2+2\,\tanh \left ( bx+a \right ) \right ) \cos \left ( 2 \right ) }{4\,b}}-{\frac{\ln \left ( -1+\tanh \left ( bx+a \right ) \right ) }{4\,b}}+{\frac{\ln \left ( 1+\tanh \left ( bx+a \right ) \right ) }{4\,b}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{1}{2} \, x + \frac{1}{2} \, \int \cos \left (\frac{2 \,{\left (e^{\left (2 \, b x + 2 \, a\right )} - 1\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.20169, size = 474, normalized size = 4.12 \begin{align*} \frac{4 \, b x + \cos \left (2\right ) \operatorname{Ci}\left (\frac{4 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + \cos \left (2\right ) \operatorname{Ci}\left (-\frac{4 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \left (2\right ) \operatorname{Ci}\left (\frac{4}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \left (2\right ) \operatorname{Ci}\left (-\frac{4}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + 2 \, \sin \left (2\right ) \operatorname{Si}\left (\frac{4 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - 2 \, \sin \left (2\right ) \operatorname{Si}\left (\frac{4}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right )}{8 \, b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \cos ^{2}{\left (\tanh{\left (a + b x \right )} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \cos \left (\tanh \left (b x + a\right )\right )^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]