\(\int \frac {\coth (a+2 \log (x))}{x^2} \, dx\) [156]

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 41, 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.455, Rules used = {5657, 464, 304, 209, 212} \[ \int \frac {\coth (a+2 \log (x))}{x^2} \, dx=e^{a/2} \arctan \left (e^{a/2} x\right )-e^{a/2} \text {arctanh}\left (e^{a/2} x\right )+\frac {1}{x} \]

[In]

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

[Out]

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

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 304

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

Rule 464

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

Rule 5657

Int[Coth[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-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, e, m, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-1-e^{2 a} x^4}{x^2 \left (1-e^{2 a} x^4\right )} \, dx \\ & = \frac {1}{x}-\left (2 e^{2 a}\right ) \int \frac {x^2}{1-e^{2 a} x^4} \, dx \\ & = \frac {1}{x}-e^a \int \frac {1}{1-e^a x^2} \, dx+e^a \int \frac {1}{1+e^a x^2} \, dx \\ & = \frac {1}{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.20 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.51 \[ \int \frac {\coth (a+2 \log (x))}{x^2} \, dx=\frac {2+x \text {RootSum}\left [-\cosh (a)-\sinh (a)+\cosh (a) \text {$\#$1}^4-\sinh (a) \text {$\#$1}^4\&,\frac {\log (x)+\log \left (\frac {1}{x}-\text {$\#$1}\right )}{\text {$\#$1}^3}\&\right ] (\cosh (a)+\sinh (a))^2}{2 x} \]

[In]

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

[Out]

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

Maple [C] (verified)

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

Time = 0.09 (sec) , antiderivative size = 88, normalized size of antiderivative = 2.15

method result size
risch \(\frac {1}{x}+\frac {\sqrt {-{\mathrm e}^{a}}\, \ln \left (\left (-{\mathrm e}^{a}\right )^{\frac {3}{2}}-{\mathrm e}^{2 a} x \right )}{2}-\frac {\sqrt {-{\mathrm e}^{a}}\, \ln \left (-\left (-{\mathrm e}^{a}\right )^{\frac {3}{2}}-{\mathrm e}^{2 a} x \right )}{2}+\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{2}-{\mathrm e}^{a}\right )}{\sum }\textit {\_R} \ln \left (\left (-5 \textit {\_R}^{4}+4 \,{\mathrm e}^{2 a}\right ) x +\textit {\_R}^{3}\right )\right )}{2}\) \(88\)

[In]

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

[Out]

1/x+1/2*(-exp(a))^(1/2)*ln((-exp(a))^(3/2)-exp(2*a)*x)-1/2*(-exp(a))^(1/2)*ln(-(-exp(a))^(3/2)-exp(2*a)*x)+1/2
*sum(_R*ln((-5*_R^4+4*exp(2*a))*x+_R^3),_R=RootOf(_Z^2-exp(a)))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.32 \[ \int \frac {\coth (a+2 \log (x))}{x^2} \, dx=\frac {2 \, x \arctan \left (x e^{\left (\frac {1}{2} \, a\right )}\right ) e^{\left (\frac {1}{2} \, a\right )} + x 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 ) + 2}{2 \, x} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.27 \[ \int \frac {\coth (a+2 \log (x))}{x^2} \, 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 ) + \frac {1}{x} \]

[In]

integrate(coth(a+2*log(x))/x^2,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))) + 1/x

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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