Integrand size = 20, antiderivative size = 101 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\frac {e^2 x}{c}-\frac {\left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^2 \sqrt {b^2-4 a c}}+\frac {e (2 c d-b e) \log \left (a+b x+c x^2\right )}{2 c^2} \] Output:
e^2*x/c-(2*c^2*d^2+b^2*e^2-2*c*e*(a*e+b*d))*arctanh((2*c*x+b)/(-4*a*c+b^2) ^(1/2))/c^2/(-4*a*c+b^2)^(1/2)+1/2*e*(-b*e+2*c*d)*ln(c*x^2+b*x+a)/c^2
Time = 0.05 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\frac {2 c e^2 x+\frac {2 \left (2 c^2 d^2+b^2 e^2-2 c e (b d+a e)\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+e (2 c d-b e) \log (a+x (b+c x))}{2 c^2} \] Input:
Integrate[(d + e*x)^2/(a + b*x + c*x^2),x]
Output:
(2*c*e^2*x + (2*(2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*ArcTan[(b + 2*c* x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + e*(2*c*d - b*e)*Log[a + x*(b + c*x)])/(2*c^2)
Time = 0.28 (sec) , antiderivative size = 101, 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.100, Rules used = {1143, 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}{a+b x+c x^2} \, dx\) |
\(\Big \downarrow \) 1143 |
\(\displaystyle \int \left (\frac {-a e^2+e x (2 c d-b e)+c d^2}{c \left (a+b x+c x^2\right )}+\frac {e^2}{c}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (-2 c e (a e+b d)+b^2 e^2+2 c^2 d^2\right )}{c^2 \sqrt {b^2-4 a c}}+\frac {e (2 c d-b e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac {e^2 x}{c}\) |
Input:
Int[(d + e*x)^2/(a + b*x + c*x^2),x]
Output:
(e^2*x)/c - ((2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*ArcTanh[(b + 2*c*x) /Sqrt[b^2 - 4*a*c]])/(c^2*Sqrt[b^2 - 4*a*c]) + (e*(2*c*d - b*e)*Log[a + b* x + c*x^2])/(2*c^2)
Int[((d_.) + (e_.)*(x_))^(m_)/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[m, 1]
Time = 1.00 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.06
method | result | size |
default | \(\frac {e^{2} x}{c}+\frac {\frac {\left (-b \,e^{2}+2 d e c \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-a \,e^{2}+c \,d^{2}-\frac {\left (-b \,e^{2}+2 d e c \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{c}\) | \(107\) |
risch | \(\text {Expression too large to display}\) | \(1969\) |
Input:
int((e*x+d)^2/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
Output:
e^2*x/c+1/c*(1/2*(-b*e^2+2*c*d*e)/c*ln(c*x^2+b*x+a)+2*(-a*e^2+c*d^2-1/2*(- b*e^2+2*c*d*e)*b/c)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)))
Time = 0.08 (sec) , antiderivative size = 324, normalized size of antiderivative = 3.21 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\left [\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} e^{2} x - {\left (2 \, c^{2} d^{2} - 2 \, b c d e + {\left (b^{2} - 2 \, a c\right )} e^{2}\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + {\left (2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d e - {\left (b^{3} - 4 \, a b c\right )} e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, \frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} e^{2} x - 2 \, {\left (2 \, c^{2} d^{2} - 2 \, b c d e + {\left (b^{2} - 2 \, a c\right )} e^{2}\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + {\left (2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d e - {\left (b^{3} - 4 \, a b c\right )} e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\right ] \] Input:
integrate((e*x+d)^2/(c*x^2+b*x+a),x, algorithm="fricas")
Output:
[1/2*(2*(b^2*c - 4*a*c^2)*e^2*x - (2*c^2*d^2 - 2*b*c*d*e + (b^2 - 2*a*c)*e ^2)*sqrt(b^2 - 4*a*c)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a)) + (2*(b^2*c - 4*a*c^2)*d*e - (b^3 - 4*a*b*c)*e^2)*log(c*x^2 + b*x + a))/(b^2*c^2 - 4*a*c^3), 1/2*(2*(b^2*c - 4*a*c^2)*e^2*x - 2*(2*c^2*d^2 - 2*b*c*d*e + (b^2 - 2*a*c)*e^2)*sqrt(-b^2 + 4*a*c)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) + (2*(b^2*c - 4*a*c^2)*d*e - (b^3 - 4*a*b*c)*e^2)*log(c*x^2 + b*x + a))/(b^2*c^2 - 4*a *c^3)]
Leaf count of result is larger than twice the leaf count of optimal. 588 vs. \(2 (95) = 190\).
Time = 1.12 (sec) , antiderivative size = 588, normalized size of antiderivative = 5.82 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\left (- \frac {e \left (b e - 2 c d\right )}{2 c^{2}} - \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- a b e^{2} - 4 a c^{2} \left (- \frac {e \left (b e - 2 c d\right )}{2 c^{2}} - \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )}\right ) + 4 a c d e + b^{2} c \left (- \frac {e \left (b e - 2 c d\right )}{2 c^{2}} - \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )}\right ) - b c d^{2}}{2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}} \right )} + \left (- \frac {e \left (b e - 2 c d\right )}{2 c^{2}} + \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- a b e^{2} - 4 a c^{2} \left (- \frac {e \left (b e - 2 c d\right )}{2 c^{2}} + \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )}\right ) + 4 a c d e + b^{2} c \left (- \frac {e \left (b e - 2 c d\right )}{2 c^{2}} + \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )}\right ) - b c d^{2}}{2 a c e^{2} - b^{2} e^{2} + 2 b c d e - 2 c^{2} d^{2}} \right )} + \frac {e^{2} x}{c} \] Input:
integrate((e*x+d)**2/(c*x**2+b*x+a),x)
Output:
(-e*(b*e - 2*c*d)/(2*c**2) - sqrt(-4*a*c + b**2)*(2*a*c*e**2 - b**2*e**2 + 2*b*c*d*e - 2*c**2*d**2)/(2*c**2*(4*a*c - b**2)))*log(x + (-a*b*e**2 - 4* a*c**2*(-e*(b*e - 2*c*d)/(2*c**2) - sqrt(-4*a*c + b**2)*(2*a*c*e**2 - b**2 *e**2 + 2*b*c*d*e - 2*c**2*d**2)/(2*c**2*(4*a*c - b**2))) + 4*a*c*d*e + b* *2*c*(-e*(b*e - 2*c*d)/(2*c**2) - sqrt(-4*a*c + b**2)*(2*a*c*e**2 - b**2*e **2 + 2*b*c*d*e - 2*c**2*d**2)/(2*c**2*(4*a*c - b**2))) - b*c*d**2)/(2*a*c *e**2 - b**2*e**2 + 2*b*c*d*e - 2*c**2*d**2)) + (-e*(b*e - 2*c*d)/(2*c**2) + sqrt(-4*a*c + b**2)*(2*a*c*e**2 - b**2*e**2 + 2*b*c*d*e - 2*c**2*d**2)/ (2*c**2*(4*a*c - b**2)))*log(x + (-a*b*e**2 - 4*a*c**2*(-e*(b*e - 2*c*d)/( 2*c**2) + sqrt(-4*a*c + b**2)*(2*a*c*e**2 - b**2*e**2 + 2*b*c*d*e - 2*c**2 *d**2)/(2*c**2*(4*a*c - b**2))) + 4*a*c*d*e + b**2*c*(-e*(b*e - 2*c*d)/(2* c**2) + sqrt(-4*a*c + b**2)*(2*a*c*e**2 - b**2*e**2 + 2*b*c*d*e - 2*c**2*d **2)/(2*c**2*(4*a*c - b**2))) - b*c*d**2)/(2*a*c*e**2 - b**2*e**2 + 2*b*c* d*e - 2*c**2*d**2)) + e**2*x/c
Exception generated. \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((e*x+d)^2/(c*x^2+b*x+a),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` for more deta
Time = 0.36 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.01 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\frac {e^{2} x}{c} + \frac {{\left (2 \, c d e - b e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} + \frac {{\left (2 \, c^{2} d^{2} - 2 \, b c d e + b^{2} e^{2} - 2 \, a c e^{2}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{2}} \] Input:
integrate((e*x+d)^2/(c*x^2+b*x+a),x, algorithm="giac")
Output:
e^2*x/c + 1/2*(2*c*d*e - b*e^2)*log(c*x^2 + b*x + a)/c^2 + (2*c^2*d^2 - 2* b*c*d*e + b^2*e^2 - 2*a*c*e^2)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/(sqr t(-b^2 + 4*a*c)*c^2)
Time = 5.82 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.46 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\frac {e^2\,x}{c}+\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (b^3\,e^2-2\,d\,b^2\,c\,e-4\,a\,b\,c\,e^2+8\,a\,d\,c^2\,e\right )}{2\,\left (4\,a\,c^3-b^2\,c^2\right )}+\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (b^2\,e^2-2\,b\,c\,d\,e+2\,c^2\,d^2-2\,a\,c\,e^2\right )}{c^2\,\sqrt {4\,a\,c-b^2}} \] Input:
int((d + e*x)^2/(a + b*x + c*x^2),x)
Output:
(e^2*x)/c + (log(a + b*x + c*x^2)*(b^3*e^2 - 4*a*b*c*e^2 + 8*a*c^2*d*e - 2 *b^2*c*d*e))/(2*(4*a*c^3 - b^2*c^2)) + (atan(b/(4*a*c - b^2)^(1/2) + (2*c* x)/(4*a*c - b^2)^(1/2))*(b^2*e^2 + 2*c^2*d^2 - 2*a*c*e^2 - 2*b*c*d*e))/(c^ 2*(4*a*c - b^2)^(1/2))
Time = 0.20 (sec) , antiderivative size = 270, normalized size of antiderivative = 2.67 \[ \int \frac {(d+e x)^2}{a+b x+c x^2} \, dx=\frac {-4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) a c \,e^{2}+2 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b^{2} e^{2}-4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b c d e +4 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) c^{2} d^{2}-4 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a b c \,e^{2}+8 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a \,c^{2} d e +\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{3} e^{2}-2 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{2} c d e +8 a \,c^{2} e^{2} x -2 b^{2} c \,e^{2} x}{2 c^{2} \left (4 a c -b^{2}\right )} \] Input:
int((e*x+d)^2/(c*x^2+b*x+a),x)
Output:
( - 4*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*c*e**2 + 2 *sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b**2*e**2 - 4*sqr t(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b*c*d*e + 4*sqrt(4*a* c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*c**2*d**2 - 4*log(a + b*x + c*x**2)*a*b*c*e**2 + 8*log(a + b*x + c*x**2)*a*c**2*d*e + log(a + b*x + c *x**2)*b**3*e**2 - 2*log(a + b*x + c*x**2)*b**2*c*d*e + 8*a*c**2*e**2*x - 2*b**2*c*e**2*x)/(2*c**2*(4*a*c - b**2))