Optimal. Leaf size=67 \[ -\frac{2 b \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a^2 \sqrt{a-b} \sqrt{a+b}}+\frac{x}{a^2}-\frac{\sinh (x)}{a (a \cosh (x)+b)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.131912, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {4392, 2693, 2735, 2659, 205} \[ -\frac{2 b \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a^2 \sqrt{a-b} \sqrt{a+b}}+\frac{x}{a^2}-\frac{\sinh (x)}{a (a \cosh (x)+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4392
Rule 2693
Rule 2735
Rule 2659
Rule 205
Rubi steps
\begin{align*} \int \frac{1}{(a \coth (x)+b \text{csch}(x))^2} \, dx &=-\int \frac{\sinh ^2(x)}{(i b+i a \cosh (x))^2} \, dx\\ &=-\frac{\sinh (x)}{a (b+a \cosh (x))}+\frac{i \int \frac{\cosh (x)}{i b+i a \cosh (x)} \, dx}{a}\\ &=\frac{x}{a^2}-\frac{\sinh (x)}{a (b+a \cosh (x))}-\frac{(i b) \int \frac{1}{i b+i a \cosh (x)} \, dx}{a^2}\\ &=\frac{x}{a^2}-\frac{\sinh (x)}{a (b+a \cosh (x))}-\frac{(2 i b) \operatorname{Subst}\left (\int \frac{1}{i a+i b-(-i a+i b) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{a^2}\\ &=\frac{x}{a^2}-\frac{2 b \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a^2 \sqrt{a-b} \sqrt{a+b}}-\frac{\sinh (x)}{a (b+a \cosh (x))}\\ \end{align*}
Mathematica [A] time = 0.333363, size = 61, normalized size = 0.91 \[ \frac{\frac{2 b \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-\frac{a \sinh (x)}{a \cosh (x)+b}+x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.05, size = 95, normalized size = 1.4 \begin{align*}{\frac{1}{{a}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-2\,{\frac{\tanh \left ( x/2 \right ) }{a \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}- \left ( \tanh \left ( x/2 \right ) \right ) ^{2}b+a+b \right ) }}-2\,{\frac{b}{{a}^{2}\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }-{\frac{1}{{a}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \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.19164, size = 1647, normalized size = 24.58 \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 \coth{\left (x \right )} + b \operatorname{csch}{\left (x \right )}\right )^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.17056, size = 92, normalized size = 1.37 \begin{align*} -\frac{2 \, b \arctan \left (\frac{a e^{x} + b}{\sqrt{a^{2} - b^{2}}}\right )}{\sqrt{a^{2} - b^{2}} a^{2}} + \frac{x}{a^{2}} + \frac{2 \,{\left (b e^{x} + a\right )}}{{\left (a e^{\left (2 \, x\right )} + 2 \, b e^{x} + a\right )} a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]