Integrand size = 12, antiderivative size = 69 \[ \int (a+b \coth (c+d x))^3 \, dx=a \left (a^2+3 b^2\right ) x-\frac {2 a b^2 \coth (c+d x)}{d}-\frac {b (a+b \coth (c+d x))^2}{2 d}+\frac {b \left (3 a^2+b^2\right ) \log (\sinh (c+d x))}{d} \] Output:
a*(a^2+3*b^2)*x-2*a*b^2*coth(d*x+c)/d-1/2*b*(a+b*coth(d*x+c))^2/d+b*(3*a^2 +b^2)*ln(sinh(d*x+c))/d
Time = 0.28 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.25 \[ \int (a+b \coth (c+d x))^3 \, dx=-\frac {6 a b^2 \coth (c+d x)+b^3 \coth ^2(c+d x)+(a+b)^3 \log (1-\tanh (c+d x))-2 b \left (3 a^2+b^2\right ) \log (\tanh (c+d x))-(a-b)^3 \log (1+\tanh (c+d x))}{2 d} \] Input:
Integrate[(a + b*Coth[c + d*x])^3,x]
Output:
-1/2*(6*a*b^2*Coth[c + d*x] + b^3*Coth[c + d*x]^2 + (a + b)^3*Log[1 - Tanh [c + d*x]] - 2*b*(3*a^2 + b^2)*Log[Tanh[c + d*x]] - (a - b)^3*Log[1 + Tanh [c + d*x]])/d
Result contains complex when optimal does not.
Time = 0.63 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.06, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 3963, 3042, 4008, 26, 3042, 26, 3956}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+b \coth (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a-i b \tan \left (i c+i d x+\frac {\pi }{2}\right )\right )^3dx\) |
\(\Big \downarrow \) 3963 |
\(\displaystyle \int (a+b \coth (c+d x)) \left (a^2+2 b \coth (c+d x) a+b^2\right )dx-\frac {b (a+b \coth (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {b (a+b \coth (c+d x))^2}{2 d}+\int \left (a-i b \tan \left (i c+i d x+\frac {\pi }{2}\right )\right ) \left (a^2-2 i b \tan \left (i c+i d x+\frac {\pi }{2}\right ) a+b^2\right )dx\) |
\(\Big \downarrow \) 4008 |
\(\displaystyle -i b \left (3 a^2+b^2\right ) \int i \coth (c+d x)dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \coth (c+d x)}{d}-\frac {b (a+b \coth (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle b \left (3 a^2+b^2\right ) \int \coth (c+d x)dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \coth (c+d x)}{d}-\frac {b (a+b \coth (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b \left (3 a^2+b^2\right ) \int -i \tan \left (i c+i d x+\frac {\pi }{2}\right )dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \coth (c+d x)}{d}-\frac {b (a+b \coth (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i b \left (3 a^2+b^2\right ) \int \tan \left (\frac {1}{2} (2 i c+\pi )+i d x\right )dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \coth (c+d x)}{d}-\frac {b (a+b \coth (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {b \left (3 a^2+b^2\right ) \log (-i \sinh (c+d x))}{d}+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \coth (c+d x)}{d}-\frac {b (a+b \coth (c+d x))^2}{2 d}\) |
Input:
Int[(a + b*Coth[c + d*x])^3,x]
Output:
a*(a^2 + 3*b^2)*x - (2*a*b^2*Coth[c + d*x])/d - (b*(a + b*Coth[c + d*x])^2 )/(2*d) + (b*(3*a^2 + b^2)*Log[(-I)*Sinh[c + d*x]])/d
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d *x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] && GtQ[n, 1]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), x] + Simp[(b*c + a*d) Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Time = 0.11 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.26
method | result | size |
parallelrisch | \(\frac {\left (-6 a^{2} b -2 b^{3}\right ) \ln \left (1-\tanh \left (d x +c \right )\right )+\left (6 a^{2} b +2 b^{3}\right ) \ln \left (\tanh \left (d x +c \right )\right )-b^{3} \coth \left (d x +c \right )^{2}-6 a \,b^{2} \coth \left (d x +c \right )+2 d x \left (a -b \right )^{3}}{2 d}\) | \(87\) |
derivativedivides | \(\frac {-\frac {b^{3} \coth \left (d x +c \right )^{2}}{2}-3 a \,b^{2} \coth \left (d x +c \right )-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\coth \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \ln \left (\coth \left (d x +c \right )+1\right )}{2}}{d}\) | \(93\) |
default | \(\frac {-\frac {b^{3} \coth \left (d x +c \right )^{2}}{2}-3 a \,b^{2} \coth \left (d x +c \right )-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\coth \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \ln \left (\coth \left (d x +c \right )+1\right )}{2}}{d}\) | \(93\) |
parts | \(a^{3} x +\frac {b^{3} \left (-\frac {\coth \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\coth \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\coth \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {3 a^{2} b \ln \left (\sinh \left (d x +c \right )\right )}{d}+\frac {3 a \,b^{2} \left (-\coth \left (d x +c \right )-\frac {\ln \left (\coth \left (d x +c \right )-1\right )}{2}+\frac {\ln \left (\coth \left (d x +c \right )+1\right )}{2}\right )}{d}\) | \(103\) |
risch | \(a^{3} x -3 b \,a^{2} x +3 a \,b^{2} x -b^{3} x -\frac {6 b c \,a^{2}}{d}-\frac {2 b^{3} c}{d}-\frac {2 b^{2} \left (3 a \,{\mathrm e}^{2 d x +2 c}+b \,{\mathrm e}^{2 d x +2 c}-3 a \right )}{d \left ({\mathrm e}^{2 d x +2 c}-1\right )^{2}}+\frac {3 b \ln \left ({\mathrm e}^{2 d x +2 c}-1\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d}\) | \(134\) |
Input:
int((a+b*coth(d*x+c))^3,x,method=_RETURNVERBOSE)
Output:
1/2*((-6*a^2*b-2*b^3)*ln(1-tanh(d*x+c))+(6*a^2*b+2*b^3)*ln(tanh(d*x+c))-b^ 3*coth(d*x+c)^2-6*a*b^2*coth(d*x+c)+2*d*x*(a-b)^3)/d
Leaf count of result is larger than twice the leaf count of optimal. 654 vs. \(2 (67) = 134\).
Time = 0.10 (sec) , antiderivative size = 654, normalized size of antiderivative = 9.48 \[ \int (a+b \coth (c+d x))^3 \, dx =\text {Too large to display} \] Input:
integrate((a+b*coth(d*x+c))^3,x, algorithm="fricas")
Output:
((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)^4 + 4*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)*sinh(d*x + c)^3 + (a^3 - 3*a^2*b + 3*a*b^ 2 - b^3)*d*x*sinh(d*x + c)^4 + 6*a*b^2 + (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d *x - 2*(3*a*b^2 + b^3 + (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*cosh(d*x + c) ^2 + 2*(3*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)^2 - 3*a*b^2 - b^3 - (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*sinh(d*x + c)^2 + ((3*a^2*b + b ^3)*cosh(d*x + c)^4 + 4*(3*a^2*b + b^3)*cosh(d*x + c)*sinh(d*x + c)^3 + (3 *a^2*b + b^3)*sinh(d*x + c)^4 + 3*a^2*b + b^3 - 2*(3*a^2*b + b^3)*cosh(d*x + c)^2 - 2*(3*a^2*b + b^3 - 3*(3*a^2*b + b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^2 + 4*((3*a^2*b + b^3)*cosh(d*x + c)^3 - (3*a^2*b + b^3)*cosh(d*x + c) )*sinh(d*x + c))*log(2*sinh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 4* ((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)^3 - (3*a*b^2 + b^3 + (a ^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*cosh(d*x + c))*sinh(d*x + c))/(d*cosh(d *x + c)^4 + 4*d*cosh(d*x + c)*sinh(d*x + c)^3 + d*sinh(d*x + c)^4 - 2*d*co sh(d*x + c)^2 + 2*(3*d*cosh(d*x + c)^2 - d)*sinh(d*x + c)^2 + 4*(d*cosh(d* x + c)^3 - d*cosh(d*x + c))*sinh(d*x + c) + d)
Leaf count of result is larger than twice the leaf count of optimal. 291 vs. \(2 (63) = 126\).
Time = 0.78 (sec) , antiderivative size = 291, normalized size of antiderivative = 4.22 \[ \int (a+b \coth (c+d x))^3 \, dx=\begin {cases} x \left (a + b \coth {\left (c \right )}\right )^{3} & \text {for}\: d = 0 \\a^{3} x + 3 a^{2} b x \coth {\left (d x + \log {\left (- e^{- d x} \right )} \right )} + 3 a b^{2} x \coth ^{2}{\left (d x + \log {\left (- e^{- d x} \right )} \right )} + b^{3} x \coth ^{3}{\left (d x + \log {\left (- e^{- d x} \right )} \right )} & \text {for}\: c = \log {\left (- e^{- d x} \right )} \\a^{3} x + 3 a^{2} b x \coth {\left (d x + \log {\left (e^{- d x} \right )} \right )} + 3 a b^{2} x \coth ^{2}{\left (d x + \log {\left (e^{- d x} \right )} \right )} + b^{3} x \coth ^{3}{\left (d x + \log {\left (e^{- d x} \right )} \right )} & \text {for}\: c = \log {\left (e^{- d x} \right )} \\a^{3} x + 3 a^{2} b x - \frac {3 a^{2} b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + \frac {3 a^{2} b \log {\left (\tanh {\left (c + d x \right )} \right )}}{d} + 3 a b^{2} x - \frac {3 a b^{2}}{d \tanh {\left (c + d x \right )}} + b^{3} x - \frac {b^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + \frac {b^{3} \log {\left (\tanh {\left (c + d x \right )} \right )}}{d} - \frac {b^{3}}{2 d \tanh ^{2}{\left (c + d x \right )}} & \text {otherwise} \end {cases} \] Input:
integrate((a+b*coth(d*x+c))**3,x)
Output:
Piecewise((x*(a + b*coth(c))**3, Eq(d, 0)), (a**3*x + 3*a**2*b*x*coth(d*x + log(-exp(-d*x))) + 3*a*b**2*x*coth(d*x + log(-exp(-d*x)))**2 + b**3*x*co th(d*x + log(-exp(-d*x)))**3, Eq(c, log(-exp(-d*x)))), (a**3*x + 3*a**2*b* x*coth(d*x + log(exp(-d*x))) + 3*a*b**2*x*coth(d*x + log(exp(-d*x)))**2 + b**3*x*coth(d*x + log(exp(-d*x)))**3, Eq(c, log(exp(-d*x)))), (a**3*x + 3* a**2*b*x - 3*a**2*b*log(tanh(c + d*x) + 1)/d + 3*a**2*b*log(tanh(c + d*x)) /d + 3*a*b**2*x - 3*a*b**2/(d*tanh(c + d*x)) + b**3*x - b**3*log(tanh(c + d*x) + 1)/d + b**3*log(tanh(c + d*x))/d - b**3/(2*d*tanh(c + d*x)**2), Tru e))
Leaf count of result is larger than twice the leaf count of optimal. 136 vs. \(2 (67) = 134\).
Time = 0.14 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.97 \[ \int (a+b \coth (c+d x))^3 \, dx=b^{3} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-d x - c\right )} + 1\right )}{d} + \frac {\log \left (e^{\left (-d x - c\right )} - 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} - e^{\left (-4 \, d x - 4 \, c\right )} - 1\right )}}\right )} + 3 \, a b^{2} {\left (x + \frac {c}{d} + \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} - 1\right )}}\right )} + a^{3} x + \frac {3 \, a^{2} b \log \left (\sinh \left (d x + c\right )\right )}{d} \] Input:
integrate((a+b*coth(d*x+c))^3,x, algorithm="maxima")
Output:
b^3*(x + c/d + log(e^(-d*x - c) + 1)/d + log(e^(-d*x - c) - 1)/d + 2*e^(-2 *d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) - e^(-4*d*x - 4*c) - 1))) + 3*a*b^2*(x + c/d + 2/(d*(e^(-2*d*x - 2*c) - 1))) + a^3*x + 3*a^2*b*log(sinh(d*x + c)) /d
Time = 0.12 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.43 \[ \int (a+b \coth (c+d x))^3 \, dx=\frac {{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (d x + c\right )} + {\left (3 \, a^{2} b + b^{3}\right )} \log \left ({\left | e^{\left (2 \, d x + 2 \, c\right )} - 1 \right |}\right ) + \frac {2 \, {\left (3 \, a b^{2} - {\left (3 \, a b^{2} + b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}^{2}}}{d} \] Input:
integrate((a+b*coth(d*x+c))^3,x, algorithm="giac")
Output:
((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*(d*x + c) + (3*a^2*b + b^3)*log(abs(e^(2* d*x + 2*c) - 1)) + 2*(3*a*b^2 - (3*a*b^2 + b^3)*e^(2*d*x + 2*c))/(e^(2*d*x + 2*c) - 1)^2)/d
Time = 0.12 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.41 \[ \int (a+b \coth (c+d x))^3 \, dx=x\,{\left (a-b\right )}^3-\frac {2\,\left (b^3+3\,a\,b^2\right )}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )}-\frac {2\,b^3}{d\,\left ({\mathrm {e}}^{4\,c+4\,d\,x}-2\,{\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}+\frac {\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}-1\right )\,\left (3\,a^2\,b+b^3\right )}{d} \] Input:
int((a + b*coth(c + d*x))^3,x)
Output:
x*(a - b)^3 - (2*(3*a*b^2 + b^3))/(d*(exp(2*c + 2*d*x) - 1)) - (2*b^3)/(d* (exp(4*c + 4*d*x) - 2*exp(2*c + 2*d*x) + 1)) + (log(exp(2*c)*exp(2*d*x) - 1)*(3*a^2*b + b^3))/d
Time = 0.21 (sec) , antiderivative size = 503, normalized size of antiderivative = 7.29 \[ \int (a+b \coth (c+d x))^3 \, dx=\frac {3 \,\mathrm {log}\left (e^{d x +c}-1\right ) a^{2} b +3 \,\mathrm {log}\left (e^{d x +c}+1\right ) a^{2} b -3 e^{4 d x +4 c} a \,b^{2}-b^{3}+3 a \,b^{2}-e^{4 d x +4 c} b^{3}+e^{4 d x +4 c} \mathrm {log}\left (e^{d x +c}-1\right ) b^{3}+e^{4 d x +4 c} \mathrm {log}\left (e^{d x +c}+1\right ) b^{3}-2 e^{2 d x +2 c} \mathrm {log}\left (e^{d x +c}-1\right ) b^{3}-2 e^{2 d x +2 c} \mathrm {log}\left (e^{d x +c}+1\right ) b^{3}-3 e^{4 d x +4 c} a^{2} b d x +3 e^{4 d x +4 c} a \,b^{2} d x +6 e^{2 d x +2 c} a^{2} b d x -6 e^{2 d x +2 c} a \,b^{2} d x +3 e^{4 d x +4 c} \mathrm {log}\left (e^{d x +c}-1\right ) a^{2} b +3 e^{4 d x +4 c} \mathrm {log}\left (e^{d x +c}+1\right ) a^{2} b -6 e^{2 d x +2 c} \mathrm {log}\left (e^{d x +c}-1\right ) a^{2} b -6 e^{2 d x +2 c} \mathrm {log}\left (e^{d x +c}+1\right ) a^{2} b +e^{4 d x +4 c} a^{3} d x -e^{4 d x +4 c} b^{3} d x +a^{3} d x -b^{3} d x -2 e^{2 d x +2 c} a^{3} d x +2 e^{2 d x +2 c} b^{3} d x -3 a^{2} b d x +3 a \,b^{2} d x +\mathrm {log}\left (e^{d x +c}-1\right ) b^{3}+\mathrm {log}\left (e^{d x +c}+1\right ) b^{3}}{d \left (e^{4 d x +4 c}-2 e^{2 d x +2 c}+1\right )} \] Input:
int((a+b*coth(d*x+c))^3,x)
Output:
(3*e**(4*c + 4*d*x)*log(e**(c + d*x) - 1)*a**2*b + e**(4*c + 4*d*x)*log(e* *(c + d*x) - 1)*b**3 + 3*e**(4*c + 4*d*x)*log(e**(c + d*x) + 1)*a**2*b + e **(4*c + 4*d*x)*log(e**(c + d*x) + 1)*b**3 + e**(4*c + 4*d*x)*a**3*d*x - 3 *e**(4*c + 4*d*x)*a**2*b*d*x + 3*e**(4*c + 4*d*x)*a*b**2*d*x - 3*e**(4*c + 4*d*x)*a*b**2 - e**(4*c + 4*d*x)*b**3*d*x - e**(4*c + 4*d*x)*b**3 - 6*e** (2*c + 2*d*x)*log(e**(c + d*x) - 1)*a**2*b - 2*e**(2*c + 2*d*x)*log(e**(c + d*x) - 1)*b**3 - 6*e**(2*c + 2*d*x)*log(e**(c + d*x) + 1)*a**2*b - 2*e** (2*c + 2*d*x)*log(e**(c + d*x) + 1)*b**3 - 2*e**(2*c + 2*d*x)*a**3*d*x + 6 *e**(2*c + 2*d*x)*a**2*b*d*x - 6*e**(2*c + 2*d*x)*a*b**2*d*x + 2*e**(2*c + 2*d*x)*b**3*d*x + 3*log(e**(c + d*x) - 1)*a**2*b + log(e**(c + d*x) - 1)* b**3 + 3*log(e**(c + d*x) + 1)*a**2*b + log(e**(c + d*x) + 1)*b**3 + a**3* d*x - 3*a**2*b*d*x + 3*a*b**2*d*x + 3*a*b**2 - b**3*d*x - b**3)/(d*(e**(4* c + 4*d*x) - 2*e**(2*c + 2*d*x) + 1))