\(\int \frac {\tanh (a+2 \log (x))}{x^3} \, dx\) [151]

Optimal result
Mathematica [A] (verified)
Rubi [A] (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)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 20 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=\frac {1}{2 x^2}+e^a \arctan \left (e^a x^2\right ) \] Output:

1/2/x^2+exp(a)*arctan(exp(a)*x^2)
 

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 40, normalized size of antiderivative = 2.00 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=\frac {1}{2 x^2}-\arctan \left (\frac {\cosh (a)-\sinh (a)}{x^2}\right ) \cosh (a)-\arctan \left (\frac {\cosh (a)-\sinh (a)}{x^2}\right ) \sinh (a) \] Input:

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

Output:

1/(2*x^2) - ArcTan[(Cosh[a] - Sinh[a])/x^2]*Cosh[a] - ArcTan[(Cosh[a] - Si 
nh[a])/x^2]*Sinh[a]
 

Rubi [A] (verified)

Time = 0.23 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {6071, 955, 807, 216}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx\)

\(\Big \downarrow \) 6071

\(\displaystyle \int \frac {e^{2 a} x^4-1}{x^3 \left (e^{2 a} x^4+1\right )}dx\)

\(\Big \downarrow \) 955

\(\displaystyle 2 e^{2 a} \int \frac {x}{e^{2 a} x^4+1}dx+\frac {1}{2 x^2}\)

\(\Big \downarrow \) 807

\(\displaystyle e^{2 a} \int \frac {1}{e^{2 a} x^4+1}dx^2+\frac {1}{2 x^2}\)

\(\Big \downarrow \) 216

\(\displaystyle e^a \arctan \left (e^a x^2\right )+\frac {1}{2 x^2}\)

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 807
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = GCD[m 
+ 1, n]}, Simp[1/k   Subst[Int[x^((m + 1)/k - 1)*(a + b*x^(n/k))^p, x], x, 
x^k], x] /; k != 1] /; FreeQ[{a, b, p}, x] && IGtQ[n, 0] && IntegerQ[m]
 

rule 955
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] + Simp[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1))   Int[(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 6071
Int[((e_.)*(x_))^(m_.)*Tanh[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), 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]
 
Maple [C] (verified)

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

Time = 0.30 (sec) , antiderivative size = 44, normalized size of antiderivative = 2.20

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=\frac {2 \, x^{2} \arctan \left (x^{2} e^{a}\right ) e^{a} + 1}{2 \, x^{2}} \] Input:

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

Output:

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

Sympy [F]

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

integrate(tanh(a+2*ln(x))/x**3,x)
 

Output:

Integral(tanh(a + 2*log(x))/x**3, x)
 

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.95 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=-\arctan \left (\frac {e^{\left (-a\right )}}{x^{2}}\right ) e^{a} + \frac {1}{2 \, x^{2}} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.80 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=\arctan \left (x^{2} e^{a}\right ) e^{a} + \frac {1}{2 \, x^{2}} \] Input:

integrate(tanh(a+2*log(x))/x^3,x, algorithm="giac")
 

Output:

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

Mupad [B] (verification not implemented)

Time = 2.03 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.20 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=\mathrm {atan}\left (x^2\,\sqrt {{\mathrm {e}}^{2\,a}}\right )\,\sqrt {{\mathrm {e}}^{2\,a}}+\frac {1}{2\,x^2} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 79, normalized size of antiderivative = 3.95 \[ \int \frac {\tanh (a+2 \log (x))}{x^3} \, dx=\frac {-2 e^{a} \mathit {atan} \left (\frac {e^{\frac {a}{2}} \sqrt {2}-2 e^{a} x}{e^{\frac {a}{2}} \sqrt {2}}\right ) x^{2}-2 e^{a} \mathit {atan} \left (\frac {e^{\frac {a}{2}} \sqrt {2}+2 e^{a} x}{e^{\frac {a}{2}} \sqrt {2}}\right ) x^{2}+1}{2 x^{2}} \] Input:

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

Output:

( - 2*e**a*atan((e**(a/2)*sqrt(2) - 2*e**a*x)/(e**(a/2)*sqrt(2)))*x**2 - 2 
*e**a*atan((e**(a/2)*sqrt(2) + 2*e**a*x)/(e**(a/2)*sqrt(2)))*x**2 + 1)/(2* 
x**2)