\(\int x \tanh (a+2 \log (x)) \, dx\) [148]

   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 = 9, antiderivative size = 23 \[ \int x \tanh (a+2 \log (x)) \, dx=\frac {x^2}{2}-e^{-a} \arctan \left (e^a x^2\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {5656, 470, 281, 209} \[ \int x \tanh (a+2 \log (x)) \, dx=\frac {x^2}{2}-e^{-a} \arctan \left (e^a x^2\right ) \]

[In]

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

[Out]

x^2/2 - ArcTan[E^a*x^2]/E^a

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 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 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 {x \left (-1+e^{2 a} x^4\right )}{1+e^{2 a} x^4} \, dx \\ & = \frac {x^2}{2}-2 \int \frac {x}{1+e^{2 a} x^4} \, dx \\ & = \frac {x^2}{2}-\text {Subst}\left (\int \frac {1}{1+e^{2 a} x^2} \, dx,x,x^2\right ) \\ & = \frac {x^2}{2}-e^{-a} \arctan \left (e^a x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.52 \[ \int x \tanh (a+2 \log (x)) \, dx=\frac {x^2}{2}-\arctan \left (x^2 (\cosh (a)+\sinh (a))\right ) \cosh (a)+\arctan \left (x^2 (\cosh (a)+\sinh (a))\right ) \sinh (a) \]

[In]

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

[Out]

x^2/2 - ArcTan[x^2*(Cosh[a] + Sinh[a])]*Cosh[a] + ArcTan[x^2*(Cosh[a] + Sinh[a])]*Sinh[a]

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.09 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.78

method result size
risch \(\frac {x^{2}}{2}+\frac {i {\mathrm e}^{-a} \ln \left ({\mathrm e}^{a} x^{2}-i\right )}{2}-\frac {i {\mathrm e}^{-a} \ln \left ({\mathrm e}^{a} x^{2}+i\right )}{2}\) \(41\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 1.69 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.09 \[ \int x \tanh (a+2 \log (x)) \, dx=\frac {x^2}{2}-\frac {\mathrm {atan}\left (x^2\,\sqrt {{\mathrm {e}}^{2\,a}}\right )}{\sqrt {{\mathrm {e}}^{2\,a}}} \]

[In]

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

[Out]

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