Optimal. Leaf size=109 \[ -\frac{2 b \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^2 d (a-b)^{3/2} (a+b)^{3/2}}+\frac{b^2 \tanh (c+d x)}{a d \left (a^2-b^2\right ) (a+b \text{sech}(c+d x))}+\frac{x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.158986, antiderivative size = 109, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.417, Rules used = {3785, 3919, 3831, 2659, 208} \[ -\frac{2 b \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^2 d (a-b)^{3/2} (a+b)^{3/2}}+\frac{b^2 \tanh (c+d x)}{a d \left (a^2-b^2\right ) (a+b \text{sech}(c+d x))}+\frac{x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3785
Rule 3919
Rule 3831
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{1}{(a+b \text{sech}(c+d x))^2} \, dx &=\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}-\frac{\int \frac{-a^2+b^2+a b \text{sech}(c+d x)}{a+b \text{sech}(c+d x)} \, dx}{a \left (a^2-b^2\right )}\\ &=\frac{x}{a^2}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}-\frac{\left (b \left (2 a^2-b^2\right )\right ) \int \frac{\text{sech}(c+d x)}{a+b \text{sech}(c+d x)} \, dx}{a^2 \left (a^2-b^2\right )}\\ &=\frac{x}{a^2}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}-\frac{\left (2 a^2-b^2\right ) \int \frac{1}{1+\frac{a \cosh (c+d x)}{b}} \, dx}{a^2 \left (a^2-b^2\right )}\\ &=\frac{x}{a^2}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}+\frac{\left (2 i \left (2 a^2-b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{a}{b}+\left (1-\frac{a}{b}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (i c+i d x)\right )\right )}{a^2 \left (a^2-b^2\right ) d}\\ &=\frac{x}{a^2}-\frac{2 b \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^2 (a-b)^{3/2} (a+b)^{3/2} d}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}\\ \end{align*}
Mathematica [A] time = 0.402178, size = 203, normalized size = 1.86 \[ \frac{b \left (\left (a^2-b^2\right )^{3/2} (c+d x)+a b \sqrt{a^2-b^2} \sinh (c+d x)+\left (4 a^2 b-2 b^3\right ) \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )\right )+a \cosh (c+d x) \left (\left (a^2-b^2\right )^{3/2} (c+d x)+\left (4 a^2 b-2 b^3\right ) \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )\right )}{a^2 d (a-b) (a+b) \sqrt{a^2-b^2} (a \cosh (c+d x)+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.046, size = 221, normalized size = 2. \begin{align*}{\frac{1}{d{a}^{2}}\ln \left ( \tanh \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) }-{\frac{1}{d{a}^{2}}\ln \left ( \tanh \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) }+2\,{\frac{{b}^{2}\tanh \left ( 1/2\,dx+c/2 \right ) }{da \left ({a}^{2}-{b}^{2} \right ) \left ( \left ( \tanh \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}a- \left ( \tanh \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}b+a+b \right ) }}-4\,{\frac{b}{d \left ( a+b \right ) \left ( a-b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( 1/2\,dx+c/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{{b}^{3}}{d{a}^{2} \left ( a+b \right ) \left ( a-b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( 1/2\,dx+c/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.61205, size = 2708, normalized size = 24.84 \begin{align*} \text{result too large to display} \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 \frac{1}{\left (a + b \operatorname{sech}{\left (c + d x \right )}\right )^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12446, size = 185, normalized size = 1.7 \begin{align*} -\frac{2 \,{\left (2 \, a^{2} b - b^{3}\right )} \arctan \left (\frac{a e^{\left (d x + c\right )} + b}{\sqrt{a^{2} - b^{2}}}\right )}{{\left (a^{4} d - a^{2} b^{2} d\right )} \sqrt{a^{2} - b^{2}}} - \frac{2 \,{\left (b^{3} e^{\left (d x + c\right )} + a b^{2}\right )}}{{\left (a^{4} d - a^{2} b^{2} d\right )}{\left (a e^{\left (2 \, d x + 2 \, c\right )} + 2 \, b e^{\left (d x + c\right )} + a\right )}} + \frac{d x + c}{a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]