Integrand size = 18, antiderivative size = 110 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=e^2 x+\frac {\left (2 d^2-2 \left (3-\sqrt {5}\right ) d e+\left (7-3 \sqrt {5}\right ) e^2\right ) \log \left (3-\sqrt {5}+2 x\right )}{2 \sqrt {5}}-\frac {\left (2 d^2-2 \left (3+\sqrt {5}\right ) d e+\left (7+3 \sqrt {5}\right ) e^2\right ) \log \left (3+\sqrt {5}+2 x\right )}{2 \sqrt {5}} \] Output:
e^2*x+1/10*(2*d^2-2*(3-5^(1/2))*d*e+(7-3*5^(1/2))*e^2)*ln(3-5^(1/2)+2*x)*5 ^(1/2)-1/10*(2*d^2-2*(3+5^(1/2))*d*e+(7+3*5^(1/2))*e^2)*ln(3+5^(1/2)+2*x)* 5^(1/2)
Time = 0.03 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.57 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=e^2 x-\frac {\left (2 d^2-6 d e+7 e^2\right ) \text {arctanh}\left (\frac {3+2 x}{\sqrt {5}}\right )}{\sqrt {5}}+\frac {1}{2} \left (2 d e-3 e^2\right ) \log \left (1+3 x+x^2\right ) \] Input:
Integrate[(d + e*x)^2/(1 + 3*x + x^2),x]
Output:
e^2*x - ((2*d^2 - 6*d*e + 7*e^2)*ArcTanh[(3 + 2*x)/Sqrt[5]])/Sqrt[5] + ((2 *d*e - 3*e^2)*Log[1 + 3*x + x^2])/2
Time = 0.30 (sec) , antiderivative size = 110, 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.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)^2}{x^2+3 x+1} \, dx\) |
\(\Big \downarrow \) 1141 |
\(\displaystyle \int \left (\frac {2 d^2-2 \left (3-\sqrt {5}\right ) d e+\left (7-3 \sqrt {5}\right ) e^2}{\sqrt {5} \left (2 x-\sqrt {5}+3\right )}-\frac {2 d^2-2 \left (3+\sqrt {5}\right ) d e+\left (7+3 \sqrt {5}\right ) e^2}{\sqrt {5} \left (2 x+\sqrt {5}+3\right )}+e^2\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\left (2 d^2-2 \left (3-\sqrt {5}\right ) d e+\left (7-3 \sqrt {5}\right ) e^2\right ) \log \left (2 x-\sqrt {5}+3\right )}{2 \sqrt {5}}-\frac {\left (2 d^2-2 \left (3+\sqrt {5}\right ) d e+\left (7+3 \sqrt {5}\right ) e^2\right ) \log \left (2 x+\sqrt {5}+3\right )}{2 \sqrt {5}}+e^2 x\) |
Input:
Int[(d + e*x)^2/(1 + 3*x + x^2),x]
Output:
e^2*x + ((2*d^2 - 2*(3 - Sqrt[5])*d*e + (7 - 3*Sqrt[5])*e^2)*Log[3 - Sqrt[ 5] + 2*x])/(2*Sqrt[5]) - ((2*d^2 - 2*(3 + Sqrt[5])*d*e + (7 + 3*Sqrt[5])*e ^2)*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.81 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.52
method | result | size |
default | \(e^{2} x +\frac {\left (2 d e -3 e^{2}\right ) \ln \left (x^{2}+3 x +1\right )}{2}-\frac {2 \left (d^{2}-3 d e +\frac {7}{2} e^{2}\right ) \operatorname {arctanh}\left (\frac {\left (2 x +3\right ) \sqrt {5}}{5}\right ) \sqrt {5}}{5}\) | \(57\) |
risch | \(e^{2} x +\ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) d e -\frac {3 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) e^{2}}{2}+\frac {\ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, d^{2}}{5}-\frac {3 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, d e}{5}+\frac {7 \ln \left (-2 \sqrt {5}\, x -3 \sqrt {5}+5\right ) \sqrt {5}\, e^{2}}{10}+\ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) d e -\frac {3 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) e^{2}}{2}-\frac {\ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, d^{2}}{5}+\frac {3 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, d e}{5}-\frac {7 \ln \left (2 \sqrt {5}\, x +3 \sqrt {5}+5\right ) \sqrt {5}\, e^{2}}{10}\) | \(209\) |
Input:
int((e*x+d)^2/(x^2+3*x+1),x,method=_RETURNVERBOSE)
Output:
e^2*x+1/2*(2*d*e-3*e^2)*ln(x^2+3*x+1)-2/5*(d^2-3*d*e+7/2*e^2)*arctanh(1/5* (2*x+3)*5^(1/2))*5^(1/2)
Time = 0.13 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.72 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=e^{2} x + \frac {1}{10} \, \sqrt {5} {\left (2 \, d^{2} - 6 \, d e + 7 \, e^{2}\right )} \log \left (\frac {2 \, x^{2} - \sqrt {5} {\left (2 \, x + 3\right )} + 6 \, x + 7}{x^{2} + 3 \, x + 1}\right ) + \frac {1}{2} \, {\left (2 \, d e - 3 \, e^{2}\right )} \log \left (x^{2} + 3 \, x + 1\right ) \] Input:
integrate((e*x+d)^2/(x^2+3*x+1),x, algorithm="fricas")
Output:
e^2*x + 1/10*sqrt(5)*(2*d^2 - 6*d*e + 7*e^2)*log((2*x^2 - sqrt(5)*(2*x + 3 ) + 6*x + 7)/(x^2 + 3*x + 1)) + 1/2*(2*d*e - 3*e^2)*log(x^2 + 3*x + 1)
Time = 0.27 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.85 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=e^{2} x + \left (\frac {e \left (2 d - 3 e\right )}{2} - \frac {\sqrt {5} \cdot \left (2 d^{2} - 6 d e + 7 e^{2}\right )}{10}\right ) \log {\left (x + \frac {3 d^{2} - 4 d e + 3 e^{2} - \frac {5 e \left (2 d - 3 e\right )}{2} + \frac {\sqrt {5} \cdot \left (2 d^{2} - 6 d e + 7 e^{2}\right )}{2}}{2 d^{2} - 6 d e + 7 e^{2}} \right )} + \left (\frac {e \left (2 d - 3 e\right )}{2} + \frac {\sqrt {5} \cdot \left (2 d^{2} - 6 d e + 7 e^{2}\right )}{10}\right ) \log {\left (x + \frac {3 d^{2} - 4 d e + 3 e^{2} - \frac {5 e \left (2 d - 3 e\right )}{2} - \frac {\sqrt {5} \cdot \left (2 d^{2} - 6 d e + 7 e^{2}\right )}{2}}{2 d^{2} - 6 d e + 7 e^{2}} \right )} \] Input:
integrate((e*x+d)**2/(x**2+3*x+1),x)
Output:
e**2*x + (e*(2*d - 3*e)/2 - sqrt(5)*(2*d**2 - 6*d*e + 7*e**2)/10)*log(x + (3*d**2 - 4*d*e + 3*e**2 - 5*e*(2*d - 3*e)/2 + sqrt(5)*(2*d**2 - 6*d*e + 7 *e**2)/2)/(2*d**2 - 6*d*e + 7*e**2)) + (e*(2*d - 3*e)/2 + sqrt(5)*(2*d**2 - 6*d*e + 7*e**2)/10)*log(x + (3*d**2 - 4*d*e + 3*e**2 - 5*e*(2*d - 3*e)/2 - sqrt(5)*(2*d**2 - 6*d*e + 7*e**2)/2)/(2*d**2 - 6*d*e + 7*e**2))
Time = 0.13 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.63 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=e^{2} x + \frac {1}{10} \, \sqrt {5} {\left (2 \, d^{2} - 6 \, d e + 7 \, e^{2}\right )} \log \left (\frac {2 \, x - \sqrt {5} + 3}{2 \, x + \sqrt {5} + 3}\right ) + \frac {1}{2} \, {\left (2 \, d e - 3 \, e^{2}\right )} \log \left (x^{2} + 3 \, x + 1\right ) \] Input:
integrate((e*x+d)^2/(x^2+3*x+1),x, algorithm="maxima")
Output:
e^2*x + 1/10*sqrt(5)*(2*d^2 - 6*d*e + 7*e^2)*log((2*x - sqrt(5) + 3)/(2*x + sqrt(5) + 3)) + 1/2*(2*d*e - 3*e^2)*log(x^2 + 3*x + 1)
Time = 0.39 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.65 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=e^{2} x + \frac {1}{10} \, \sqrt {5} {\left (2 \, d^{2} - 6 \, d e + 7 \, e^{2}\right )} \log \left (\frac {{\left | 2 \, x - \sqrt {5} + 3 \right |}}{{\left | 2 \, x + \sqrt {5} + 3 \right |}}\right ) + \frac {1}{2} \, {\left (2 \, d e - 3 \, e^{2}\right )} \log \left ({\left | x^{2} + 3 \, x + 1 \right |}\right ) \] Input:
integrate((e*x+d)^2/(x^2+3*x+1),x, algorithm="giac")
Output:
e^2*x + 1/10*sqrt(5)*(2*d^2 - 6*d*e + 7*e^2)*log(abs(2*x - sqrt(5) + 3)/ab s(2*x + sqrt(5) + 3)) + 1/2*(2*d*e - 3*e^2)*log(abs(x^2 + 3*x + 1))
Time = 5.72 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.84 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=\ln \left (x-\frac {\sqrt {5}}{2}+\frac {3}{2}\right )\,\left (d\,e+\frac {\sqrt {5}\,d^2}{5}+\frac {7\,\sqrt {5}\,e^2}{10}-\frac {3\,e^2}{2}-\frac {3\,\sqrt {5}\,d\,e}{5}\right )-\ln \left (x+\frac {\sqrt {5}}{2}+\frac {3}{2}\right )\,\left (\frac {\sqrt {5}\,d^2}{5}-d\,e+\frac {7\,\sqrt {5}\,e^2}{10}+\frac {3\,e^2}{2}-\frac {3\,\sqrt {5}\,d\,e}{5}\right )+e^2\,x \] Input:
int((d + e*x)^2/(3*x + x^2 + 1),x)
Output:
log(x - 5^(1/2)/2 + 3/2)*(d*e + (5^(1/2)*d^2)/5 + (7*5^(1/2)*e^2)/10 - (3* e^2)/2 - (3*5^(1/2)*d*e)/5) - log(x + 5^(1/2)/2 + 3/2)*((5^(1/2)*d^2)/5 - d*e + (7*5^(1/2)*e^2)/10 + (3*e^2)/2 - (3*5^(1/2)*d*e)/5) + e^2*x
Time = 0.22 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.38 \[ \int \frac {(d+e x)^2}{1+3 x+x^2} \, dx=\frac {\sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d^{2}}{5}-\frac {3 \sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d e}{5}+\frac {7 \sqrt {5}\, \mathrm {log}\left (-\sqrt {5}+2 x +3\right ) e^{2}}{10}-\frac {\sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) d^{2}}{5}+\frac {3 \sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) d e}{5}-\frac {7 \sqrt {5}\, \mathrm {log}\left (\sqrt {5}+2 x +3\right ) e^{2}}{10}+\mathrm {log}\left (-\sqrt {5}+2 x +3\right ) d e -\frac {3 \,\mathrm {log}\left (-\sqrt {5}+2 x +3\right ) e^{2}}{2}+\mathrm {log}\left (\sqrt {5}+2 x +3\right ) d e -\frac {3 \,\mathrm {log}\left (\sqrt {5}+2 x +3\right ) e^{2}}{2}+e^{2} x \] Input:
int((e*x+d)^2/(x^2+3*x+1),x)
Output:
(2*sqrt(5)*log( - sqrt(5) + 2*x + 3)*d**2 - 6*sqrt(5)*log( - sqrt(5) + 2*x + 3)*d*e + 7*sqrt(5)*log( - sqrt(5) + 2*x + 3)*e**2 - 2*sqrt(5)*log(sqrt( 5) + 2*x + 3)*d**2 + 6*sqrt(5)*log(sqrt(5) + 2*x + 3)*d*e - 7*sqrt(5)*log( sqrt(5) + 2*x + 3)*e**2 + 10*log( - sqrt(5) + 2*x + 3)*d*e - 15*log( - sqr t(5) + 2*x + 3)*e**2 + 10*log(sqrt(5) + 2*x + 3)*d*e - 15*log(sqrt(5) + 2* x + 3)*e**2 + 10*e**2*x)/10