Optimal. Leaf size=85 \[ \frac {\left (a^2+b^2\right ) x}{\left (a^2-b^2\right )^2}-\frac {2 a b \log (a \cosh (c+d x)+b \sinh (c+d x))}{\left (a^2-b^2\right )^2 d}+\frac {b}{\left (a^2-b^2\right ) d (a+b \tanh (c+d x))} \]
[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 \tanh (c+d x))}-\frac {2 a b \log (a \cosh (c+d x)+b \sinh (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 \tanh (c+d x))^2} \, dx &=\frac {b}{\left (a^2-b^2\right ) d (a+b \tanh (c+d x))}+\frac {\int \frac {a-b \tanh (c+d x)}{a+b \tanh (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 \tanh (c+d x))}-\frac {(2 i a b) \int \frac {-i b-i a \tanh (c+d x)}{a+b \tanh (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 {2 a b \log (a \cosh (c+d x)+b \sinh (c+d x))}{\left (a^2-b^2\right )^2 d}+\frac {b}{\left (a^2-b^2\right ) d (a+b \tanh (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.83, size = 94, normalized size = 1.11 \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 \log (a+b \tanh (c+d x))+\frac {a^2-b^2}{a+b \tanh (c+d x)}\right )}{\left (a^2-b^2\right )^2}}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.76, size = 93, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{2}}-\frac {\ln \left (\tanh \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 \tanh \left (d x +c \right )\right )}-\frac {2 a b \ln \left (a +b \tanh \left (d x +c \right )\right )}{\left (a +b \right )^{2} \left (a -b \right )^{2}}}{d}\) | \(93\) |
default | \(\frac {\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{2}}-\frac {\ln \left (\tanh \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 \tanh \left (d x +c \right )\right )}-\frac {2 a b \ln \left (a +b \tanh \left (d x +c \right )\right )}{\left (a +b \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 )}\) | \(167\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 127, normalized size = 1.49 \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. 422 vs.
\(2 (85) = 170\).
time = 0.61, size = 422, normalized size = 4.96 \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 (a \cosh \left (d x + c\right ) + b \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 [B] Leaf count of result is larger than twice the leaf count of optimal. 3597 vs.
\(2 (70) = 140\).
time = 14.10, size = 3597, normalized size = 42.32 \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.43, size = 132, normalized size = 1.55 \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.43, size = 127, normalized size = 1.49 \begin {gather*} \frac {\frac {a\,x}{{\left (a+b\right )}^2}+\frac {b\,x\,\mathrm {tanh}\left (c+d\,x\right )}{{\left (a+b\right )}^2}-\frac {b^2\,\mathrm {tanh}\left (c+d\,x\right )}{a\,d\,\left (a^2-b^2\right )}}{a+b\,\mathrm {tanh}\left (c+d\,x\right )}-\frac {2\,a\,b\,\ln \left (a+b\,\mathrm {tanh}\left (c+d\,x\right )\right )}{d\,\left (a^4-2\,a^2\,b^2+b^4\right )}+\frac {2\,a\,b\,\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )}{d\,{\left (a^2-b^2\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________