Integrand size = 18, antiderivative size = 150 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=3 (d-e) e^2 x+\frac {e^3 x^2}{2}+\frac {\left (2 d^3-6 d e^2+6 e^3-\left (3-\sqrt {5}\right ) e \left (3 d^2-9 d e+8 e^2\right )\right ) \log \left (3-\sqrt {5}+2 x\right )}{2 \sqrt {5}}-\frac {\left (2 d^3-6 d e^2+6 e^3-\left (3+\sqrt {5}\right ) e \left (3 d^2-9 d e+8 e^2\right )\right ) \log \left (3+\sqrt {5}+2 x\right )}{2 \sqrt {5}} \] Output:
3*(d-e)*e^2*x+1/2*e^3*x^2+1/10*(2*d^3-6*d*e^2+6*e^3-(3-5^(1/2))*e*(3*d^2-9 *d*e+8*e^2))*ln(3-5^(1/2)+2*x)*5^(1/2)-1/10*(2*d^3-6*d*e^2+6*e^3-(3+5^(1/2 ))*e*(3*d^2-9*d*e+8*e^2))*ln(3+5^(1/2)+2*x)*5^(1/2)
Time = 0.05 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.57 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=-\frac {\left (2 d^3-9 d^2 e+21 d e^2-18 e^3\right ) \text {arctanh}\left (\frac {3+2 x}{\sqrt {5}}\right )}{\sqrt {5}}+\frac {1}{2} e \left (e (6 d+e (-6+x)) x+\left (3 d^2-9 d e+8 e^2\right ) \log \left (1+3 x+x^2\right )\right ) \] Input:
Integrate[(d + e*x)^3/(1 + 3*x + x^2),x]
Output:
-(((2*d^3 - 9*d^2*e + 21*d*e^2 - 18*e^3)*ArcTanh[(3 + 2*x)/Sqrt[5]])/Sqrt[ 5]) + (e*(e*(6*d + e*(-6 + x))*x + (3*d^2 - 9*d*e + 8*e^2)*Log[1 + 3*x + x ^2]))/2
Time = 0.41 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.08, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1141, 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 {(d+e x)^3}{x^2+3 x+1} \, dx\) |
\(\Big \downarrow \) 1141 |
\(\displaystyle \int \left (\frac {2 d^3-3 \left (3-\sqrt {5}\right ) d^2 e+3 \left (7-3 \sqrt {5}\right ) d e^2-2 \left (9-4 \sqrt {5}\right ) e^3}{\sqrt {5} \left (2 x-\sqrt {5}+3\right )}-\frac {2 d^3-3 \left (3+\sqrt {5}\right ) d^2 e+3 \left (7+3 \sqrt {5}\right ) d e^2-2 \left (9+4 \sqrt {5}\right ) e^3}{\sqrt {5} \left (2 x+\sqrt {5}+3\right )}+3 e^2 (d-e)+e^3 x\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\left (2 d^3-3 \left (3-\sqrt {5}\right ) d^2 e+3 \left (7-3 \sqrt {5}\right ) d e^2-2 \left (9-4 \sqrt {5}\right ) e^3\right ) \log \left (2 x-\sqrt {5}+3\right )}{2 \sqrt {5}}-\frac {\left (2 d^3-3 \left (3+\sqrt {5}\right ) d^2 e+3 \left (7+3 \sqrt {5}\right ) d e^2-2 \left (9+4 \sqrt {5}\right ) e^3\right ) \log \left (2 x+\sqrt {5}+3\right )}{2 \sqrt {5}}+3 e^2 x (d-e)+\frac {e^3 x^2}{2}\) |
Input:
Int[(d + e*x)^3/(1 + 3*x + x^2),x]
Output:
3*(d - e)*e^2*x + (e^3*x^2)/2 + ((2*d^3 - 3*(3 - Sqrt[5])*d^2*e + 3*(7 - 3 *Sqrt[5])*d*e^2 - 2*(9 - 4*Sqrt[5])*e^3)*Log[3 - Sqrt[5] + 2*x])/(2*Sqrt[5 ]) - ((2*d^3 - 3*(3 + Sqrt[5])*d^2*e + 3*(7 + 3*Sqrt[5])*d*e^2 - 2*(9 + 4* Sqrt[5])*e^3)*Log[3 + Sqrt[5] + 2*x])/(2*Sqrt[5])
Int[((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_ Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[1/c^p Int[ExpandIntegrand[ (d + e*x)^m*(b/2 - q/2 + c*x)^p*(b/2 + q/2 + c*x)^p, x], x], x] /; EqQ[p, - 1] || !FractionalPowerFactorQ[q]] /; FreeQ[{a, b, c, d, e}, x] && ILtQ[p, 0] && IntegerQ[m] && NiceSqrtQ[b^2 - 4*a*c]
Time = 0.82 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.59
method | result | size |
default | \(\frac {e^{3} x^{2}}{2}+3 d \,e^{2} x -3 e^{3} x +\frac {\left (3 d^{2} e -9 d \,e^{2}+8 e^{3}\right ) \ln \left (x^{2}+3 x +1\right )}{2}-\frac {2 \left (d^{3}-\frac {9}{2} d^{2} e +\frac {21}{2} d \,e^{2}-9 e^{3}\right ) \operatorname {arctanh}\left (\frac {\left (2 x +3\right ) \sqrt {5}}{5}\right ) \sqrt {5}}{5}\) | \(89\) |
risch | \(\frac {e^{3} x^{2}}{2}+3 d \,e^{2} x -3 e^{3} x +\frac {3 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) d^{2} e}{2}-\frac {9 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) d \,e^{2}}{2}+4 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) e^{3}-\frac {\ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, d^{3}}{5}+\frac {9 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, d^{2} e}{10}-\frac {21 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, d \,e^{2}}{10}+\frac {9 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, e^{3}}{5}+\frac {3 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) d^{2} e}{2}-\frac {9 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) d \,e^{2}}{2}+4 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) e^{3}+\frac {\ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, d^{3}}{5}-\frac {9 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, d^{2} e}{10}+\frac {21 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, d \,e^{2}}{10}-\frac {9 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, e^{3}}{5}\) | \(321\) |
Input:
int((e*x+d)^3/(x^2+3*x+1),x,method=_RETURNVERBOSE)
Output:
1/2*e^3*x^2+3*d*e^2*x-3*e^3*x+1/2*(3*d^2*e-9*d*e^2+8*e^3)*ln(x^2+3*x+1)-2/ 5*(d^3-9/2*d^2*e+21/2*d*e^2-9*e^3)*arctanh(1/5*(2*x+3)*5^(1/2))*5^(1/2)
Time = 0.19 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.74 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=\frac {1}{2} \, e^{3} x^{2} - \frac {1}{10} \, \sqrt {5} {\left (2 \, d^{3} - 9 \, d^{2} e + 21 \, d e^{2} - 18 \, e^{3}\right )} \log \left (\frac {2 \, x^{2} + \sqrt {5} {\left (2 \, x + 3\right )} + 6 \, x + 7}{x^{2} + 3 \, x + 1}\right ) + 3 \, {\left (d e^{2} - e^{3}\right )} x + \frac {1}{2} \, {\left (3 \, d^{2} e - 9 \, d e^{2} + 8 \, e^{3}\right )} \log \left (x^{2} + 3 \, x + 1\right ) \] Input:
integrate((e*x+d)^3/(x^2+3*x+1),x, algorithm="fricas")
Output:
1/2*e^3*x^2 - 1/10*sqrt(5)*(2*d^3 - 9*d^2*e + 21*d*e^2 - 18*e^3)*log((2*x^ 2 + sqrt(5)*(2*x + 3) + 6*x + 7)/(x^2 + 3*x + 1)) + 3*(d*e^2 - e^3)*x + 1/ 2*(3*d^2*e - 9*d*e^2 + 8*e^3)*log(x^2 + 3*x + 1)
Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (144) = 288\).
Time = 0.40 (sec) , antiderivative size = 309, normalized size of antiderivative = 2.06 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=\frac {e^{3} x^{2}}{2} + x \left (3 d e^{2} - 3 e^{3}\right ) + \left (\frac {e \left (3 d^{2} - 9 d e + 8 e^{2}\right )}{2} - \frac {\sqrt {5} \cdot \left (2 d - 3 e\right ) \left (d^{2} - 3 d e + 6 e^{2}\right )}{10}\right ) \log {\left (x + \frac {3 d^{3} - 6 d^{2} e + 9 d e^{2} - 7 e^{3} - \frac {5 e \left (3 d^{2} - 9 d e + 8 e^{2}\right )}{2} + \frac {\sqrt {5} \cdot \left (2 d - 3 e\right ) \left (d^{2} - 3 d e + 6 e^{2}\right )}{2}}{2 d^{3} - 9 d^{2} e + 21 d e^{2} - 18 e^{3}} \right )} + \left (\frac {e \left (3 d^{2} - 9 d e + 8 e^{2}\right )}{2} + \frac {\sqrt {5} \cdot \left (2 d - 3 e\right ) \left (d^{2} - 3 d e + 6 e^{2}\right )}{10}\right ) \log {\left (x + \frac {3 d^{3} - 6 d^{2} e + 9 d e^{2} - 7 e^{3} - \frac {5 e \left (3 d^{2} - 9 d e + 8 e^{2}\right )}{2} - \frac {\sqrt {5} \cdot \left (2 d - 3 e\right ) \left (d^{2} - 3 d e + 6 e^{2}\right )}{2}}{2 d^{3} - 9 d^{2} e + 21 d e^{2} - 18 e^{3}} \right )} \] Input:
integrate((e*x+d)**3/(x**2+3*x+1),x)
Output:
e**3*x**2/2 + x*(3*d*e**2 - 3*e**3) + (e*(3*d**2 - 9*d*e + 8*e**2)/2 - sqr t(5)*(2*d - 3*e)*(d**2 - 3*d*e + 6*e**2)/10)*log(x + (3*d**3 - 6*d**2*e + 9*d*e**2 - 7*e**3 - 5*e*(3*d**2 - 9*d*e + 8*e**2)/2 + sqrt(5)*(2*d - 3*e)* (d**2 - 3*d*e + 6*e**2)/2)/(2*d**3 - 9*d**2*e + 21*d*e**2 - 18*e**3)) + (e *(3*d**2 - 9*d*e + 8*e**2)/2 + sqrt(5)*(2*d - 3*e)*(d**2 - 3*d*e + 6*e**2) /10)*log(x + (3*d**3 - 6*d**2*e + 9*d*e**2 - 7*e**3 - 5*e*(3*d**2 - 9*d*e + 8*e**2)/2 - sqrt(5)*(2*d - 3*e)*(d**2 - 3*d*e + 6*e**2)/2)/(2*d**3 - 9*d **2*e + 21*d*e**2 - 18*e**3))
Time = 0.11 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.68 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=\frac {1}{2} \, e^{3} x^{2} + \frac {1}{10} \, \sqrt {5} {\left (2 \, d^{3} - 9 \, d^{2} e + 21 \, d e^{2} - 18 \, e^{3}\right )} \log \left (\frac {2 \, x - \sqrt {5} + 3}{2 \, x + \sqrt {5} + 3}\right ) + 3 \, {\left (d e^{2} - e^{3}\right )} x + \frac {1}{2} \, {\left (3 \, d^{2} e - 9 \, d e^{2} + 8 \, e^{3}\right )} \log \left (x^{2} + 3 \, x + 1\right ) \] Input:
integrate((e*x+d)^3/(x^2+3*x+1),x, algorithm="maxima")
Output:
1/2*e^3*x^2 + 1/10*sqrt(5)*(2*d^3 - 9*d^2*e + 21*d*e^2 - 18*e^3)*log((2*x - sqrt(5) + 3)/(2*x + sqrt(5) + 3)) + 3*(d*e^2 - e^3)*x + 1/2*(3*d^2*e - 9 *d*e^2 + 8*e^3)*log(x^2 + 3*x + 1)
Time = 0.39 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.69 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=\frac {1}{2} \, e^{3} x^{2} + 3 \, d e^{2} x - 3 \, e^{3} x + \frac {1}{10} \, \sqrt {5} {\left (2 \, d^{3} - 9 \, d^{2} e + 21 \, d e^{2} - 18 \, e^{3}\right )} \log \left (\frac {{\left | 2 \, x - \sqrt {5} + 3 \right |}}{{\left | 2 \, x + \sqrt {5} + 3 \right |}}\right ) + \frac {1}{2} \, {\left (3 \, d^{2} e - 9 \, d e^{2} + 8 \, e^{3}\right )} \log \left ({\left | x^{2} + 3 \, x + 1 \right |}\right ) \] Input:
integrate((e*x+d)^3/(x^2+3*x+1),x, algorithm="giac")
Output:
1/2*e^3*x^2 + 3*d*e^2*x - 3*e^3*x + 1/10*sqrt(5)*(2*d^3 - 9*d^2*e + 21*d*e ^2 - 18*e^3)*log(abs(2*x - sqrt(5) + 3)/abs(2*x + sqrt(5) + 3)) + 1/2*(3*d ^2*e - 9*d*e^2 + 8*e^3)*log(abs(x^2 + 3*x + 1))
Time = 0.10 (sec) , antiderivative size = 147, normalized size of antiderivative = 0.98 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=\ln \left (x-\frac {\sqrt {5}}{2}+\frac {3}{2}\right )\,\left (\frac {\sqrt {5}\,d^3}{5}-\frac {9\,\sqrt {5}\,e^3}{5}-\frac {9\,d\,e^2}{2}+\frac {3\,d^2\,e}{2}+4\,e^3+\frac {21\,\sqrt {5}\,d\,e^2}{10}-\frac {9\,\sqrt {5}\,d^2\,e}{10}\right )+\ln \left (x+\frac {\sqrt {5}}{2}+\frac {3}{2}\right )\,\left (\frac {9\,\sqrt {5}\,e^3}{5}-\frac {\sqrt {5}\,d^3}{5}-\frac {9\,d\,e^2}{2}+\frac {3\,d^2\,e}{2}+4\,e^3-\frac {21\,\sqrt {5}\,d\,e^2}{10}+\frac {9\,\sqrt {5}\,d^2\,e}{10}\right )+x\,\left (3\,d\,e^2-3\,e^3\right )+\frac {e^3\,x^2}{2} \] Input:
int((d + e*x)^3/(3*x + x^2 + 1),x)
Output:
log(x - 5^(1/2)/2 + 3/2)*((5^(1/2)*d^3)/5 - (9*5^(1/2)*e^3)/5 - (9*d*e^2)/ 2 + (3*d^2*e)/2 + 4*e^3 + (21*5^(1/2)*d*e^2)/10 - (9*5^(1/2)*d^2*e)/10) + log(x + 5^(1/2)/2 + 3/2)*((9*5^(1/2)*e^3)/5 - (5^(1/2)*d^3)/5 - (9*d*e^2)/ 2 + (3*d^2*e)/2 + 4*e^3 - (21*5^(1/2)*d*e^2)/10 + (9*5^(1/2)*d^2*e)/10) + x*(3*d*e^2 - 3*e^3) + (e^3*x^2)/2
Time = 0.20 (sec) , antiderivative size = 242, normalized size of antiderivative = 1.61 \[ \int \frac {(d+e x)^3}{1+3 x+x^2} \, dx=\frac {\sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d^{3}}{5}-\frac {9 \sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d^{2} e}{10}+\frac {21 \sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d \,e^{2}}{10}-\frac {9 \sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) e^{3}}{5}-\frac {\sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) d^{3}}{5}+\frac {9 \sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) d^{2} e}{10}-\frac {21 \sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) d \,e^{2}}{10}+\frac {9 \sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) e^{3}}{5}+\frac {3 \,\mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d^{2} e}{2}-\frac {9 \,\mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d \,e^{2}}{2}+4 \,\mathrm {log}\left (-\sqrt {5}+2 x +3\right ) e^{3}+\frac {3 \,\mathrm {log}\left (\sqrt {5}+2 x +3\right ) d^{2} e}{2}-\frac {9 \,\mathrm {log}\left (\sqrt {5}+2 x +3\right ) d \,e^{2}}{2}+4 \,\mathrm {log}\left (\sqrt {5}+2 x +3\right ) e^{3}+3 d \,e^{2} x +\frac {e^{3} x^{2}}{2}-3 e^{3} x \] Input:
int((e*x+d)^3/(x^2+3*x+1),x)
Output:
(2*sqrt(5)*log( - sqrt(5) + 2*x + 3)*d**3 - 9*sqrt(5)*log( - sqrt(5) + 2*x + 3)*d**2*e + 21*sqrt(5)*log( - sqrt(5) + 2*x + 3)*d*e**2 - 18*sqrt(5)*lo g( - sqrt(5) + 2*x + 3)*e**3 - 2*sqrt(5)*log(sqrt(5) + 2*x + 3)*d**3 + 9*s qrt(5)*log(sqrt(5) + 2*x + 3)*d**2*e - 21*sqrt(5)*log(sqrt(5) + 2*x + 3)*d *e**2 + 18*sqrt(5)*log(sqrt(5) + 2*x + 3)*e**3 + 15*log( - sqrt(5) + 2*x + 3)*d**2*e - 45*log( - sqrt(5) + 2*x + 3)*d*e**2 + 40*log( - sqrt(5) + 2*x + 3)*e**3 + 15*log(sqrt(5) + 2*x + 3)*d**2*e - 45*log(sqrt(5) + 2*x + 3)* d*e**2 + 40*log(sqrt(5) + 2*x + 3)*e**3 + 30*d*e**2*x + 5*e**3*x**2 - 30*e **3*x)/10