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

Optimal. Leaf size=103 \[ \frac {1+x}{8 \left (1+x^2\right )^2}-\frac {3 (1-x)}{8 \left (1+x^2\right )}+\frac {3 x}{16 \left (1+x^2\right )}+\frac {7}{16} \tan ^{-1}(x)-\frac {\tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )}{\sqrt {3}}+\frac {1}{8} \log (1-x)-\log (x)+\frac {15}{16} \log \left (1+x^2\right )-\frac {1}{2} \log \left (1+x+x^2\right ) \]

[Out]

1/8*(1+x)/(x^2+1)^2-3/8*(1-x)/(x^2+1)+3/16*x/(x^2+1)+7/16*arctan(x)+1/8*ln(1-x)-ln(x)+15/16*ln(x^2+1)-1/2*ln(x
^2+x+1)-1/3*arctan(1/3*(1+2*x)*3^(1/2))*3^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.33, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 10, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {6860, 653, 205, 209, 649, 266, 648, 632, 210, 642} \begin {gather*} \frac {7 \text {ArcTan}(x)}{16}-\frac {\text {ArcTan}\left (\frac {2 x+1}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {3 (1-x)}{8 \left (x^2+1\right )}+\frac {3 x}{16 \left (x^2+1\right )}+\frac {x+1}{8 \left (x^2+1\right )^2}+\frac {15}{16} \log \left (x^2+1\right )-\frac {1}{2} \log \left (x^2+x+1\right )+\frac {1}{8} \log (1-x)-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(1 + x)/(8*(1 + x^2)^2) - (3*(1 - x))/(8*(1 + x^2)) + (3*x)/(16*(1 + x^2)) + (7*ArcTan[x])/16 - ArcTan[(1 + 2*
x)/Sqrt[3]]/Sqrt[3] + Log[1 - x]/8 - Log[x] + (15*Log[1 + x^2])/16 - Log[1 + x + x^2]/2

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 209

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

Rule 210

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

Rule 266

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 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

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

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 653

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((a*e - c*d*x)/(2*a*c*(p + 1)))*(a + c*x
^2)^(p + 1), x] + Dist[d*((2*p + 3)/(2*a*(p + 1))), Int[(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x]
&& LtQ[p, -1] && NeQ[p, -3/2]

Rule 6860

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 93, normalized size = 0.90 \begin {gather*} \frac {1}{48} \left (\frac {6 (1+x)}{\left (1+x^2\right )^2}+\frac {9 (-2+3 x)}{1+x^2}+21 \tan ^{-1}(x)-16 \sqrt {3} \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )+20 \log (1-x)-48 \log (x)+45 \log \left (1+x^2\right )-10 \log \left (1+x+x^2\right )-14 \log \left (1-x^3\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((6*(1 + x))/(1 + x^2)^2 + (9*(-2 + 3*x))/(1 + x^2) + 21*ArcTan[x] - 16*Sqrt[3]*ArcTan[(1 + 2*x)/Sqrt[3]] + 20
*Log[1 - x] - 48*Log[x] + 45*Log[1 + x^2] - 10*Log[1 + x + x^2] - 14*Log[1 - x^3])/48

________________________________________________________________________________________

Maple [A]
time = 0.31, size = 73, normalized size = 0.71

method result size
risch \(\frac {\frac {9}{16} x^{3}-\frac {3}{8} x^{2}+\frac {11}{16} x -\frac {1}{4}}{\left (x^{2}+1\right )^{2}}+\frac {15 \ln \left (x^{2}+1\right )}{16}+\frac {7 \arctan \left (x \right )}{16}-\ln \left (x \right )+\frac {\ln \left (-1+x \right )}{8}-\frac {\ln \left (x^{2}+x +1\right )}{2}-\frac {\sqrt {3}\, \arctan \left (\frac {2 \left (x +\frac {1}{2}\right ) \sqrt {3}}{3}\right )}{3}\) \(70\)
default \(-\frac {\ln \left (x^{2}+x +1\right )}{2}-\frac {\arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right ) \sqrt {3}}{3}+\frac {\ln \left (-1+x \right )}{8}+\frac {\frac {9}{2} x^{3}-3 x^{2}+\frac {11}{2} x -2}{8 \left (x^{2}+1\right )^{2}}+\frac {15 \ln \left (x^{2}+1\right )}{16}+\frac {7 \arctan \left (x \right )}{16}-\ln \left (x \right )\) \(73\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*ln(x^2+x+1)-1/3*arctan(1/3*(2*x+1)*3^(1/2))*3^(1/2)+1/8*ln(-1+x)+1/8*(9/2*x^3-3*x^2+11/2*x-2)/(x^2+1)^2+1
5/16*ln(x^2+1)+7/16*arctan(x)-ln(x)

________________________________________________________________________________________

Maxima [A]
time = 0.47, size = 77, normalized size = 0.75 \begin {gather*} -\frac {1}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {9 \, x^{3} - 6 \, x^{2} + 11 \, x - 4}{16 \, {\left (x^{4} + 2 \, x^{2} + 1\right )}} + \frac {7}{16} \, \arctan \left (x\right ) - \frac {1}{2} \, \log \left (x^{2} + x + 1\right ) + \frac {15}{16} \, \log \left (x^{2} + 1\right ) + \frac {1}{8} \, \log \left (x - 1\right ) - \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*x + 1)) + 1/16*(9*x^3 - 6*x^2 + 11*x - 4)/(x^4 + 2*x^2 + 1) + 7/16*arctan(x
) - 1/2*log(x^2 + x + 1) + 15/16*log(x^2 + 1) + 1/8*log(x - 1) - log(x)

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 136, normalized size = 1.32 \begin {gather*} \frac {27 \, x^{3} - 16 \, \sqrt {3} {\left (x^{4} + 2 \, x^{2} + 1\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) - 18 \, x^{2} + 21 \, {\left (x^{4} + 2 \, x^{2} + 1\right )} \arctan \left (x\right ) - 24 \, {\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x^{2} + x + 1\right ) + 45 \, {\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 6 \, {\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x - 1\right ) - 48 \, {\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x\right ) + 33 \, x - 12}{48 \, {\left (x^{4} + 2 \, x^{2} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/48*(27*x^3 - 16*sqrt(3)*(x^4 + 2*x^2 + 1)*arctan(1/3*sqrt(3)*(2*x + 1)) - 18*x^2 + 21*(x^4 + 2*x^2 + 1)*arct
an(x) - 24*(x^4 + 2*x^2 + 1)*log(x^2 + x + 1) + 45*(x^4 + 2*x^2 + 1)*log(x^2 + 1) + 6*(x^4 + 2*x^2 + 1)*log(x
- 1) - 48*(x^4 + 2*x^2 + 1)*log(x) + 33*x - 12)/(x^4 + 2*x^2 + 1)

________________________________________________________________________________________

Sympy [A]
time = 0.27, size = 88, normalized size = 0.85 \begin {gather*} - \log {\left (x \right )} + \frac {\log {\left (x - 1 \right )}}{8} + \frac {15 \log {\left (x^{2} + 1 \right )}}{16} - \frac {\log {\left (x^{2} + x + 1 \right )}}{2} + \frac {7 \operatorname {atan}{\left (x \right )}}{16} - \frac {\sqrt {3} \operatorname {atan}{\left (\frac {2 \sqrt {3} x}{3} + \frac {\sqrt {3}}{3} \right )}}{3} + \frac {9 x^{3} - 6 x^{2} + 11 x - 4}{16 x^{4} + 32 x^{2} + 16} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(x) + log(x - 1)/8 + 15*log(x**2 + 1)/16 - log(x**2 + x + 1)/2 + 7*atan(x)/16 - sqrt(3)*atan(2*sqrt(3)*x/3
 + sqrt(3)/3)/3 + (9*x**3 - 6*x**2 + 11*x - 4)/(16*x**4 + 32*x**2 + 16)

________________________________________________________________________________________

Giac [A]
time = 4.76, size = 74, normalized size = 0.72 \begin {gather*} -\frac {1}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {9 \, x^{3} - 6 \, x^{2} + 11 \, x - 4}{16 \, {\left (x^{2} + 1\right )}^{2}} + \frac {7}{16} \, \arctan \left (x\right ) - \frac {1}{2} \, \log \left (x^{2} + x + 1\right ) + \frac {15}{16} \, \log \left (x^{2} + 1\right ) + \frac {1}{8} \, \log \left ({\left | x - 1 \right |}\right ) - \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*x + 1)) + 1/16*(9*x^3 - 6*x^2 + 11*x - 4)/(x^2 + 1)^2 + 7/16*arctan(x) - 1/
2*log(x^2 + x + 1) + 15/16*log(x^2 + 1) + 1/8*log(abs(x - 1)) - log(abs(x))

________________________________________________________________________________________

Mupad [B]
time = 2.20, size = 96, normalized size = 0.93 \begin {gather*} \frac {\ln \left (x-1\right )}{8}-\ln \left (x\right )+\ln \left (x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6}\right )-\ln \left (x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6}\right )+\frac {\frac {9\,x^3}{16}-\frac {3\,x^2}{8}+\frac {11\,x}{16}-\frac {1}{4}}{x^4+2\,x^2+1}+\ln \left (x-\mathrm {i}\right )\,\left (\frac {15}{16}-\frac {7}{32}{}\mathrm {i}\right )+\ln \left (x+1{}\mathrm {i}\right )\,\left (\frac {15}{16}+\frac {7}{32}{}\mathrm {i}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1)/8 + log(x - 1i)*(15/16 - 7i/32) + log(x + 1i)*(15/16 + 7i/32) - log(x) + log(x - (3^(1/2)*1i)/2 + 1
/2)*((3^(1/2)*1i)/6 - 1/2) - log(x + (3^(1/2)*1i)/2 + 1/2)*((3^(1/2)*1i)/6 + 1/2) + ((11*x)/16 - (3*x^2)/8 + (
9*x^3)/16 - 1/4)/(2*x^2 + x^4 + 1)

________________________________________________________________________________________