\(\int \coth (a+2 \log (x)) \, dx\) [154]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 7, antiderivative size = 40 \[ \int \coth (a+2 \log (x)) \, dx=x-e^{-a/2} \arctan \left (e^{a/2} x\right )-e^{-a/2} \text {arctanh}\left (e^{a/2} x\right ) \]

[Out]

x-arctan(exp(1/2*a)*x)/exp(1/2*a)-arctanh(exp(1/2*a)*x)/exp(1/2*a)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.714, Rules used = {5653, 396, 218, 212, 209} \[ \int \coth (a+2 \log (x)) \, dx=-e^{-a/2} \arctan \left (e^{a/2} x\right )-e^{-a/2} \text {arctanh}\left (e^{a/2} x\right )+x \]

[In]

Int[Coth[a + 2*Log[x]],x]

[Out]

x - ArcTan[E^(a/2)*x]/E^(a/2) - ArcTanh[E^(a/2)*x]/E^(a/2)

Rule 209

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

Rule 212

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

Rule 218

Int[((a_) + (b_.)*(x_)^4)^(-1), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]},
Dist[r/(2*a), Int[1/(r - s*x^2), x], x] + Dist[r/(2*a), Int[1/(r + s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !Gt
Q[a/b, 0]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 5653

Int[Coth[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Int[(-1 - E^(2*a*d)*x^(2*b*d))^p/(1 - E^(2*a*d)*x^
(2*b*d))^p, x] /; FreeQ[{a, b, d, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-1-e^{2 a} x^4}{1-e^{2 a} x^4} \, dx \\ & = x-2 \int \frac {1}{1-e^{2 a} x^4} \, dx \\ & = x-\int \frac {1}{1-e^a x^2} \, dx-\int \frac {1}{1+e^a x^2} \, dx \\ & = x-e^{-a/2} \arctan \left (e^{a/2} x\right )-e^{-a/2} \text {arctanh}\left (e^{a/2} x\right ) \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 0.21 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.45 \[ \int \coth (a+2 \log (x)) \, dx=x+\frac {1}{2} \text {RootSum}\left [-\cosh (a)+\sinh (a)+\cosh (a) \text {$\#$1}^4+\sinh (a) \text {$\#$1}^4\&,\frac {\log (x)-\log (x-\text {$\#$1})}{\text {$\#$1}^3}\&\right ] (-\cosh (2 a)+\sinh (2 a)) \]

[In]

Integrate[Coth[a + 2*Log[x]],x]

[Out]

x + (RootSum[-Cosh[a] + Sinh[a] + Cosh[a]*#1^4 + Sinh[a]*#1^4 & , (Log[x] - Log[x - #1])/#1^3 & ]*(-Cosh[2*a]
+ Sinh[2*a]))/2

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(70\) vs. \(2(32)=64\).

Time = 0.08 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.78

method result size
risch \(x -\frac {\ln \left (x \sqrt {-{\mathrm e}^{a}}+1\right )}{2 \sqrt {-{\mathrm e}^{a}}}+\frac {\ln \left (x \sqrt {-{\mathrm e}^{a}}-1\right )}{2 \sqrt {-{\mathrm e}^{a}}}+\frac {\ln \left (\sqrt {{\mathrm e}^{a}}\, x -1\right )}{2 \sqrt {{\mathrm e}^{a}}}-\frac {\ln \left (\sqrt {{\mathrm e}^{a}}\, x +1\right )}{2 \sqrt {{\mathrm e}^{a}}}\) \(71\)

[In]

int(coth(a+2*ln(x)),x,method=_RETURNVERBOSE)

[Out]

x-1/2/(-exp(a))^(1/2)*ln(x*(-exp(a))^(1/2)+1)+1/2/(-exp(a))^(1/2)*ln(x*(-exp(a))^(1/2)-1)+1/2/exp(a)^(1/2)*ln(
exp(a)^(1/2)*x-1)-1/2/exp(a)^(1/2)*ln(exp(a)^(1/2)*x+1)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (28) = 56\).

Time = 0.24 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.45 \[ \int \coth (a+2 \log (x)) \, dx=-\frac {1}{2} \, {\left (2 \, \arctan \left (x e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} - 2 \, x e^{a} - e^{\left (\frac {1}{2} \, a\right )} \log \left (\frac {x^{2} e^{a} - 2 \, x e^{\left (\frac {1}{2} \, a\right )} + 1}{x^{2} e^{a} - 1}\right )\right )} e^{\left (-a\right )} \]

[In]

integrate(coth(a+2*log(x)),x, algorithm="fricas")

[Out]

-1/2*(2*arctan(x*e^(1/2*a))*e^(1/2*a) - 2*x*e^a - e^(1/2*a)*log((x^2*e^a - 2*x*e^(1/2*a) + 1)/(x^2*e^a - 1)))*
e^(-a)

Sympy [F]

\[ \int \coth (a+2 \log (x)) \, dx=\int \coth {\left (a + 2 \log {\left (x \right )} \right )}\, dx \]

[In]

integrate(coth(a+2*ln(x)),x)

[Out]

Integral(coth(a + 2*log(x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.12 \[ \int \coth (a+2 \log (x)) \, dx=-\arctan \left (x e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (-\frac {1}{2} \, a\right )} + \frac {1}{2} \, e^{\left (-\frac {1}{2} \, a\right )} \log \left (\frac {x e^{a} - e^{\left (\frac {1}{2} \, a\right )}}{x e^{a} + e^{\left (\frac {1}{2} \, a\right )}}\right ) + x \]

[In]

integrate(coth(a+2*log(x)),x, algorithm="maxima")

[Out]

-arctan(x*e^(1/2*a))*e^(-1/2*a) + 1/2*e^(-1/2*a)*log((x*e^a - e^(1/2*a))/(x*e^a + e^(1/2*a))) + x

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.28 \[ \int \coth (a+2 \log (x)) \, dx=-\arctan \left (x e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (-\frac {1}{2} \, a\right )} + \frac {1}{2} \, e^{\left (-\frac {1}{2} \, a\right )} \log \left (\frac {{\left | 2 \, x e^{a} - 2 \, e^{\left (\frac {1}{2} \, a\right )} \right |}}{{\left | 2 \, x e^{a} + 2 \, e^{\left (\frac {1}{2} \, a\right )} \right |}}\right ) + x \]

[In]

integrate(coth(a+2*log(x)),x, algorithm="giac")

[Out]

-arctan(x*e^(1/2*a))*e^(-1/2*a) + 1/2*e^(-1/2*a)*log(abs(2*x*e^a - 2*e^(1/2*a))/abs(2*x*e^a + 2*e^(1/2*a))) +
x

Mupad [B] (verification not implemented)

Time = 1.93 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.90 \[ \int \coth (a+2 \log (x)) \, dx=x-\frac {\mathrm {atan}\left (x\,{\left ({\mathrm {e}}^{2\,a}\right )}^{1/4}\right )}{{\left ({\mathrm {e}}^{2\,a}\right )}^{1/4}}-\frac {\mathrm {atanh}\left (x\,{\left ({\mathrm {e}}^{2\,a}\right )}^{1/4}\right )}{{\left ({\mathrm {e}}^{2\,a}\right )}^{1/4}} \]

[In]

int(coth(a + 2*log(x)),x)

[Out]

x - atan(x*exp(2*a)^(1/4))/exp(2*a)^(1/4) - atanh(x*exp(2*a)^(1/4))/exp(2*a)^(1/4)