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

Optimal. Leaf size=59 $-\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))$

[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]]

________________________________________________________________________________________

Rubi [A]  time = 0.123469, antiderivative size = 59, normalized size of antiderivative = 1., 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 veriﬁed.

[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 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]

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 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 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 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]

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.240878, size = 99, normalized size = 1.68 $-\frac{1}{4} \text{csch}^2(x) \left (2 b \left (3 a^2+b^2\right ) \cosh (x)+\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 )+3 a^2 b \log \left (\tanh \left (\frac{x}{2}\right )\right )+2 a^3 \log (\sinh (x))+2 a^3+6 a b^2-b^3 \log \left (\tanh \left (\frac{x}{2}\right )\right )\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-(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*L
og[Tanh[x/2]] + Cosh[2*x]*(-2*a^3*Log[Sinh[x]] + b*(-3*a^2 + b^2)*Log[Tanh[x/2]])))/4

________________________________________________________________________________________

Maple [A]  time = 0.02, size = 79, normalized size = 1.3 \begin{align*}{a}^{3}\ln \left ( \sinh \left ( x \right ) \right ) -{\frac{{a}^{3} \left ({\rm coth} \left (x\right ) \right ) ^{2}}{2}}-3\,{\frac{{a}^{2}b\cosh \left ( x \right ) }{ \left ( \sinh \left ( x \right ) \right ) ^{2}}}+{\frac{3\,{a}^{2}b{\rm csch} \left (x\right ){\rm coth} \left (x\right )}{2}}-3\,{a}^{2}b{\it Artanh} \left ({{\rm e}^{x}} \right ) -{\frac{3\,a{b}^{2} \left ( \cosh \left ( x \right ) \right ) ^{2}}{2\, \left ( \sinh \left ( x \right ) \right ) ^{2}}}-{\frac{{b}^{3}{\rm csch} \left (x\right ){\rm coth} \left (x\right )}{2}}+{b}^{3}{\it Artanh} \left ({{\rm e}^{x}} \right ) \end{align*}

Veriﬁcation 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*cosh(x)^2/sinh(x)^2-1/2*b^3*csch(x)*coth(x)+b^3*arctanh(exp(x))

________________________________________________________________________________________

Maxima [B]  time = 1.11341, size = 205, normalized size = 3.47 \begin{align*} -\frac{3}{2} \, a b^{2} \coth \left (x\right )^{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 )} \end{align*}

Veriﬁcation 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))

________________________________________________________________________________________

Fricas [B]  time = 2.24344, size = 1712, normalized size = 29.02 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a \coth{\left (x \right )} + b \operatorname{csch}{\left (x \right )}\right )^{3}\, dx \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Giac [B]  time = 1.2006, size = 155, normalized size = 2.63 \begin{align*} \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 )}} \end{align*}

Veriﬁcation 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)