3.1024 \(\int \frac{(a+b \coth (x))^2 \text{csch}^2(x)}{c+d \coth (x)} \, dx\)

Optimal. Leaf size=53 \[ \frac{b \coth (x) (b c-a d)}{d^2}-\frac{(b c-a d)^2 \log (c+d \coth (x))}{d^3}-\frac{(a+b \coth (x))^2}{2 d} \]

[Out]

(b*(b*c - a*d)*Coth[x])/d^2 - (a + b*Coth[x])^2/(2*d) - ((b*c - a*d)^2*Log[c + d*Coth[x]])/d^3

________________________________________________________________________________________

Rubi [A]  time = 0.145078, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {4344, 43} \[ \frac{b \coth (x) (b c-a d)}{d^2}-\frac{(b c-a d)^2 \log (c+d \coth (x))}{d^3}-\frac{(a+b \coth (x))^2}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*Coth[x])^2*Csch[x]^2)/(c + d*Coth[x]),x]

[Out]

(b*(b*c - a*d)*Coth[x])/d^2 - (a + b*Coth[x])^2/(2*d) - ((b*c - a*d)^2*Log[c + d*Coth[x]])/d^3

Rule 4344

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFactors[Cot[c*(a + b*x)], x]}, -Dist[d
/(b*c), Subst[Int[SubstFor[1, Cot[c*(a + b*x)]/d, u, x], x], x, Cot[c*(a + b*x)]/d], x] /; FunctionOfQ[Cot[c*(
a + b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Csc] || EqQ[F, csc])

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

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

Mathematica [A]  time = 0.465753, size = 62, normalized size = 1.17 \[ \frac{2 b d \coth (x) (b c-2 a d)+2 (b c-a d)^2 (\log (\sinh (x))-\log (c \sinh (x)+d \cosh (x)))-b^2 d^2 \text{csch}^2(x)}{2 d^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*Coth[x])^2*Csch[x]^2)/(c + d*Coth[x]),x]

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.06, size = 203, normalized size = 3.8 \begin{align*} -{\frac{{b}^{2}}{8\,d} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}}-{\frac{ab}{d}\tanh \left ({\frac{x}{2}} \right ) }+{\frac{c{b}^{2}}{2\,{d}^{2}}\tanh \left ({\frac{x}{2}} \right ) }-{\frac{{a}^{2}}{d}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}d+2\,c\tanh \left ( x/2 \right ) +d \right ) }+2\,{\frac{\ln \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}d+2\,c\tanh \left ( x/2 \right ) +d \right ) cba}{{d}^{2}}}-{\frac{{c}^{2}{b}^{2}}{{d}^{3}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}d+2\,c\tanh \left ( x/2 \right ) +d \right ) }-{\frac{{b}^{2}}{8\,d} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-2}}+{\frac{{a}^{2}}{d}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }-2\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) \right ) cba}{{d}^{2}}}+{\frac{{c}^{2}{b}^{2}}{{d}^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }-{\frac{ab}{d} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}+{\frac{c{b}^{2}}{2\,{d}^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*coth(x))^2*csch(x)^2/(c+d*coth(x)),x)

[Out]

-1/8*b^2/d*tanh(1/2*x)^2-b/d*a*tanh(1/2*x)+1/2*b^2/d^2*tanh(1/2*x)*c-1/d*ln(tanh(1/2*x)^2*d+2*c*tanh(1/2*x)+d)
*a^2+2/d^2*ln(tanh(1/2*x)^2*d+2*c*tanh(1/2*x)+d)*c*b*a-1/d^3*ln(tanh(1/2*x)^2*d+2*c*tanh(1/2*x)+d)*c^2*b^2-1/8
*b^2/d/tanh(1/2*x)^2+1/d*ln(tanh(1/2*x))*a^2-2/d^2*ln(tanh(1/2*x))*c*b*a+1/d^3*ln(tanh(1/2*x))*c^2*b^2-b/d/tan
h(1/2*x)*a+1/2*b^2/d^2/tanh(1/2*x)*c

________________________________________________________________________________________

Maxima [B]  time = 1.22232, size = 239, normalized size = 4.51 \begin{align*} b^{2}{\left (\frac{2 \,{\left ({\left (c + d\right )} e^{\left (-2 \, x\right )} - c\right )}}{2 \, d^{2} e^{\left (-2 \, x\right )} - d^{2} e^{\left (-4 \, x\right )} - d^{2}} - \frac{c^{2} \log \left (-{\left (c - d\right )} e^{\left (-2 \, x\right )} + c + d\right )}{d^{3}} + \frac{c^{2} \log \left (e^{\left (-x\right )} + 1\right )}{d^{3}} + \frac{c^{2} \log \left (e^{\left (-x\right )} - 1\right )}{d^{3}}\right )} + 2 \, a b{\left (\frac{c \log \left (-{\left (c - d\right )} e^{\left (-2 \, x\right )} + c + d\right )}{d^{2}} - \frac{c \log \left (e^{\left (-x\right )} + 1\right )}{d^{2}} - \frac{c \log \left (e^{\left (-x\right )} - 1\right )}{d^{2}} + \frac{2}{d e^{\left (-2 \, x\right )} - d}\right )} - \frac{a^{2} \log \left (d \coth \left (x\right ) + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*coth(x))^2*csch(x)^2/(c+d*coth(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.30032, size = 1669, normalized size = 31.49 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*coth(x))^2*csch(x)^2/(c+d*coth(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*coth(x))**2*csch(x)**2/(c+d*coth(x)),x)

[Out]

Integral((a + b*coth(x))**2*csch(x)**2/(c + d*coth(x)), x)

________________________________________________________________________________________

Giac [B]  time = 1.15915, size = 358, normalized size = 6.75 \begin{align*} -\frac{{\left (b^{2} c^{3} - 2 \, a b c^{2} d + b^{2} c^{2} d + a^{2} c d^{2} - 2 \, a b c d^{2} + a^{2} d^{3}\right )} \log \left ({\left | c e^{\left (2 \, x\right )} + d e^{\left (2 \, x\right )} - c + d \right |}\right )}{c d^{3} + d^{4}} + \frac{{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{d^{3}} - \frac{3 \, b^{2} c^{2} e^{\left (4 \, x\right )} - 6 \, a b c d e^{\left (4 \, x\right )} + 3 \, a^{2} d^{2} e^{\left (4 \, x\right )} - 6 \, b^{2} c^{2} e^{\left (2 \, x\right )} + 12 \, a b c d e^{\left (2 \, x\right )} - 4 \, b^{2} c d e^{\left (2 \, x\right )} - 6 \, a^{2} d^{2} e^{\left (2 \, x\right )} + 8 \, a b d^{2} e^{\left (2 \, x\right )} + 4 \, b^{2} d^{2} e^{\left (2 \, x\right )} + 3 \, b^{2} c^{2} - 6 \, a b c d + 4 \, b^{2} c d + 3 \, a^{2} d^{2} - 8 \, a b d^{2}}{2 \, d^{3}{\left (e^{\left (2 \, x\right )} - 1\right )}^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*coth(x))^2*csch(x)^2/(c+d*coth(x)),x, algorithm="giac")

[Out]

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