Optimal. Leaf size=85 \[ \frac {\left (a^2+b^2\right ) x}{\left (a^2-b^2\right )^2}+\frac {b}{\left (a^2-b^2\right ) d (a+b \coth (c+d x))}-\frac {2 a b \log (b \cosh (c+d x)+a \sinh (c+d x))}{\left (a^2-b^2\right )^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3564, 3612,
3611} \begin {gather*} \frac {b}{d \left (a^2-b^2\right ) (a+b \coth (c+d x))}-\frac {2 a b \log (a \sinh (c+d x)+b \cosh (c+d x))}{d \left (a^2-b^2\right )^2}+\frac {x \left (a^2+b^2\right )}{\left (a^2-b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3564
Rule 3611
Rule 3612
Rubi steps
\begin {align*} \int \frac {1}{(a+b \coth (c+d x))^2} \, dx &=\frac {b}{\left (a^2-b^2\right ) d (a+b \coth (c+d x))}+\frac {\int \frac {a-b \coth (c+d x)}{a+b \coth (c+d x)} \, dx}{a^2-b^2}\\ &=\frac {\left (a^2+b^2\right ) x}{\left (a^2-b^2\right )^2}+\frac {b}{\left (a^2-b^2\right ) d (a+b \coth (c+d x))}-\frac {(2 i a b) \int \frac {-i b-i a \coth (c+d x)}{a+b \coth (c+d x)} \, dx}{\left (a^2-b^2\right )^2}\\ &=\frac {\left (a^2+b^2\right ) x}{\left (a^2-b^2\right )^2}+\frac {b}{\left (a^2-b^2\right ) d (a+b \coth (c+d x))}-\frac {2 a b \log (b \cosh (c+d x)+a \sinh (c+d x))}{\left (a^2-b^2\right )^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.08, size = 100, normalized size = 1.18 \begin {gather*} \frac {-\frac {\log (1-\tanh (c+d x))}{(a+b)^2}+\frac {\log (1+\tanh (c+d x))}{(a-b)^2}+\frac {2 b \left (-2 a^2 \log (b+a \tanh (c+d x))+\frac {-a^2 b+b^3}{b+a \tanh (c+d x)}\right )}{a \left (a^2-b^2\right )^2}}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.68, size = 93, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\coth \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{2}}+\frac {b}{\left (a -b \right ) \left (a +b \right ) \left (a +b \coth \left (d x +c \right )\right )}-\frac {2 a b \ln \left (a +b \coth \left (d x +c \right )\right )}{\left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {\ln \left (\coth \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{2}}}{d}\) | \(93\) |
default | \(\frac {\frac {\ln \left (\coth \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{2}}+\frac {b}{\left (a -b \right ) \left (a +b \right ) \left (a +b \coth \left (d x +c \right )\right )}-\frac {2 a b \ln \left (a +b \coth \left (d x +c \right )\right )}{\left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {\ln \left (\coth \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{2}}}{d}\) | \(93\) |
risch | \(\frac {x}{a^{2}+2 a b +b^{2}}+\frac {4 a b x}{a^{4}-2 a^{2} b^{2}+b^{4}}+\frac {4 a b c}{d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {2 b^{2}}{\left (a -b \right ) d \left (a^{2}+2 a b +b^{2}\right ) \left (a \,{\mathrm e}^{2 d x +2 c}+b \,{\mathrm e}^{2 d x +2 c}-a +b \right )}-\frac {2 a b \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {a -b}{a +b}\right )}{d \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}\) | \(168\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 124, normalized size = 1.46 \begin {gather*} -\frac {2 \, a b \log \left (-{\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a + b\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d} - \frac {2 \, b^{2}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4} - {\left (a^{4} - 2 \, a^{3} b + 2 \, a b^{3} - b^{4}\right )} e^{\left (-2 \, d x - 2 \, c\right )}\right )} d} + \frac {d x + c}{{\left (a^{2} + 2 \, a b + b^{2}\right )} d} \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. 426 vs.
\(2 (85) = 170\).
time = 0.41, size = 426, normalized size = 5.01 \begin {gather*} \frac {{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} d x \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} d x \sinh \left (d x + c\right )^{2} - 2 \, a b^{2} + 2 \, b^{3} - {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} d x + 2 \, {\left (a^{2} b - a b^{2} - {\left (a^{2} b + a b^{2}\right )} \cosh \left (d x + c\right )^{2} - 2 \, {\left (a^{2} b + a b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) - {\left (a^{2} b + a b^{2}\right )} \sinh \left (d x + c\right )^{2}\right )} \log \left (\frac {2 \, {\left (b \cosh \left (d x + c\right ) + a \sinh \left (d x + c\right )\right )}}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{{\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} d \sinh \left (d x + c\right )^{2} - {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} d} \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*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 130, normalized size = 1.53 \begin {gather*} -\frac {\frac {2 \, a b \log \left ({\left | a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} - a + b \right |}\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} - \frac {d x + c}{a^{2} - 2 \, a b + b^{2}} + \frac {2 \, {\left (a b^{2} - b^{3}\right )}}{{\left (a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} - a + b\right )} {\left (a + b\right )}^{2} {\left (a - b\right )}^{2}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.30, size = 104, normalized size = 1.22 \begin {gather*} \frac {x}{{\left (a-b\right )}^2}-\frac {2\,a\,b\,\ln \left (b-a+a\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+b\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}\right )}{d\,a^4-2\,d\,a^2\,b^2+d\,b^4}-\frac {2\,b^2}{d\,{\left (a+b\right )}^2\,\left (a-b\right )\,\left (b-a+{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (a+b\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________