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

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

Optimal result

Integrand size = 18, antiderivative size = 12 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\frac {1}{\sqrt {1+x^2}}+\text {arcsinh}(x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1828, 221} \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\text {arcsinh}(x)+\frac {1}{\sqrt {x^2+1}} \]

[In]

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

[Out]

1/Sqrt[1 + x^2] + ArcSinh[x]

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 1828

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{align*} \text {integral}& = \frac {1}{\sqrt {1+x^2}}+\int \frac {1}{\sqrt {1+x^2}} \, dx \\ & = \frac {1}{\sqrt {1+x^2}}+\text {arcsinh}(x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(26\) vs. \(2(12)=24\).

Time = 0.16 (sec) , antiderivative size = 26, normalized size of antiderivative = 2.17 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\frac {1}{\sqrt {1+x^2}}-\log \left (-x+\sqrt {1+x^2}\right ) \]

[In]

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

[Out]

1/Sqrt[1 + x^2] - Log[-x + Sqrt[1 + x^2]]

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.92

method result size
default \(\operatorname {arcsinh}\left (x \right )+\frac {1}{\sqrt {x^{2}+1}}\) \(11\)
risch \(\operatorname {arcsinh}\left (x \right )+\frac {1}{\sqrt {x^{2}+1}}\) \(11\)
trager \(\frac {1}{\sqrt {x^{2}+1}}-\ln \left (-\sqrt {x^{2}+1}+x \right )\) \(23\)
meijerg \(\frac {x}{\sqrt {x^{2}+1}}+\frac {-\frac {\sqrt {\pi }\, x}{\sqrt {x^{2}+1}}+\sqrt {\pi }\, \operatorname {arcsinh}\left (x \right )}{\sqrt {\pi }}-\frac {\sqrt {\pi }-\frac {\sqrt {\pi }}{\sqrt {x^{2}+1}}}{\sqrt {\pi }}\) \(56\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (10) = 20\).

Time = 0.25 (sec) , antiderivative size = 37, normalized size of antiderivative = 3.08 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=-\frac {{\left (x^{2} + 1\right )} \log \left (-x + \sqrt {x^{2} + 1}\right ) - \sqrt {x^{2} + 1}}{x^{2} + 1} \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (12) = 24\).

Time = 4.84 (sec) , antiderivative size = 29, normalized size of antiderivative = 2.42 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\frac {x^{2} \operatorname {asinh}{\left (x \right )}}{x^{2} + 1} + \frac {\operatorname {asinh}{\left (x \right )}}{x^{2} + 1} + \frac {1}{\sqrt {x^{2} + 1}} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.83 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\frac {1}{\sqrt {x^{2} + 1}} + \operatorname {arsinh}\left (x\right ) \]

[In]

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

[Out]

1/sqrt(x^2 + 1) + arcsinh(x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 22 vs. \(2 (10) = 20\).

Time = 0.30 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.83 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\frac {1}{\sqrt {x^{2} + 1}} - \log \left (-x + \sqrt {x^{2} + 1}\right ) \]

[In]

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

[Out]

1/sqrt(x^2 + 1) - log(-x + sqrt(x^2 + 1))

Mupad [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 24, normalized size of antiderivative = 2.00 \[ \int \frac {1-x+x^2}{\left (1+x^2\right )^{3/2}} \, dx=\frac {\mathrm {asinh}\left (x\right )+x^2\,\mathrm {asinh}\left (x\right )+\sqrt {x^2+1}}{x^2+1} \]

[In]

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

[Out]

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