\(\int \frac {5+x+3 x^2+2 x^3}{x (2+x+5 x^2+x^3+2 x^4)} \, dx\) [61]

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

Optimal result

Integrand size = 35, antiderivative size = 217 \[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=-\frac {\left (53+i \sqrt {7}\right ) \text {arctanh}\left (\frac {i-\sqrt {7}+8 i x}{\sqrt {2 \left (35-i \sqrt {7}\right )}}\right )}{2 \sqrt {14 \left (35-i \sqrt {7}\right )}}+\frac {\left (53-i \sqrt {7}\right ) \text {arctanh}\left (\frac {i+\sqrt {7}+8 i x}{\sqrt {2 \left (35+i \sqrt {7}\right )}}\right )}{2 \sqrt {14 \left (35+i \sqrt {7}\right )}}+\frac {5 \log (x)}{2}-\frac {1}{56} \left (35-9 i \sqrt {7}\right ) \log \left (4 i+\left (i-\sqrt {7}\right ) x+4 i x^2\right )-\frac {1}{56} \left (35+9 i \sqrt {7}\right ) \log \left (4 i+\left (i+\sqrt {7}\right ) x+4 i x^2\right ) \] Output:

-1/2*(53+I*7^(1/2))*arctanh((I-7^(1/2)+8*I*x)/(70-2*I*7^(1/2))^(1/2))/(490 
-14*I*7^(1/2))^(1/2)+1/2*(53-I*7^(1/2))*arctanh((I+7^(1/2)+8*I*x)/(70+2*I* 
7^(1/2))^(1/2))/(490+14*I*7^(1/2))^(1/2)+5/2*ln(x)-1/56*(35-9*I*7^(1/2))*l 
n(4*I+(I-7^(1/2))*x+4*I*x^2)-1/56*(35+9*I*7^(1/2))*ln(4*I+(I+7^(1/2))*x+4* 
I*x^2)
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 0.03 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.47 \[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=\frac {5 \log (x)}{2}-\frac {1}{2} \text {RootSum}\left [2+\text {$\#$1}+5 \text {$\#$1}^2+\text {$\#$1}^3+2 \text {$\#$1}^4\&,\frac {3 \log (x-\text {$\#$1})+19 \log (x-\text {$\#$1}) \text {$\#$1}+\log (x-\text {$\#$1}) \text {$\#$1}^2+10 \log (x-\text {$\#$1}) \text {$\#$1}^3}{1+10 \text {$\#$1}+3 \text {$\#$1}^2+8 \text {$\#$1}^3}\&\right ] \] Input:

Integrate[(5 + x + 3*x^2 + 2*x^3)/(x*(2 + x + 5*x^2 + x^3 + 2*x^4)),x]
 

Output:

(5*Log[x])/2 - RootSum[2 + #1 + 5*#1^2 + #1^3 + 2*#1^4 & , (3*Log[x - #1] 
+ 19*Log[x - #1]*#1 + Log[x - #1]*#1^2 + 10*Log[x - #1]*#1^3)/(1 + 10*#1 + 
 3*#1^2 + 8*#1^3) & ]/2
 

Rubi [A] (verified)

Time = 0.97 (sec) , antiderivative size = 214, normalized size of antiderivative = 0.99, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.057, Rules used = {2496, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {2 x^3+3 x^2+x+5}{x \left (2 x^4+x^3+5 x^2+x+2\right )} \, dx\)

\(\Big \downarrow \) 2496

\(\displaystyle \frac {1}{2} \int \left (-\frac {2 \left (35 i-9 \sqrt {7}\right ) x+3 \left (7 i+11 \sqrt {7}\right )}{7 \left (4 i x^2+\left (i+\sqrt {7}\right ) x+4 i\right )}+\frac {5}{x}-\frac {2 \left (35 i+9 \sqrt {7}\right ) x+3 \left (7 i-11 \sqrt {7}\right )}{7 \left (4 i x^2+\left (i-\sqrt {7}\right ) x+4 i\right )}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (-\frac {\left (53+i \sqrt {7}\right ) \text {arctanh}\left (\frac {8 i x-\sqrt {7}+i}{\sqrt {2 \left (35-i \sqrt {7}\right )}}\right )}{\sqrt {14 \left (35-i \sqrt {7}\right )}}+\frac {\left (53-i \sqrt {7}\right ) \text {arctanh}\left (\frac {8 i x+\sqrt {7}+i}{\sqrt {2 \left (35+i \sqrt {7}\right )}}\right )}{\sqrt {14 \left (35+i \sqrt {7}\right )}}-\frac {1}{28} \left (35-9 i \sqrt {7}\right ) \log \left (4 i x^2+\left (-\sqrt {7}+i\right ) x+4 i\right )-\frac {1}{28} \left (35+9 i \sqrt {7}\right ) \log \left (4 i x^2+\left (\sqrt {7}+i\right ) x+4 i\right )+5 \log (x)\right )\)

Input:

Int[(5 + x + 3*x^2 + 2*x^3)/(x*(2 + x + 5*x^2 + x^3 + 2*x^4)),x]
 

Output:

(-(((53 + I*Sqrt[7])*ArcTanh[(I - Sqrt[7] + (8*I)*x)/Sqrt[2*(35 - I*Sqrt[7 
])]])/Sqrt[14*(35 - I*Sqrt[7])]) + ((53 - I*Sqrt[7])*ArcTanh[(I + Sqrt[7] 
+ (8*I)*x)/Sqrt[2*(35 + I*Sqrt[7])]])/Sqrt[14*(35 + I*Sqrt[7])] + 5*Log[x] 
 - ((35 - (9*I)*Sqrt[7])*Log[4*I + (I - Sqrt[7])*x + (4*I)*x^2])/28 - ((35 
 + (9*I)*Sqrt[7])*Log[4*I + (I + Sqrt[7])*x + (4*I)*x^2])/28)/2
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2496
Int[(Px_.)*(x_)^(m_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2 + (d_.)*(x_)^3 + (e 
_.)*(x_)^4)^(p_), x_Symbol] :> Simp[e^p   Int[ExpandIntegrand[x^m*Px*(b/d + 
 ((d + Sqrt[e*((b^2 - 4*a*c)/a) + 8*a*d*(e/b)])/(2*e))*x + x^2)^p*(b/d + (( 
d - Sqrt[e*((b^2 - 4*a*c)/a) + 8*a*d*(e/b)])/(2*e))*x + x^2)^p, x], x], x] 
/; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Px, x] && ILtQ[p, 0] && EqQ[a*d^2 
- b^2*e, 0]
 
Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.05 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.24

method result size
risch \(\frac {5 \ln \left (x \right )}{2}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (686 \textit {\_Z}^{4}+1715 \textit {\_Z}^{3}+1372 \textit {\_Z}^{2}+448 \textit {\_Z} +256\right )}{\sum }\textit {\_R} \ln \left (2058 \textit {\_R}^{3}+20825 \textit {\_R}^{2}+25844 \textit {\_R} +8384 x +6816\right )\right )\) \(51\)
default \(\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (2 \textit {\_Z}^{4}+\textit {\_Z}^{3}+5 \textit {\_Z}^{2}+\textit {\_Z} +2\right )}{\sum }\frac {\left (-10 \textit {\_R}^{3}-\textit {\_R}^{2}-19 \textit {\_R} -3\right ) \ln \left (x -\textit {\_R} \right )}{8 \textit {\_R}^{3}+3 \textit {\_R}^{2}+10 \textit {\_R} +1}\right )}{2}+\frac {5 \ln \left (x \right )}{2}\) \(67\)

Input:

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

Output:

5/2*ln(x)+sum(_R*ln(2058*_R^3+20825*_R^2+25844*_R+8384*x+6816),_R=RootOf(6 
86*_Z^4+1715*_Z^3+1372*_Z^2+448*_Z+256))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 315 vs. \(2 (130) = 260\).

Time = 0.11 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.45 \[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=-\frac {1}{8} \, {\left (\sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + 5\right )} \log \left (296 \, x^{2} + 7 \, {\left (7 \, \sqrt {\frac {11}{7}} {\left (12 \, x + 1\right )} - 106 \, x - 15\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + 74 \, x + 259 \, \sqrt {\frac {11}{7}} + 37\right ) + \frac {1}{8} \, {\left (\sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} - 5\right )} \log \left (296 \, x^{2} - 7 \, {\left (7 \, \sqrt {\frac {11}{7}} {\left (12 \, x + 1\right )} - 106 \, x - 15\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + 74 \, x + 259 \, \sqrt {\frac {11}{7}} + 37\right ) - \frac {1}{2} \, \sqrt {\frac {9}{74} \, {\left (64 \, \sqrt {\frac {11}{7}} - 79\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + \frac {16}{7} \, \sqrt {\frac {11}{7}} + \frac {1}{14}} \arctan \left (\frac {7}{77552} \, {\left (148 \, \sqrt {\frac {11}{7}} {\left (23 \, x - 26\right )} + 7 \, {\left (4 \, \sqrt {\frac {11}{7}} {\left (317 \, x + 234\right )} - 1808 \, x - 1197\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} - 1184 \, x + 4921\right )} \sqrt {\frac {9}{74} \, {\left (64 \, \sqrt {\frac {11}{7}} - 79\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + \frac {16}{7} \, \sqrt {\frac {11}{7}} + \frac {1}{14}}\right ) + \frac {1}{2} \, \sqrt {-\frac {9}{74} \, {\left (64 \, \sqrt {\frac {11}{7}} - 79\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + \frac {16}{7} \, \sqrt {\frac {11}{7}} + \frac {1}{14}} \arctan \left (-\frac {7}{77552} \, {\left (148 \, \sqrt {\frac {11}{7}} {\left (23 \, x - 26\right )} - 7 \, {\left (4 \, \sqrt {\frac {11}{7}} {\left (317 \, x + 234\right )} - 1808 \, x - 1197\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} - 1184 \, x + 4921\right )} \sqrt {-\frac {9}{74} \, {\left (64 \, \sqrt {\frac {11}{7}} - 79\right )} \sqrt {\frac {64}{7} \, \sqrt {\frac {11}{7}} + \frac {79}{7}} + \frac {16}{7} \, \sqrt {\frac {11}{7}} + \frac {1}{14}}\right ) + \frac {5}{2} \, \log \left (x\right ) \] Input:

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

Output:

-1/8*(sqrt(64/7*sqrt(11/7) + 79/7) + 5)*log(296*x^2 + 7*(7*sqrt(11/7)*(12* 
x + 1) - 106*x - 15)*sqrt(64/7*sqrt(11/7) + 79/7) + 74*x + 259*sqrt(11/7) 
+ 37) + 1/8*(sqrt(64/7*sqrt(11/7) + 79/7) - 5)*log(296*x^2 - 7*(7*sqrt(11/ 
7)*(12*x + 1) - 106*x - 15)*sqrt(64/7*sqrt(11/7) + 79/7) + 74*x + 259*sqrt 
(11/7) + 37) - 1/2*sqrt(9/74*(64*sqrt(11/7) - 79)*sqrt(64/7*sqrt(11/7) + 7 
9/7) + 16/7*sqrt(11/7) + 1/14)*arctan(7/77552*(148*sqrt(11/7)*(23*x - 26) 
+ 7*(4*sqrt(11/7)*(317*x + 234) - 1808*x - 1197)*sqrt(64/7*sqrt(11/7) + 79 
/7) - 1184*x + 4921)*sqrt(9/74*(64*sqrt(11/7) - 79)*sqrt(64/7*sqrt(11/7) + 
 79/7) + 16/7*sqrt(11/7) + 1/14)) + 1/2*sqrt(-9/74*(64*sqrt(11/7) - 79)*sq 
rt(64/7*sqrt(11/7) + 79/7) + 16/7*sqrt(11/7) + 1/14)*arctan(-7/77552*(148* 
sqrt(11/7)*(23*x - 26) - 7*(4*sqrt(11/7)*(317*x + 234) - 1808*x - 1197)*sq 
rt(64/7*sqrt(11/7) + 79/7) - 1184*x + 4921)*sqrt(-9/74*(64*sqrt(11/7) - 79 
)*sqrt(64/7*sqrt(11/7) + 79/7) + 16/7*sqrt(11/7) + 1/14)) + 5/2*log(x)
 

Sympy [A] (verification not implemented)

Time = 9.09 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.28 \[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=\frac {5 \log {\left (x \right )}}{2} + \operatorname {RootSum} {\left (686 t^{4} + 1715 t^{3} + 1372 t^{2} + 448 t + 256, \left ( t \mapsto t \log {\left (- \frac {160344611 t^{4}}{532759184} - \frac {16880402 t^{3}}{33297449} + \frac {4010520787 t^{2}}{2131036736} + \frac {1537535671 t}{532759184} + x + \frac {46660495}{66594898} \right )} \right )\right )} \] Input:

integrate((2*x**3+3*x**2+x+5)/x/(2*x**4+x**3+5*x**2+x+2),x)
 

Output:

5*log(x)/2 + RootSum(686*_t**4 + 1715*_t**3 + 1372*_t**2 + 448*_t + 256, L 
ambda(_t, _t*log(-160344611*_t**4/532759184 - 16880402*_t**3/33297449 + 40 
10520787*_t**2/2131036736 + 1537535671*_t/532759184 + x + 46660495/6659489 
8)))
 

Maxima [F]

\[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=\int { \frac {2 \, x^{3} + 3 \, x^{2} + x + 5}{{\left (2 \, x^{4} + x^{3} + 5 \, x^{2} + x + 2\right )} x} \,d x } \] Input:

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

Output:

-1/2*integrate((10*x^3 + x^2 + 19*x + 3)/(2*x^4 + x^3 + 5*x^2 + x + 2), x) 
 + 5/2*log(x)
 

Giac [F]

\[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=\int { \frac {2 \, x^{3} + 3 \, x^{2} + x + 5}{{\left (2 \, x^{4} + x^{3} + 5 \, x^{2} + x + 2\right )} x} \,d x } \] Input:

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

Output:

integrate((2*x^3 + 3*x^2 + x + 5)/((2*x^4 + x^3 + 5*x^2 + x + 2)*x), x)
 

Mupad [B] (verification not implemented)

Time = 22.36 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.09 \[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=\frac {5\,\ln \left (x\right )}{2}+\left (\sum _{k=1}^4\ln \left (\frac {223\,\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}{8}-\frac {31\,x}{2}+\frac {\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )\,x\,71}{16}-\frac {{\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}^2\,x\,4463}{64}+\frac {{\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}^3\,x\,1449}{16}+\frac {{\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}^4\,x\,3675}{32}+\frac {257\,{\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}^2}{32}+\frac {1673\,{\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}^3}{64}-\frac {441\,{\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )}^4}{32}+10\right )\,\mathrm {root}\left (z^4+\frac {5\,z^3}{2}+2\,z^2+\frac {32\,z}{49}+\frac {128}{343},z,k\right )\right ) \] Input:

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

Output:

(5*log(x))/2 + symsum(log((223*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 + 
128/343, z, k))/8 - (31*x)/2 + (71*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/4 
9 + 128/343, z, k)*x)/16 - (4463*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 
+ 128/343, z, k)^2*x)/64 + (1449*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 
+ 128/343, z, k)^3*x)/16 + (3675*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 
+ 128/343, z, k)^4*x)/32 + (257*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 + 
 128/343, z, k)^2)/32 + (1673*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 + 1 
28/343, z, k)^3)/64 - (441*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 + 128/ 
343, z, k)^4)/32 + 10)*root(z^4 + (5*z^3)/2 + 2*z^2 + (32*z)/49 + 128/343, 
 z, k), k, 1, 4)
 

Reduce [F]

\[ \int \frac {5+x+3 x^2+2 x^3}{x \left (2+x+5 x^2+x^3+2 x^4\right )} \, dx=-17 \left (\int \frac {x}{2 x^{4}+x^{3}+5 x^{2}+x +2}d x \right )-11 \left (\int \frac {1}{2 x^{5}+x^{4}+5 x^{3}+x^{2}+2 x}d x \right )-5 \left (\int \frac {1}{2 x^{4}+x^{3}+5 x^{2}+x +2}d x \right )-2 \,\mathrm {log}\left (2 x^{4}+x^{3}+5 x^{2}+x +2\right )+8 \,\mathrm {log}\left (x \right ) \] Input:

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

Output:

 - 17*int(x/(2*x**4 + x**3 + 5*x**2 + x + 2),x) - 11*int(1/(2*x**5 + x**4 
+ 5*x**3 + x**2 + 2*x),x) - 5*int(1/(2*x**4 + x**3 + 5*x**2 + x + 2),x) - 
2*log(2*x**4 + x**3 + 5*x**2 + x + 2) + 8*log(x)