\(\int \frac {1+x^2}{x+2 x^2+x^3} \, dx\) [374]

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

Optimal result

Integrand size = 18, antiderivative size = 10 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\frac {2}{1+x}+\log (x) \]

[Out]

2/(1+x)+ln(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1608, 27, 908} \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\frac {2}{x+1}+\log (x) \]

[In]

Int[(1 + x^2)/(x + 2*x^2 + x^3),x]

[Out]

2/(1 + x) + Log[x]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 1608

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

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\frac {2}{1+x}+\log (x) \]

[In]

Integrate[(1 + x^2)/(x + 2*x^2 + x^3),x]

[Out]

2/(1 + x) + Log[x]

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.10

method result size
default \(\frac {2}{x +1}+\ln \left (x \right )\) \(11\)
norman \(\frac {2}{x +1}+\ln \left (x \right )\) \(11\)
risch \(\frac {2}{x +1}+\ln \left (x \right )\) \(11\)
parallelrisch \(\frac {\ln \left (x \right ) x +2+\ln \left (x \right )}{x +1}\) \(15\)

[In]

int((x^2+1)/(x^3+2*x^2+x),x,method=_RETURNVERBOSE)

[Out]

2/(x+1)+ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.40 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\frac {{\left (x + 1\right )} \log \left (x\right ) + 2}{x + 1} \]

[In]

integrate((x^2+1)/(x^3+2*x^2+x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.70 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\log {\left (x \right )} + \frac {2}{x + 1} \]

[In]

integrate((x**2+1)/(x**3+2*x**2+x),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\frac {2}{x + 1} + \log \left (x\right ) \]

[In]

integrate((x^2+1)/(x^3+2*x^2+x),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.10 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\frac {2}{x + 1} + \log \left ({\left | x \right |}\right ) \]

[In]

integrate((x^2+1)/(x^3+2*x^2+x),x, algorithm="giac")

[Out]

2/(x + 1) + log(abs(x))

Mupad [B] (verification not implemented)

Time = 9.40 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1+x^2}{x+2 x^2+x^3} \, dx=\ln \left (x\right )+\frac {2}{x+1} \]

[In]

int((x^2 + 1)/(x + 2*x^2 + x^3),x)

[Out]

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