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

   Optimal result
   Rubi [A] (verified)
   Mathematica [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)

Optimal result

Integrand size = 13, antiderivative size = 59 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x^3} \, dx=-\frac {1}{2 x^2 \left (1+e^{2 a} x^4\right )}-\frac {3 e^{2 a} x^2}{2 \left (1+e^{2 a} x^4\right )}-e^a \arctan \left (e^a x^2\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 59, 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.385, Rules used = {5656, 473, 468, 281, 209} \[ \int \frac {\tanh ^2(a+2 \log (x))}{x^3} \, dx=-e^a \arctan \left (e^a x^2\right )-\frac {3 e^{2 a} x^2}{2 \left (e^{2 a} x^4+1\right )}-\frac {1}{2 x^2 \left (e^{2 a} x^4+1\right )} \]

[In]

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

[Out]

-1/2*1/(x^2*(1 + E^(2*a)*x^4)) - (3*E^(2*a)*x^2)/(2*(1 + E^(2*a)*x^4)) - E^a*ArcTan[E^a*x^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 281

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = GCD[m + 1, n]}, Dist[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 468

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

Rule 473

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

Rule 5656

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]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [C] (verified)

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

Time = 0.07 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.12

method result size
risch \(\frac {-\frac {3 \,{\mathrm e}^{2 a} x^{4}}{2}-\frac {1}{2}}{x^{2} \left (1+{\mathrm e}^{2 a} x^{4}\right )}+\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}\) \(66\)

[In]

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

[Out]

(-3/2*exp(2*a)*x^4-1/2)/x^2/(1+exp(2*a)*x^4)+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)

none

Time = 0.25 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.86 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x^3} \, dx=-\frac {3 \, x^{4} e^{\left (2 \, a\right )} + 2 \, {\left (x^{6} e^{\left (3 \, a\right )} + x^{2} e^{a}\right )} \arctan \left (x^{2} e^{a}\right ) + 1}{2 \, {\left (x^{6} e^{\left (2 \, a\right )} + x^{2}\right )}} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.63 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x^3} \, dx=\arctan \left (\frac {e^{\left (-a\right )}}{x^{2}}\right ) e^{a} - \frac {1}{2 \, x^{2}} - \frac {e^{\left (2 \, a\right )}}{x^{2} {\left (\frac {1}{x^{4}} + e^{\left (2 \, a\right )}\right )}} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.66 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x^3} \, dx=-\arctan \left (x^{2} e^{a}\right ) e^{a} - \frac {3 \, x^{4} e^{\left (2 \, a\right )} + 1}{2 \, {\left (x^{6} e^{\left (2 \, a\right )} + x^{2}\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 1.75 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.80 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x^3} \, dx=-\mathrm {atan}\left (x^2\,\sqrt {{\mathrm {e}}^{2\,a}}\right )\,\sqrt {{\mathrm {e}}^{2\,a}}-\frac {\frac {3\,{\mathrm {e}}^{2\,a}\,x^4}{2}+\frac {1}{2}}{{\mathrm {e}}^{2\,a}\,x^6+x^2} \]

[In]

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

[Out]

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