3.71.15 \(\int \frac {1-2 x+2 x^2+x^4}{1+2 x^2+x^4} \, dx\)

Optimal. Leaf size=23 \[ -3+x+\frac {1}{1+x^2}-\log ^2(i \pi +\log (2)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 9, normalized size of antiderivative = 0.39, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {28, 1814, 21, 8} \begin {gather*} \frac {1}{x^2+1}+x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x + (1 + x^2)^(-1)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 28

Int[(u_.)*((a_) + (c_.)*(x_)^(n2_.) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Dist[1/c^p, Int[u*(b/2 + c*x^n)^(2*
p), x], x] /; FreeQ[{a, b, c, n}, x] && EqQ[n2, 2*n] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 1814

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[((a
*g - b*f*x)*(a + b*x^2)^(p + 1))/(2*a*b*(p + 1)), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {1-2 x+2 x^2+x^4}{\left (1+x^2\right )^2} \, dx\\ &=\frac {1}{1+x^2}-\frac {1}{2} \int \frac {-2-2 x^2}{1+x^2} \, dx\\ &=\frac {1}{1+x^2}+\int 1 \, dx\\ &=x+\frac {1}{1+x^2}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 9, normalized size = 0.39 \begin {gather*} x+\frac {1}{1+x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x + (1 + x^2)^(-1)

________________________________________________________________________________________

fricas [A]  time = 0.53, size = 14, normalized size = 0.61 \begin {gather*} \frac {x^{3} + x + 1}{x^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x^3 + x + 1)/(x^2 + 1)

________________________________________________________________________________________

giac [A]  time = 0.32, size = 9, normalized size = 0.39 \begin {gather*} x + \frac {1}{x^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 1/(x^2 + 1)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 10, normalized size = 0.43




method result size



default \(x +\frac {1}{x^{2}+1}\) \(10\)
risch \(x +\frac {1}{x^{2}+1}\) \(10\)
gosper \(\frac {x^{3}+x +1}{x^{2}+1}\) \(15\)
norman \(\frac {x^{3}+x +1}{x^{2}+1}\) \(15\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x+1/(x^2+1)

________________________________________________________________________________________

maxima [A]  time = 0.38, size = 9, normalized size = 0.39 \begin {gather*} x + \frac {1}{x^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 1/(x^2 + 1)

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 9, normalized size = 0.39 \begin {gather*} x+\frac {1}{x^2+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 1/(x^2 + 1)

________________________________________________________________________________________

sympy [A]  time = 0.07, size = 7, normalized size = 0.30 \begin {gather*} x + \frac {1}{x^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________