Integrand size = 22, antiderivative size = 45 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\frac {1}{2} (A+B-C) \arctan (x)+\frac {1}{2} (A-B+C) \log (1+x)-\frac {1}{4} (A-B-C) \log \left (1+x^2\right ) \] Output:
1/2*(A+B-C)*arctan(x)+1/2*(A-B+C)*ln(1+x)-1/4*(A-B-C)*ln(x^2+1)
Result contains complex when optimal does not.
Time = 0.03 (sec) , antiderivative size = 101, normalized size of antiderivative = 2.24 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\frac {1}{4} \left ((1+i) (-i A+B+i C) \arctan \left (\frac {-1+x}{1+x}\right )-(1+i) (A-i B-C) \arctan \left (\frac {1+x}{-1+x}\right )+2 A \log (1+x)-2 B \log (1+x)+2 C \log (1+x)-A \log \left (1+x^2\right )+B \log \left (1+x^2\right )+C \log \left (1+x^2\right )\right ) \] Input:
Integrate[(A + B*x + C*x^2)/(1 + x + x^2 + x^3),x]
Output:
((1 + I)*((-I)*A + B + I*C)*ArcTan[(-1 + x)/(1 + x)] - (1 + I)*(A - I*B - C)*ArcTan[(1 + x)/(-1 + x)] + 2*A*Log[1 + x] - 2*B*Log[1 + x] + 2*C*Log[1 + x] - A*Log[1 + x^2] + B*Log[1 + x^2] + C*Log[1 + x^2])/4
Time = 0.37 (sec) , antiderivative size = 45, 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.091, Rules used = {2462, 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 {A+B x+C x^2}{x^3+x^2+x+1} \, dx\) |
\(\Big \downarrow \) 2462 |
\(\displaystyle \int \left (\frac {-x (A-B-C)+A+B-C}{2 \left (x^2+1\right )}+\frac {A-B+C}{2 (x+1)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} \arctan (x) (A+B-C)-\frac {1}{4} \log \left (x^2+1\right ) (A-B-C)+\frac {1}{2} \log (x+1) (A-B+C)\) |
Input:
Int[(A + B*x + C*x^2)/(1 + x + x^2 + x^3),x]
Output:
((A + B - C)*ArcTan[x])/2 + ((A - B + C)*Log[1 + x])/2 - ((A - B - C)*Log[ 1 + x^2])/4
Int[(u_.)*(Px_)^(p_), x_Symbol] :> With[{Qx = Factor[Px]}, Int[ExpandIntegr and[u*Qx^p, x], x] /; !SumQ[NonfreeFactors[Qx, x]]] /; PolyQ[Px, x] && GtQ [Expon[Px, x], 2] && !BinomialQ[Px, x] && !TrinomialQ[Px, x] && ILtQ[p, 0 ] && RationalFunctionQ[u, x]
Time = 0.11 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.91
method | result | size |
default | \(\frac {\left (-A +B +C \right ) \ln \left (x^{2}+1\right )}{4}+\frac {\left (A +B -C \right ) \arctan \left (x \right )}{2}+\left (\frac {A}{2}-\frac {B}{2}+\frac {C}{2}\right ) \ln \left (x +1\right )\) | \(41\) |
parallelrisch | \(\frac {\ln \left (x +1\right ) A}{2}-\frac {\ln \left (x +1\right ) B}{2}+\frac {\ln \left (x +1\right ) C}{2}-\frac {\ln \left (x -i\right ) A}{4}+\frac {\ln \left (x -i\right ) B}{4}+\frac {\ln \left (x -i\right ) C}{4}+\frac {i \ln \left (x +i\right ) B}{4}-\frac {i \ln \left (x -i\right ) B}{4}+\frac {i \ln \left (x +i\right ) A}{4}+\frac {i \ln \left (x -i\right ) C}{4}-\frac {\ln \left (x +i\right ) A}{4}+\frac {\ln \left (x +i\right ) C}{4}+\frac {\ln \left (x +i\right ) B}{4}-\frac {i \ln \left (x +i\right ) C}{4}-\frac {i \ln \left (x -i\right ) A}{4}\) | \(125\) |
risch | \(-\frac {B \arctan \left (\frac {3 A}{A +B -C}-\frac {3 B}{A +B -C}+\frac {C}{A +B -C}\right )}{2}-\frac {C \arctan \left (\frac {5 A^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}-\frac {8 A x B}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {2 A C x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {5 B^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}-\frac {4 B C x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {C^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}\right )}{2}+\frac {A \arctan \left (\frac {5 A^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}-\frac {8 A x B}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {2 A C x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {5 B^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}-\frac {4 B C x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {C^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}\right )}{2}+\frac {\ln \left (x +1\right ) A}{2}-\frac {\ln \left (x +1\right ) B}{2}+\frac {\ln \left (x +1\right ) C}{2}-\frac {A \arctan \left (\frac {3 A}{A +B -C}-\frac {3 B}{A +B -C}+\frac {C}{A +B -C}\right )}{2}+\frac {B \arctan \left (\frac {5 A^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}-\frac {8 A x B}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {2 A C x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {5 B^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}-\frac {4 B C x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}+\frac {C^{2} x}{5 A^{2}-8 A B +2 A C +5 B^{2}-4 B C +C^{2}}\right )}{2}-\frac {A \ln \left (10 A^{2} x^{2}-16 B \,x^{2} A +4 A C \,x^{2}+10 B^{2} x^{2}-8 B C \,x^{2}+2 C^{2} x^{2}+10 A^{2}-16 A B +4 A C +10 B^{2}-8 B C +2 C^{2}\right )}{4}+\frac {B \ln \left (10 A^{2} x^{2}-16 B \,x^{2} A +4 A C \,x^{2}+10 B^{2} x^{2}-8 B C \,x^{2}+2 C^{2} x^{2}+10 A^{2}-16 A B +4 A C +10 B^{2}-8 B C +2 C^{2}\right )}{4}+\frac {C \ln \left (10 A^{2} x^{2}-16 B \,x^{2} A +4 A C \,x^{2}+10 B^{2} x^{2}-8 B C \,x^{2}+2 C^{2} x^{2}+10 A^{2}-16 A B +4 A C +10 B^{2}-8 B C +2 C^{2}\right )}{4}+\frac {C \arctan \left (\frac {3 A}{A +B -C}-\frac {3 B}{A +B -C}+\frac {C}{A +B -C}\right )}{2}\) | \(980\) |
Input:
int((C*x^2+B*x+A)/(x^3+x^2+x+1),x,method=_RETURNVERBOSE)
Output:
1/4*(-A+B+C)*ln(x^2+1)+1/2*(A+B-C)*arctan(x)+(1/2*A-1/2*B+1/2*C)*ln(x+1)
Time = 0.08 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.87 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\frac {1}{2} \, {\left (A + B - C\right )} \arctan \left (x\right ) - \frac {1}{4} \, {\left (A - B - C\right )} \log \left (x^{2} + 1\right ) + \frac {1}{2} \, {\left (A - B + C\right )} \log \left (x + 1\right ) \] Input:
integrate((C*x^2+B*x+A)/(x^3+x^2+x+1),x, algorithm="fricas")
Output:
1/2*(A + B - C)*arctan(x) - 1/4*(A - B - C)*log(x^2 + 1) + 1/2*(A - B + C) *log(x + 1)
Result contains complex when optimal does not.
Time = 4.19 (sec) , antiderivative size = 925, normalized size of antiderivative = 20.56 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\text {Too large to display} \] Input:
integrate((C*x**2+B*x+A)/(x**3+x**2+x+1),x)
Output:
(A - B + C)*log(x + (3*A**3 - 9*A**2*B - A**2*C + 6*A**2*(A - B + C) + 11* A*B**2 - 6*A*B*C - 4*A*B*(A - B + C) + A*C**2 + 4*A*C*(A - B + C) - 4*A*(A - B + C)**2 - B**3 - 3*B**2*C + 2*B**2*(A - B + C) + 7*B*C**2 - 12*B*C*(A - B + C) + 8*B*(A - B + C)**2 - 3*C**3 + 6*C**2*(A - B + C) - 4*C*(A - B + C)**2)/(5*A**3 - 3*A**2*B - 3*A**2*C - 3*A*B**2 + 6*A*B*C - A*C**2 + 5*B **3 - 9*B**2*C + 5*B*C**2 - C**3))/2 + (-A/4 + B/4 + C/4 - I*(A + B - C)/4 )*log(x + (3*A**3 - 9*A**2*B - A**2*C + 12*A**2*(-A/4 + B/4 + C/4 - I*(A + B - C)/4) + 11*A*B**2 - 6*A*B*C - 8*A*B*(-A/4 + B/4 + C/4 - I*(A + B - C) /4) + A*C**2 + 8*A*C*(-A/4 + B/4 + C/4 - I*(A + B - C)/4) - 16*A*(-A/4 + B /4 + C/4 - I*(A + B - C)/4)**2 - B**3 - 3*B**2*C + 4*B**2*(-A/4 + B/4 + C/ 4 - I*(A + B - C)/4) + 7*B*C**2 - 24*B*C*(-A/4 + B/4 + C/4 - I*(A + B - C) /4) + 32*B*(-A/4 + B/4 + C/4 - I*(A + B - C)/4)**2 - 3*C**3 + 12*C**2*(-A/ 4 + B/4 + C/4 - I*(A + B - C)/4) - 16*C*(-A/4 + B/4 + C/4 - I*(A + B - C)/ 4)**2)/(5*A**3 - 3*A**2*B - 3*A**2*C - 3*A*B**2 + 6*A*B*C - A*C**2 + 5*B** 3 - 9*B**2*C + 5*B*C**2 - C**3)) + (-A/4 + B/4 + C/4 + I*(A + B - C)/4)*lo g(x + (3*A**3 - 9*A**2*B - A**2*C + 12*A**2*(-A/4 + B/4 + C/4 + I*(A + B - C)/4) + 11*A*B**2 - 6*A*B*C - 8*A*B*(-A/4 + B/4 + C/4 + I*(A + B - C)/4) + A*C**2 + 8*A*C*(-A/4 + B/4 + C/4 + I*(A + B - C)/4) - 16*A*(-A/4 + B/4 + C/4 + I*(A + B - C)/4)**2 - B**3 - 3*B**2*C + 4*B**2*(-A/4 + B/4 + C/4 + I*(A + B - C)/4) + 7*B*C**2 - 24*B*C*(-A/4 + B/4 + C/4 + I*(A + B - C)/...
Time = 0.12 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.87 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\frac {1}{2} \, {\left (A + B - C\right )} \arctan \left (x\right ) - \frac {1}{4} \, {\left (A - B - C\right )} \log \left (x^{2} + 1\right ) + \frac {1}{2} \, {\left (A - B + C\right )} \log \left (x + 1\right ) \] Input:
integrate((C*x^2+B*x+A)/(x^3+x^2+x+1),x, algorithm="maxima")
Output:
1/2*(A + B - C)*arctan(x) - 1/4*(A - B - C)*log(x^2 + 1) + 1/2*(A - B + C) *log(x + 1)
Time = 0.12 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.89 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\frac {1}{2} \, {\left (A + B - C\right )} \arctan \left (x\right ) - \frac {1}{4} \, {\left (A - B - C\right )} \log \left (x^{2} + 1\right ) + \frac {1}{2} \, {\left (A - B + C\right )} \log \left ({\left | x + 1 \right |}\right ) \] Input:
integrate((C*x^2+B*x+A)/(x^3+x^2+x+1),x, algorithm="giac")
Output:
1/2*(A + B - C)*arctan(x) - 1/4*(A - B - C)*log(x^2 + 1) + 1/2*(A - B + C) *log(abs(x + 1))
Time = 0.10 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.33 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\ln \left (x+1\right )\,\left (\frac {A}{2}-\frac {B}{2}+\frac {C}{2}\right )+\ln \left (x-\mathrm {i}\right )\,\left (A\,\left (-\frac {1}{4}-\frac {1}{4}{}\mathrm {i}\right )+B\,\left (\frac {1}{4}-\frac {1}{4}{}\mathrm {i}\right )+C\,\left (\frac {1}{4}+\frac {1}{4}{}\mathrm {i}\right )\right )+\ln \left (x+1{}\mathrm {i}\right )\,\left (A\,\left (-\frac {1}{4}+\frac {1}{4}{}\mathrm {i}\right )+B\,\left (\frac {1}{4}+\frac {1}{4}{}\mathrm {i}\right )+C\,\left (\frac {1}{4}-\frac {1}{4}{}\mathrm {i}\right )\right ) \] Input:
int((A + B*x + C*x^2)/(x + x^2 + x^3 + 1),x)
Output:
log(x + 1)*(A/2 - B/2 + C/2) + log(x - 1i)*(B*(1/4 - 1i/4) - A*(1/4 + 1i/4 ) + C*(1/4 + 1i/4)) + log(x + 1i)*(B*(1/4 + 1i/4) - A*(1/4 - 1i/4) + C*(1/ 4 - 1i/4))
Time = 0.15 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.42 \[ \int \frac {A+B x+C x^2}{1+x+x^2+x^3} \, dx=\frac {\mathit {atan} \left (x \right ) a}{2}+\frac {\mathit {atan} \left (x \right ) b}{2}-\frac {\mathit {atan} \left (x \right ) c}{2}-\frac {\mathrm {log}\left (x^{2}+1\right ) a}{4}+\frac {\mathrm {log}\left (x^{2}+1\right ) b}{4}+\frac {\mathrm {log}\left (x^{2}+1\right ) c}{4}+\frac {\mathrm {log}\left (x +1\right ) a}{2}-\frac {\mathrm {log}\left (x +1\right ) b}{2}+\frac {\mathrm {log}\left (x +1\right ) c}{2} \] Input:
int((C*x^2+B*x+A)/(x^3+x^2+x+1),x)
Output:
(2*atan(x)*a + 2*atan(x)*b - 2*atan(x)*c - log(x**2 + 1)*a + log(x**2 + 1) *b + log(x**2 + 1)*c + 2*log(x + 1)*a - 2*log(x + 1)*b + 2*log(x + 1)*c)/4