3.646 \(\int (a \coth (x)+b \text {csch}(x))^3 \, dx\)

Optimal. Leaf size=59 \[ a^3 \log (\sinh (x))-\frac {1}{2} b \left (3 a^2-b^2\right ) \tanh ^{-1}(\cosh (x))+\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} \text {csch}^2(x) (a \cosh (x)+b)^2 (a+b \cosh (x)) \]

[Out]

-1/2*b*(3*a^2-b^2)*arctanh(cosh(x))+1/2*a^2*b*cosh(x)-1/2*(b+a*cosh(x))^2*(a+b*cosh(x))*csch(x)^2+a^3*ln(sinh(
x))

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.636, Rules used = {4392, 2668, 739, 774, 635, 204, 260} \[ -\frac {1}{2} b \left (3 a^2-b^2\right ) \tanh ^{-1}(\cosh (x))+\frac {1}{2} a^2 b \cosh (x)+a^3 \log (\sinh (x))-\frac {1}{2} \text {csch}^2(x) (a \cosh (x)+b)^2 (a+b \cosh (x)) \]

Antiderivative was successfully verified.

[In]

Int[(a*Coth[x] + b*Csch[x])^3,x]

[Out]

-(b*(3*a^2 - b^2)*ArcTanh[Cosh[x]])/2 + (a^2*b*Cosh[x])/2 - ((b + a*Cosh[x])^2*(a + b*Cosh[x])*Csch[x]^2)/2 +
a^3*Log[Sinh[x]]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 739

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(a*e - c*d*x)*(a
 + c*x^2)^(p + 1))/(2*a*c*(p + 1)), x] + Dist[1/((p + 1)*(-2*a*c)), Int[(d + e*x)^(m - 2)*Simp[a*e^2*(m - 1) -
 c*d^2*(2*p + 3) - d*c*e*(m + 2*p + 2)*x, x]*(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^
2 + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 1] && IntQuadraticQ[a, 0, c, d, e, m, p, x]

Rule 774

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*g*x)/c, x] + Dist[1
/c, Int[(c*d*f - a*e*g + c*(e*f + d*g)*x)/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x]

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 4392

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int (a \coth (x)+b \text {csch}(x))^3 \, dx &=i \int (i b+i a \cosh (x))^3 \text {csch}^3(x) \, dx\\ &=a^3 \operatorname {Subst}\left (\int \frac {(i b+x)^3}{\left (-a^2-x^2\right )^2} \, dx,x,i a \cosh (x)\right )\\ &=-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)+\frac {1}{2} a \operatorname {Subst}\left (\int \frac {(i b+x) \left (-2 a^2+b^2+i b x\right )}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )\\ &=\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)-\frac {1}{2} a \operatorname {Subst}\left (\int \frac {i a^2 b-i b \left (-2 a^2+b^2\right )+2 a^2 x}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )\\ &=\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)-a^3 \operatorname {Subst}\left (\int \frac {x}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )-\frac {1}{2} \left (i a b \left (3 a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )\\ &=-\frac {1}{2} b \left (3 a^2-b^2\right ) \tanh ^{-1}(\cosh (x))+\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)+a^3 \log (\sinh (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.25, size = 99, normalized size = 1.68 \[ -\frac {1}{4} \text {csch}^2(x) \left (2 a^3 \log (\sinh (x))+2 a^3+2 b \left (3 a^2+b^2\right ) \cosh (x)+3 a^2 b \log \left (\tanh \left (\frac {x}{2}\right )\right )+\cosh (2 x) \left (b \left (b^2-3 a^2\right ) \log \left (\tanh \left (\frac {x}{2}\right )\right )-2 a^3 \log (\sinh (x))\right )+6 a b^2-b^3 \log \left (\tanh \left (\frac {x}{2}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Coth[x] + b*Csch[x])^3,x]

[Out]

-1/4*(Csch[x]^2*(2*a^3 + 6*a*b^2 + 2*b*(3*a^2 + b^2)*Cosh[x] + 2*a^3*Log[Sinh[x]] + 3*a^2*b*Log[Tanh[x/2]] - b
^3*Log[Tanh[x/2]] + Cosh[2*x]*(-2*a^3*Log[Sinh[x]] + b*(-3*a^2 + b^2)*Log[Tanh[x/2]])))

________________________________________________________________________________________

fricas [B]  time = 0.42, size = 674, normalized size = 11.42 \[ -\frac {2 \, a^{3} x \cosh \relax (x)^{4} + 2 \, a^{3} x \sinh \relax (x)^{4} + 2 \, a^{3} x + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)^{3} + 2 \, {\left (4 \, a^{3} x \cosh \relax (x) + 3 \, a^{2} b + b^{3}\right )} \sinh \relax (x)^{3} - 4 \, {\left (a^{3} x - a^{3} - 3 \, a b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (6 \, a^{3} x \cosh \relax (x)^{2} - 2 \, a^{3} x + 2 \, a^{3} + 6 \, a b^{2} + 3 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)\right )} \sinh \relax (x)^{2} + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \relax (x) - {\left ({\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)^{4} + 4 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \sinh \relax (x)^{4} + 2 \, a^{3} - 3 \, a^{2} b + b^{3} - 2 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)^{2} - 2 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3} - 3 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)^{2}\right )} \sinh \relax (x)^{2} + 4 \, {\left ({\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)^{3} - {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)\right )} \sinh \relax (x)\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) + 1\right ) - {\left ({\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \relax (x)^{4} + 4 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \sinh \relax (x)^{4} + 2 \, a^{3} + 3 \, a^{2} b - b^{3} - 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \relax (x)^{2} - 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3} - 3 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \relax (x)^{2}\right )} \sinh \relax (x)^{2} + 4 \, {\left ({\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \relax (x)^{3} - {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \relax (x)\right )} \sinh \relax (x)\right )} \log \left (\cosh \relax (x) + \sinh \relax (x) - 1\right ) + 2 \, {\left (4 \, a^{3} x \cosh \relax (x)^{3} + 3 \, a^{2} b + b^{3} + 3 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \relax (x)^{2} - 4 \, {\left (a^{3} x - a^{3} - 3 \, a b^{2}\right )} \cosh \relax (x)\right )} \sinh \relax (x)}{2 \, {\left (\cosh \relax (x)^{4} + 4 \, \cosh \relax (x) \sinh \relax (x)^{3} + \sinh \relax (x)^{4} + 2 \, {\left (3 \, \cosh \relax (x)^{2} - 1\right )} \sinh \relax (x)^{2} - 2 \, \cosh \relax (x)^{2} + 4 \, {\left (\cosh \relax (x)^{3} - \cosh \relax (x)\right )} \sinh \relax (x) + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*coth(x)+b*csch(x))^3,x, algorithm="fricas")

[Out]

-1/2*(2*a^3*x*cosh(x)^4 + 2*a^3*x*sinh(x)^4 + 2*a^3*x + 2*(3*a^2*b + b^3)*cosh(x)^3 + 2*(4*a^3*x*cosh(x) + 3*a
^2*b + b^3)*sinh(x)^3 - 4*(a^3*x - a^3 - 3*a*b^2)*cosh(x)^2 + 2*(6*a^3*x*cosh(x)^2 - 2*a^3*x + 2*a^3 + 6*a*b^2
 + 3*(3*a^2*b + b^3)*cosh(x))*sinh(x)^2 + 2*(3*a^2*b + b^3)*cosh(x) - ((2*a^3 - 3*a^2*b + b^3)*cosh(x)^4 + 4*(
2*a^3 - 3*a^2*b + b^3)*cosh(x)*sinh(x)^3 + (2*a^3 - 3*a^2*b + b^3)*sinh(x)^4 + 2*a^3 - 3*a^2*b + b^3 - 2*(2*a^
3 - 3*a^2*b + b^3)*cosh(x)^2 - 2*(2*a^3 - 3*a^2*b + b^3 - 3*(2*a^3 - 3*a^2*b + b^3)*cosh(x)^2)*sinh(x)^2 + 4*(
(2*a^3 - 3*a^2*b + b^3)*cosh(x)^3 - (2*a^3 - 3*a^2*b + b^3)*cosh(x))*sinh(x))*log(cosh(x) + sinh(x) + 1) - ((2
*a^3 + 3*a^2*b - b^3)*cosh(x)^4 + 4*(2*a^3 + 3*a^2*b - b^3)*cosh(x)*sinh(x)^3 + (2*a^3 + 3*a^2*b - b^3)*sinh(x
)^4 + 2*a^3 + 3*a^2*b - b^3 - 2*(2*a^3 + 3*a^2*b - b^3)*cosh(x)^2 - 2*(2*a^3 + 3*a^2*b - b^3 - 3*(2*a^3 + 3*a^
2*b - b^3)*cosh(x)^2)*sinh(x)^2 + 4*((2*a^3 + 3*a^2*b - b^3)*cosh(x)^3 - (2*a^3 + 3*a^2*b - b^3)*cosh(x))*sinh
(x))*log(cosh(x) + sinh(x) - 1) + 2*(4*a^3*x*cosh(x)^3 + 3*a^2*b + b^3 + 3*(3*a^2*b + b^3)*cosh(x)^2 - 4*(a^3*
x - a^3 - 3*a*b^2)*cosh(x))*sinh(x))/(cosh(x)^4 + 4*cosh(x)*sinh(x)^3 + sinh(x)^4 + 2*(3*cosh(x)^2 - 1)*sinh(x
)^2 - 2*cosh(x)^2 + 4*(cosh(x)^3 - cosh(x))*sinh(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.14, size = 115, normalized size = 1.95 \[ \frac {1}{4} \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \log \left (e^{\left (-x\right )} + e^{x} + 2\right ) + \frac {1}{4} \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \log \left (e^{\left (-x\right )} + e^{x} - 2\right ) - \frac {a^{3} {\left (e^{\left (-x\right )} + e^{x}\right )}^{2} + 6 \, a^{2} b {\left (e^{\left (-x\right )} + e^{x}\right )} + 2 \, b^{3} {\left (e^{\left (-x\right )} + e^{x}\right )} + 12 \, a b^{2}}{2 \, {\left ({\left (e^{\left (-x\right )} + e^{x}\right )}^{2} - 4\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*coth(x)+b*csch(x))^3,x, algorithm="giac")

[Out]

1/4*(2*a^3 - 3*a^2*b + b^3)*log(e^(-x) + e^x + 2) + 1/4*(2*a^3 + 3*a^2*b - b^3)*log(e^(-x) + e^x - 2) - 1/2*(a
^3*(e^(-x) + e^x)^2 + 6*a^2*b*(e^(-x) + e^x) + 2*b^3*(e^(-x) + e^x) + 12*a*b^2)/((e^(-x) + e^x)^2 - 4)

________________________________________________________________________________________

maple [A]  time = 0.36, size = 75, normalized size = 1.27 \[ a^{3} \ln \left (\sinh \relax (x )\right )-\frac {a^{3} \left (\coth ^{2}\relax (x )\right )}{2}-\frac {3 a^{2} b \cosh \relax (x )}{\sinh \relax (x )^{2}}+\frac {3 a^{2} b \,\mathrm {csch}\relax (x ) \coth \relax (x )}{2}-3 a^{2} b \arctanh \left ({\mathrm e}^{x}\right )-\frac {3 a \,b^{2}}{2 \sinh \relax (x )^{2}}-\frac {b^{3} \mathrm {csch}\relax (x ) \coth \relax (x )}{2}+b^{3} \arctanh \left ({\mathrm e}^{x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*coth(x)+b*csch(x))^3,x)

[Out]

a^3*ln(sinh(x))-1/2*a^3*coth(x)^2-3*a^2*b/sinh(x)^2*cosh(x)+3/2*a^2*b*csch(x)*coth(x)-3*a^2*b*arctanh(exp(x))-
3/2*a*b^2/sinh(x)^2-1/2*b^3*csch(x)*coth(x)+b^3*arctanh(exp(x))

________________________________________________________________________________________

maxima [B]  time = 0.44, size = 152, normalized size = 2.58 \[ -\frac {3}{2} \, a b^{2} \coth \relax (x)^{2} + a^{3} {\left (x + \frac {2 \, e^{\left (-2 \, x\right )}}{2 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} + \log \left (e^{\left (-x\right )} + 1\right ) + \log \left (e^{\left (-x\right )} - 1\right )\right )} + \frac {1}{2} \, b^{3} {\left (\frac {2 \, {\left (e^{\left (-x\right )} + e^{\left (-3 \, x\right )}\right )}}{2 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} + \log \left (e^{\left (-x\right )} + 1\right ) - \log \left (e^{\left (-x\right )} - 1\right )\right )} + \frac {3}{2} \, a^{2} b {\left (\frac {2 \, {\left (e^{\left (-x\right )} + e^{\left (-3 \, x\right )}\right )}}{2 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} - \log \left (e^{\left (-x\right )} + 1\right ) + \log \left (e^{\left (-x\right )} - 1\right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*coth(x)+b*csch(x))^3,x, algorithm="maxima")

[Out]

-3/2*a*b^2*coth(x)^2 + a^3*(x + 2*e^(-2*x)/(2*e^(-2*x) - e^(-4*x) - 1) + log(e^(-x) + 1) + log(e^(-x) - 1)) +
1/2*b^3*(2*(e^(-x) + e^(-3*x))/(2*e^(-2*x) - e^(-4*x) - 1) + log(e^(-x) + 1) - log(e^(-x) - 1)) + 3/2*a^2*b*(2
*(e^(-x) + e^(-3*x))/(2*e^(-2*x) - e^(-4*x) - 1) - log(e^(-x) + 1) + log(e^(-x) - 1))

________________________________________________________________________________________

mupad [B]  time = 1.54, size = 169, normalized size = 2.86 \[ \ln \left (b^3-3\,a^2\,b+b^3\,{\mathrm {e}}^x-3\,a^2\,b\,{\mathrm {e}}^x\right )\,\left (a^3-\frac {3\,a^2\,b}{2}+\frac {b^3}{2}\right )-\frac {6\,a\,b^2+2\,a^3+{\mathrm {e}}^x\,\left (3\,a^2\,b+b^3\right )}{{\mathrm {e}}^{2\,x}-1}-\frac {{\mathrm {e}}^x\,\left (6\,a^2\,b+2\,b^3\right )+6\,a\,b^2+2\,a^3}{{\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1}-a^3\,x+\ln \left (3\,a^2\,b-b^3+b^3\,{\mathrm {e}}^x-3\,a^2\,b\,{\mathrm {e}}^x\right )\,\left (a^3+\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b/sinh(x) + a*coth(x))^3,x)

[Out]

log(b^3 - 3*a^2*b + b^3*exp(x) - 3*a^2*b*exp(x))*(a^3 - (3*a^2*b)/2 + b^3/2) - (6*a*b^2 + 2*a^3 + exp(x)*(3*a^
2*b + b^3))/(exp(2*x) - 1) - (exp(x)*(6*a^2*b + 2*b^3) + 6*a*b^2 + 2*a^3)/(exp(4*x) - 2*exp(2*x) + 1) - a^3*x
+ log(3*a^2*b - b^3 + b^3*exp(x) - 3*a^2*b*exp(x))*((3*a^2*b)/2 + a^3 - b^3/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \coth {\relax (x )} + b \operatorname {csch}{\relax (x )}\right )^{3}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*coth(x)+b*csch(x))**3,x)

[Out]

Integral((a*coth(x) + b*csch(x))**3, x)

________________________________________________________________________________________