\(\int \frac {-2+6 x^2+(1-x^2) \log (x^2-2 x^4+x^6)}{-x^2+x^4} \, dx\) [1230]

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

Optimal result

Integrand size = 40, antiderivative size = 18 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=-\frac {1}{4}+\frac {\log \left (\left (-x+x^3\right )^2\right )}{x} \]

[Out]

ln((x^3-x)^2)/x-1/4

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {1607, 6857, 464, 213, 2605, 212} \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {\log \left (x^2 \left (1-x^2\right )^2\right )}{x} \]

[In]

Int[(-2 + 6*x^2 + (1 - x^2)*Log[x^2 - 2*x^4 + x^6])/(-x^2 + x^4),x]

[Out]

Log[x^2*(1 - x^2)^2]/x

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 213

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

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 2605

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[(d + e*x)^(m +
 1)*((a + b*Log[c*RFx^p])^n/(e*(m + 1))), x] - Dist[b*n*(p/(e*(m + 1))), Int[SimplifyIntegrand[(d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*(D[RFx, x]/RFx), x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.89 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {\log \left (x^2 \left (-1+x^2\right )^2\right )}{x} \]

[In]

Integrate[(-2 + 6*x^2 + (1 - x^2)*Log[x^2 - 2*x^4 + x^6])/(-x^2 + x^4),x]

[Out]

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

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00

method result size
default \(\frac {\ln \left (x^{6}-2 x^{4}+x^{2}\right )}{x}\) \(18\)
norman \(\frac {\ln \left (x^{6}-2 x^{4}+x^{2}\right )}{x}\) \(18\)
risch \(\frac {\ln \left (x^{6}-2 x^{4}+x^{2}\right )}{x}\) \(18\)
parallelrisch \(\frac {\ln \left (x^{6}-2 x^{4}+x^{2}\right )}{x}\) \(18\)
parts \(\frac {\ln \left (x^{6}-2 x^{4}+x^{2}\right )}{x}\) \(18\)

[In]

int(((-x^2+1)*ln(x^6-2*x^4+x^2)+6*x^2-2)/(x^4-x^2),x,method=_RETURNVERBOSE)

[Out]

1/x*ln(x^6-2*x^4+x^2)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.94 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {\log \left (x^{6} - 2 \, x^{4} + x^{2}\right )}{x} \]

[In]

integrate(((-x^2+1)*log(x^6-2*x^4+x^2)+6*x^2-2)/(x^4-x^2),x, algorithm="fricas")

[Out]

log(x^6 - 2*x^4 + x^2)/x

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {\log {\left (x^{6} - 2 x^{4} + x^{2} \right )}}{x} \]

[In]

integrate(((-x**2+1)*ln(x**6-2*x**4+x**2)+6*x**2-2)/(x**4-x**2),x)

[Out]

log(x**6 - 2*x**4 + x**2)/x

Maxima [B] (verification not implemented)

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

Time = 0.23 (sec) , antiderivative size = 44, normalized size of antiderivative = 2.44 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {2 \, {\left ({\left (x + 1\right )} \log \left (x + 1\right ) - {\left (x - 1\right )} \log \left (x - 1\right ) + \log \left (x\right ) + 1\right )}}{x} - \frac {2}{x} - 2 \, \log \left (x + 1\right ) + 2 \, \log \left (x - 1\right ) \]

[In]

integrate(((-x^2+1)*log(x^6-2*x^4+x^2)+6*x^2-2)/(x^4-x^2),x, algorithm="maxima")

[Out]

2*((x + 1)*log(x + 1) - (x - 1)*log(x - 1) + log(x) + 1)/x - 2/x - 2*log(x + 1) + 2*log(x - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.94 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {\log \left (x^{6} - 2 \, x^{4} + x^{2}\right )}{x} \]

[In]

integrate(((-x^2+1)*log(x^6-2*x^4+x^2)+6*x^2-2)/(x^4-x^2),x, algorithm="giac")

[Out]

log(x^6 - 2*x^4 + x^2)/x

Mupad [B] (verification not implemented)

Time = 8.30 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.89 \[ \int \frac {-2+6 x^2+\left (1-x^2\right ) \log \left (x^2-2 x^4+x^6\right )}{-x^2+x^4} \, dx=\frac {\ln \left (x^2\,{\left (x^2-1\right )}^2\right )}{x} \]

[In]

int((log(x^2 - 2*x^4 + x^6)*(x^2 - 1) - 6*x^2 + 2)/(x^2 - x^4),x)

[Out]

log(x^2*(x^2 - 1)^2)/x