3.4.11 \(\int \frac {-1+x^2}{x \sqrt {1+3 x^2+x^4}} \, dx\) [311]

Optimal. Leaf size=21 \[ \tanh ^{-1}\left (\frac {1+x^2}{\sqrt {1+3 x^2+x^4}}\right ) \]

[Out]

arctanh((x^2+1)/(x^4+3*x^2+1)^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {1265, 852, 212} \begin {gather*} \tanh ^{-1}\left (\frac {x^2+1}{\sqrt {x^4+3 x^2+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[(1 + x^2)/Sqrt[1 + 3*x^2 + x^4]]

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 852

Int[((f_) + (g_.)*(x_))/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[4*f*
((a - d)/(b*d - a*e)), Subst[Int[1/(4*(a - d) - x^2), x], x, (2*(a - d) + (b - e)*x)/Sqrt[a + b*x + c*x^2]], x
] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[4*c*(a - d) - (b - e)^2, 0] && EqQ[e*f*(b - e) - 2*g*(b*d - a*e),
0] && NeQ[b*d - a*e, 0]

Rule 1265

Int[(x_)^(m_.)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2,
Subst[Int[x^((m - 1)/2)*(d + e*x)^q*(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, d, e, p, q}, x] &&
 IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {-1+x^2}{x \sqrt {1+3 x^2+x^4}} \, dx &=\frac {1}{2} \text {Subst}\left (\int \frac {-1+x}{x \sqrt {1+3 x+x^2}} \, dx,x,x^2\right )\\ &=2 \text {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {2 \left (1+x^2\right )}{\sqrt {1+3 x^2+x^4}}\right )\\ &=\tanh ^{-1}\left (\frac {1+x^2}{\sqrt {1+3 x^2+x^4}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(52\) vs. \(2(21)=42\).
time = 0.09, size = 52, normalized size = 2.48 \begin {gather*} -\tanh ^{-1}\left (x^2-\sqrt {1+3 x^2+x^4}\right )-\frac {1}{2} \log \left (-3-2 x^2+2 \sqrt {1+3 x^2+x^4}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-ArcTanh[x^2 - Sqrt[1 + 3*x^2 + x^4]] - Log[-3 - 2*x^2 + 2*Sqrt[1 + 3*x^2 + x^4]]/2

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(45\) vs. \(2(19)=38\).
time = 0.10, size = 46, normalized size = 2.19

method result size
trager \(\ln \left (\frac {x^{2}+\sqrt {x^{4}+3 x^{2}+1}+1}{x}\right )\) \(23\)
default \(\frac {\ln \left (x^{2}+\frac {3}{2}+\sqrt {x^{4}+3 x^{2}+1}\right )}{2}+\frac {\arctanh \left (\frac {3 x^{2}+2}{2 \sqrt {x^{4}+3 x^{2}+1}}\right )}{2}\) \(46\)
elliptic \(\frac {\ln \left (x^{2}+\frac {3}{2}+\sqrt {x^{4}+3 x^{2}+1}\right )}{2}+\frac {\arctanh \left (\frac {3 x^{2}+2}{2 \sqrt {x^{4}+3 x^{2}+1}}\right )}{2}\) \(46\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*ln(x^2+3/2+(x^4+3*x^2+1)^(1/2))+1/2*arctanh(1/2*(3*x^2+2)/(x^4+3*x^2+1)^(1/2))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 52 vs. \(2 (19) = 38\).
time = 1.85, size = 52, normalized size = 2.48 \begin {gather*} \frac {1}{2} \, \log \left (2 \, x^{2} + 2 \, \sqrt {x^{4} + 3 \, x^{2} + 1} + 3\right ) + \frac {1}{2} \, \log \left (\frac {2 \, \sqrt {x^{4} + 3 \, x^{2} + 1}}{x^{2}} + \frac {2}{x^{2}} + 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*log(2*x^2 + 2*sqrt(x^4 + 3*x^2 + 1) + 3) + 1/2*log(2*sqrt(x^4 + 3*x^2 + 1)/x^2 + 2/x^2 + 3)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (19) = 38\).
time = 1.18, size = 59, normalized size = 2.81 \begin {gather*} -\frac {1}{2} \, \log \left (4 \, x^{4} + 11 \, x^{2} - \sqrt {x^{4} + 3 \, x^{2} + 1} {\left (4 \, x^{2} + 5\right )} + 5\right ) + \frac {1}{2} \, \log \left (-x^{2} + \sqrt {x^{4} + 3 \, x^{2} + 1} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*log(4*x^4 + 11*x^2 - sqrt(x^4 + 3*x^2 + 1)*(4*x^2 + 5) + 5) + 1/2*log(-x^2 + sqrt(x^4 + 3*x^2 + 1) + 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (x - 1\right ) \left (x + 1\right )}{x \sqrt {x^{4} + 3 x^{2} + 1}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((x - 1)*(x + 1)/(x*sqrt(x**4 + 3*x**2 + 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (19) = 38\).
time = 0.91, size = 69, normalized size = 3.29 \begin {gather*} -\frac {1}{2} \, \log \left (2 \, x^{2} - 2 \, \sqrt {x^{4} + 3 \, x^{2} + 1} + 3\right ) + \frac {1}{2} \, \log \left (-x^{2} + \sqrt {x^{4} + 3 \, x^{2} + 1} + 1\right ) - \frac {1}{2} \, \log \left (-x^{2} + \sqrt {x^{4} + 3 \, x^{2} + 1} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*log(2*x^2 - 2*sqrt(x^4 + 3*x^2 + 1) + 3) + 1/2*log(-x^2 + sqrt(x^4 + 3*x^2 + 1) + 1) - 1/2*log(-x^2 + sqr
t(x^4 + 3*x^2 + 1) - 1)

________________________________________________________________________________________

Mupad [B]
time = 0.81, size = 49, normalized size = 2.33 \begin {gather*} \frac {\ln \left (\frac {1}{x^2}\right )}{2}+\frac {\ln \left (\sqrt {x^4+3\,x^2+1}+x^2+\frac {3}{2}\right )}{2}+\frac {\ln \left (\frac {2\,\sqrt {x^4+3\,x^2+1}}{3}+x^2+\frac {2}{3}\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(1/x^2)/2 + log((3*x^2 + x^4 + 1)^(1/2) + x^2 + 3/2)/2 + log((2*(3*x^2 + x^4 + 1)^(1/2))/3 + x^2 + 2/3)/2

________________________________________________________________________________________