3.880 \(\int \frac {2 x-x^3+x^2 \sqrt {2-x^2}}{-2+2 x^2} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.13, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {6725, 260, 266, 43, 478, 12, 377, 207} \[ -\frac {x^2}{4}+\frac {1}{4} \sqrt {2-x^2} x+\frac {1}{4} \log \left (1-x^2\right )-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 207

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

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 377

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 478

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e^(n -
1)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q)/(b*(m + n*(p + q) + 1)), x] - Dist[e^n/(b*(m + n*(p +
q) + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^p*(c + d*x^n)^(q - 1)*Simp[a*c*(m - n + 1) + (a*d*(m - n + 1) - n*q*(b
*c - a*d))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && GtQ[q, 0] &&
GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 6725

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*} \int \frac {2 x-x^3+x^2 \sqrt {2-x^2}}{-2+2 x^2} \, dx &=\int \left (\frac {x}{-1+x^2}-\frac {x^3}{2 \left (-1+x^2\right )}+\frac {x^2 \sqrt {2-x^2}}{2 \left (-1+x^2\right )}\right ) \, dx\\ &=-\left (\frac {1}{2} \int \frac {x^3}{-1+x^2} \, dx\right )+\frac {1}{2} \int \frac {x^2 \sqrt {2-x^2}}{-1+x^2} \, dx+\int \frac {x}{-1+x^2} \, dx\\ &=\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{2} \log \left (1-x^2\right )-\frac {1}{4} \int -\frac {2}{\sqrt {2-x^2} \left (-1+x^2\right )} \, dx-\frac {1}{4} \operatorname {Subst}\left (\int \frac {x}{-1+x} \, dx,x,x^2\right )\\ &=\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{2} \log \left (1-x^2\right )-\frac {1}{4} \operatorname {Subst}\left (\int \left (1+\frac {1}{-1+x}\right ) \, dx,x,x^2\right )+\frac {1}{2} \int \frac {1}{\sqrt {2-x^2} \left (-1+x^2\right )} \, dx\\ &=-\frac {x^2}{4}+\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{4} \log \left (1-x^2\right )+\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\frac {x}{\sqrt {2-x^2}}\right )\\ &=-\frac {x^2}{4}+\frac {1}{4} x \sqrt {2-x^2}-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right )+\frac {1}{4} \log \left (1-x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 77, normalized size = 1.43 \[ \frac {1}{4} \left (-x^2+\sqrt {2-x^2} x+\log \left (1-x^2\right )-\log \left (\sqrt {2-x^2}-x+2\right )+\log \left (\sqrt {2-x^2}+x+2\right )+\log (1-x)-\log (x+1)\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-x^2 + x*Sqrt[2 - x^2] + Log[1 - x] - Log[1 + x] + Log[1 - x^2] - Log[2 - x + Sqrt[2 - x^2]] + Log[2 + x + Sq
rt[2 - x^2]])/4

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 67, normalized size = 1.24 \[ -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left (x^{2} - 1\right ) - \frac {1}{8} \, \log \left (-\frac {\sqrt {-x^{2} + 2} x + 1}{x^{2}}\right ) + \frac {1}{8} \, \log \left (\frac {\sqrt {-x^{2} + 2} x - 1}{x^{2}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.44, size = 117, normalized size = 2.17 \[ -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left ({\left | x^{2} - 1 \right |}\right ) - \frac {1}{4} \, \log \left ({\left | \frac {x}{\sqrt {2} - \sqrt {-x^{2} + 2}} - \frac {\sqrt {2} - \sqrt {-x^{2} + 2}}{x} + 2 \right |}\right ) + \frac {1}{4} \, \log \left ({\left | \frac {x}{\sqrt {2} - \sqrt {-x^{2} + 2}} - \frac {\sqrt {2} - \sqrt {-x^{2} + 2}}{x} - 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [B]  time = 0.02, size = 111, normalized size = 2.06 \[ -\frac {x^{2}}{4}+\frac {\sqrt {-x^{2}+2}\, x}{4}-\frac {\arctanh \left (\frac {-2 x +4}{2 \sqrt {-2 x -\left (x -1\right )^{2}+3}}\right )}{4}+\frac {\arctanh \left (\frac {2 x +4}{2 \sqrt {2 x -\left (x +1\right )^{2}+3}}\right )}{4}+\frac {\ln \left (x -1\right )}{4}+\frac {\ln \left (x +1\right )}{4}+\frac {\sqrt {-2 x -\left (x -1\right )^{2}+3}}{4}-\frac {\sqrt {2 x -\left (x +1\right )^{2}+3}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 2.03, size = 94, normalized size = 1.74 \[ -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left (x^{2} - 1\right ) + \frac {1}{4} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 2}}{{\left | 2 \, x + 2 \right |}} + \frac {2}{{\left | 2 \, x + 2 \right |}} + 1\right ) - \frac {1}{4} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 2}}{{\left | 2 \, x - 2 \right |}} + \frac {2}{{\left | 2 \, x - 2 \right |}} - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 3.33, size = 86, normalized size = 1.59 \[ \frac {\ln \left (x-1\right )}{4}+\frac {\ln \left (x+1\right )}{4}-\frac {\ln \left (\frac {-x\,1{}\mathrm {i}+\sqrt {2-x^2}\,1{}\mathrm {i}+2{}\mathrm {i}}{x-1}\right )}{4}+\frac {\ln \left (\frac {x\,1{}\mathrm {i}+\sqrt {2-x^2}\,1{}\mathrm {i}+2{}\mathrm {i}}{x+1}\right )}{4}+\frac {x\,\sqrt {2-x^2}}{4}-\frac {x^2}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1)/4 + log(x + 1)/4 - log(((2 - x^2)^(1/2)*1i - x*1i + 2i)/(x - 1))/4 + log((x*1i + (2 - x^2)^(1/2)*1i
 + 2i)/(x + 1))/4 + (x*(2 - x^2)^(1/2))/4 - x^2/4

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________