Integrand size = 23, antiderivative size = 108 \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\frac {e g x}{c}-\frac {\left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\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 {(c e f+c d g-b e g) \log \left (a+b x+c x^2\right )}{2 c^2} \] Output:
e*g*x/c-(2*c^2*d*f+b^2*e*g-c*(2*a*e*g+b*d*g+b*e*f))*arctanh((2*c*x+b)/(-4* a*c+b^2)^(1/2))/c^2/(-4*a*c+b^2)^(1/2)+1/2*(-b*e*g+c*d*g+c*e*f)*ln(c*x^2+b *x+a)/c^2
Time = 0.08 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00 \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\frac {2 c e g x+\frac {2 \left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+(c e f+c d g-b e g) \log (a+x (b+c x))}{2 c^2} \] Input:
Integrate[((d + e*x)*(f + g*x))/(a + b*x + c*x^2),x]
Output:
(2*c*e*g*x + (2*(2*c^2*d*f + b^2*e*g - c*(b*e*f + b*d*g + 2*a*e*g))*ArcTan [(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + (c*e*f + c*d*g - b* e*g)*Log[a + x*(b + c*x)])/(2*c^2)
Time = 0.50 (sec) , antiderivative size = 108, 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.087, Rules used = {1200, 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) (f+g x)}{a+b x+c x^2} \, dx\) |
\(\Big \downarrow \) 1200 |
\(\displaystyle \int \left (\frac {-a e g+x (-b e g+c d g+c e f)+c d f}{c \left (a+b x+c x^2\right )}+\frac {e g}{c}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (-c (2 a e g+b d g+b e f)+b^2 e g+2 c^2 d f\right )}{c^2 \sqrt {b^2-4 a c}}+\frac {\log \left (a+b x+c x^2\right ) (-b e g+c d g+c e f)}{2 c^2}+\frac {e g x}{c}\) |
Input:
Int[((d + e*x)*(f + g*x))/(a + b*x + c*x^2),x]
Output:
(e*g*x)/c - ((2*c^2*d*f + b^2*e*g - c*(b*e*f + b*d*g + 2*a*e*g))*ArcTanh[( b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^2*Sqrt[b^2 - 4*a*c]) + ((c*e*f + c*d*g - b*e*g)*Log[a + b*x + c*x^2])/(2*c^2)
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_.) + (b_.)* (x_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g* x)^n/(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && In tegersQ[n]
Time = 1.49 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00
method | result | size |
default | \(\frac {e g x}{c}+\frac {\frac {\left (-b e g +c d g +f c e \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-a e g +d f c -\frac {\left (-b e g +c d g +f c e \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}\) | \(108\) |
risch | \(\text {Expression too large to display}\) | \(2878\) |
Input:
int((e*x+d)*(g*x+f)/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
Output:
e*g*x/c+1/c*(1/2*(-b*e*g+c*d*g+c*e*f)/c*ln(c*x^2+b*x+a)+2*(-a*e*g+d*f*c-1/ 2*(-b*e*g+c*d*g+c*e*f)*b/c)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2) ^(1/2)))
Time = 0.10 (sec) , antiderivative size = 364, normalized size of antiderivative = 3.37 \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\left [\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} e g x - \sqrt {b^{2} - 4 \, a c} {\left ({\left (2 \, c^{2} d - b c e\right )} f - {\left (b c d - {\left (b^{2} - 2 \, a c\right )} e\right )} g\right )} \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 ({\left (b^{2} c - 4 \, a c^{2}\right )} e f + {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} d - {\left (b^{3} - 4 \, a b c\right )} e\right )} g\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 g x - 2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (2 \, c^{2} d - b c e\right )} f - {\left (b c d - {\left (b^{2} - 2 \, a c\right )} e\right )} g\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e f + {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} d - {\left (b^{3} - 4 \, a b c\right )} e\right )} g\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)*(g*x+f)/(c*x^2+b*x+a),x, algorithm="fricas")
Output:
[1/2*(2*(b^2*c - 4*a*c^2)*e*g*x - sqrt(b^2 - 4*a*c)*((2*c^2*d - b*c*e)*f - (b*c*d - (b^2 - 2*a*c)*e)*g)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqr t(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a)) + ((b^2*c - 4*a*c^2)*e*f + ((b^2*c - 4*a*c^2)*d - (b^3 - 4*a*b*c)*e)*g)*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*g*x - 2*sqrt(-b^2 + 4*a*c)*((2*c^ 2*d - b*c*e)*f - (b*c*d - (b^2 - 2*a*c)*e)*g)*arctan(-sqrt(-b^2 + 4*a*c)*( 2*c*x + b)/(b^2 - 4*a*c)) + ((b^2*c - 4*a*c^2)*e*f + ((b^2*c - 4*a*c^2)*d - (b^3 - 4*a*b*c)*e)*g)*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. 677 vs. \(2 (110) = 220\).
Time = 1.90 (sec) , antiderivative size = 677, normalized size of antiderivative = 6.27 \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\left (- \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )} - \frac {b e g - c d g - c e f}{2 c^{2}}\right ) \log {\left (x + \frac {- a b e g - 4 a c^{2} \left (- \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )} - \frac {b e g - c d g - c e f}{2 c^{2}}\right ) + 2 a c d g + 2 a c e f + b^{2} c \left (- \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )} - \frac {b e g - c d g - c e f}{2 c^{2}}\right ) - b c d f}{2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f} \right )} + \left (\frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )} - \frac {b e g - c d g - c e f}{2 c^{2}}\right ) \log {\left (x + \frac {- a b e g - 4 a c^{2} \left (\frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )} - \frac {b e g - c d g - c e f}{2 c^{2}}\right ) + 2 a c d g + 2 a c e f + b^{2} c \left (\frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f\right )}{2 c^{2} \cdot \left (4 a c - b^{2}\right )} - \frac {b e g - c d g - c e f}{2 c^{2}}\right ) - b c d f}{2 a c e g - b^{2} e g + b c d g + b c e f - 2 c^{2} d f} \right )} + \frac {e g x}{c} \] Input:
integrate((e*x+d)*(g*x+f)/(c*x**2+b*x+a),x)
Output:
(-sqrt(-4*a*c + b**2)*(2*a*c*e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d *f)/(2*c**2*(4*a*c - b**2)) - (b*e*g - c*d*g - c*e*f)/(2*c**2))*log(x + (- a*b*e*g - 4*a*c**2*(-sqrt(-4*a*c + b**2)*(2*a*c*e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d*f)/(2*c**2*(4*a*c - b**2)) - (b*e*g - c*d*g - c*e*f)/( 2*c**2)) + 2*a*c*d*g + 2*a*c*e*f + b**2*c*(-sqrt(-4*a*c + b**2)*(2*a*c*e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d*f)/(2*c**2*(4*a*c - b**2)) - (b *e*g - c*d*g - c*e*f)/(2*c**2)) - b*c*d*f)/(2*a*c*e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d*f)) + (sqrt(-4*a*c + b**2)*(2*a*c*e*g - b**2*e*g + b *c*d*g + b*c*e*f - 2*c**2*d*f)/(2*c**2*(4*a*c - b**2)) - (b*e*g - c*d*g - c*e*f)/(2*c**2))*log(x + (-a*b*e*g - 4*a*c**2*(sqrt(-4*a*c + b**2)*(2*a*c* e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d*f)/(2*c**2*(4*a*c - b**2)) - (b*e*g - c*d*g - c*e*f)/(2*c**2)) + 2*a*c*d*g + 2*a*c*e*f + b**2*c*(sqrt( -4*a*c + b**2)*(2*a*c*e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d*f)/(2* c**2*(4*a*c - b**2)) - (b*e*g - c*d*g - c*e*f)/(2*c**2)) - b*c*d*f)/(2*a*c *e*g - b**2*e*g + b*c*d*g + b*c*e*f - 2*c**2*d*f)) + e*g*x/c
Exception generated. \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((e*x+d)*(g*x+f)/(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.19 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.98 \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\frac {e g x}{c} + \frac {{\left (c e f + c d g - b e g\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} + \frac {{\left (2 \, c^{2} d f - b c e f - b c d g + b^{2} e g - 2 \, a c e g\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)*(g*x+f)/(c*x^2+b*x+a),x, algorithm="giac")
Output:
e*g*x/c + 1/2*(c*e*f + c*d*g - b*e*g)*log(c*x^2 + b*x + a)/c^2 + (2*c^2*d* f - b*c*e*f - b*c*d*g + b^2*e*g - 2*a*c*e*g)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^2)
Time = 12.14 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.51 \[ \int \frac {(d+e x) (f+g x)}{a+b x+c x^2} \, dx=\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (b^3\,e\,g+4\,a\,c^2\,d\,g+4\,a\,c^2\,e\,f-b^2\,c\,d\,g-b^2\,c\,e\,f-4\,a\,b\,c\,e\,g\right )}{2\,\left (4\,a\,c^3-b^2\,c^2\right )}+\frac {e\,g\,x}{c}-\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (2\,a\,c\,e\,g-b^2\,e\,g-2\,c^2\,d\,f+b\,c\,d\,g+b\,c\,e\,f\right )}{c^2\,\sqrt {4\,a\,c-b^2}} \] Input:
int(((f + g*x)*(d + e*x))/(a + b*x + c*x^2),x)
Output:
(log(a + b*x + c*x^2)*(b^3*e*g + 4*a*c^2*d*g + 4*a*c^2*e*f - b^2*c*d*g - b ^2*c*e*f - 4*a*b*c*e*g))/(2*(4*a*c^3 - b^2*c^2)) + (e*g*x)/c - (atan(b/(4* a*c - b^2)^(1/2) + (2*c*x)/(4*a*c - b^2)^(1/2))*(2*a*c*e*g - b^2*e*g - 2*c ^2*d*f + b*c*d*g + b*c*e*f))/(c^2*(4*a*c - b^2)^(1/2))
Time = 0.24 (sec) , antiderivative size = 339, normalized size of antiderivative = 3.14 \[ \int \frac {(d+e x) (f+g x)}{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 g +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 g -2 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b c d g -2 \sqrt {4 a c -b^{2}}\, \mathit {atan} \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right ) b c e f +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 f -4 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a b c e g +4 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a \,c^{2} d g +4 \,\mathrm {log}\left (c \,x^{2}+b x +a \right ) a \,c^{2} e f +\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{3} e g -\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{2} c d g -\mathrm {log}\left (c \,x^{2}+b x +a \right ) b^{2} c e f +8 a \,c^{2} e g x -2 b^{2} c e g x}{2 c^{2} \left (4 a c -b^{2}\right )} \] Input:
int((e*x+d)*(g*x+f)/(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*g + 2* sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b**2*e*g - 2*sqrt( 4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b*c*d*g - 2*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*b*c*e*f + 4*sqrt(4*a*c - b**2 )*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*c**2*d*f - 4*log(a + b*x + c*x**2)* a*b*c*e*g + 4*log(a + b*x + c*x**2)*a*c**2*d*g + 4*log(a + b*x + c*x**2)*a *c**2*e*f + log(a + b*x + c*x**2)*b**3*e*g - log(a + b*x + c*x**2)*b**2*c* d*g - log(a + b*x + c*x**2)*b**2*c*e*f + 8*a*c**2*e*g*x - 2*b**2*c*e*g*x)/ (2*c**2*(4*a*c - b**2))