\(\int (a+b x+c x^2) (d+e x+f x^2)^q \, dx\) [168]

Optimal result
Mathematica [C] (warning: unable to verify)
Rubi [A] (warning: unable to verify)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 23, antiderivative size = 200 \[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=-\frac {(c e (2+q)-b f (3+2 q)) \left (d+e x+f x^2\right )^{1+q}}{2 f^2 (1+q) (3+2 q)}+\frac {c x \left (d+e x+f x^2\right )^{1+q}}{f (3+2 q)}-\frac {4^{-1-q} \left (2 c d f-c e^2 (2+q)+f (b e-2 a f) (3+2 q)\right ) (e+2 f x) \left (d+e x+f x^2\right )^q \left (-\frac {f \left (d+e x+f x^2\right )}{e^2-4 d f}\right )^{-q} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-q,\frac {3}{2},\frac {(e+2 f x)^2}{e^2-4 d f}\right )}{f^3 (3+2 q)} \] Output:

-1/2*(c*e*(2+q)-b*f*(3+2*q))*(f*x^2+e*x+d)^(1+q)/f^2/(1+q)/(3+2*q)+c*x*(f* 
x^2+e*x+d)^(1+q)/f/(3+2*q)-4^(-1-q)*(2*c*d*f-c*e^2*(2+q)+f*(-2*a*f+b*e)*(3 
+2*q))*(2*f*x+e)*(f*x^2+e*x+d)^q*hypergeom([1/2, -q],[3/2],(2*f*x+e)^2/(-4 
*d*f+e^2))/f^3/(3+2*q)/((-f*(f*x^2+e*x+d)/(-4*d*f+e^2))^q)
 

Mathematica [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.

Time = 1.40 (sec) , antiderivative size = 409, normalized size of antiderivative = 2.04 \[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\frac {1}{6} (d+x (e+f x))^q \left (3 b x^2 \left (\frac {e-\sqrt {e^2-4 d f}+2 f x}{e-\sqrt {e^2-4 d f}}\right )^{-q} \left (\frac {e+\sqrt {e^2-4 d f}+2 f x}{e+\sqrt {e^2-4 d f}}\right )^{-q} \operatorname {AppellF1}\left (2,-q,-q,3,-\frac {2 f x}{e+\sqrt {e^2-4 d f}},\frac {2 f x}{-e+\sqrt {e^2-4 d f}}\right )+2 c x^3 \left (\frac {e-\sqrt {e^2-4 d f}+2 f x}{e-\sqrt {e^2-4 d f}}\right )^{-q} \left (\frac {e+\sqrt {e^2-4 d f}+2 f x}{e+\sqrt {e^2-4 d f}}\right )^{-q} \operatorname {AppellF1}\left (3,-q,-q,4,-\frac {2 f x}{e+\sqrt {e^2-4 d f}},\frac {2 f x}{-e+\sqrt {e^2-4 d f}}\right )+\frac {3\ 2^q a \left (e-\sqrt {e^2-4 d f}+2 f x\right ) \left (\frac {e+\sqrt {e^2-4 d f}+2 f x}{\sqrt {e^2-4 d f}}\right )^{-q} \operatorname {Hypergeometric2F1}\left (-q,1+q,2+q,\frac {-e+\sqrt {e^2-4 d f}-2 f x}{2 \sqrt {e^2-4 d f}}\right )}{f (1+q)}\right ) \] Input:

Integrate[(a + b*x + c*x^2)*(d + e*x + f*x^2)^q,x]
 

Output:

((d + x*(e + f*x))^q*((3*b*x^2*AppellF1[2, -q, -q, 3, (-2*f*x)/(e + Sqrt[e 
^2 - 4*d*f]), (2*f*x)/(-e + Sqrt[e^2 - 4*d*f])])/(((e - Sqrt[e^2 - 4*d*f] 
+ 2*f*x)/(e - Sqrt[e^2 - 4*d*f]))^q*((e + Sqrt[e^2 - 4*d*f] + 2*f*x)/(e + 
Sqrt[e^2 - 4*d*f]))^q) + (2*c*x^3*AppellF1[3, -q, -q, 4, (-2*f*x)/(e + Sqr 
t[e^2 - 4*d*f]), (2*f*x)/(-e + Sqrt[e^2 - 4*d*f])])/(((e - Sqrt[e^2 - 4*d* 
f] + 2*f*x)/(e - Sqrt[e^2 - 4*d*f]))^q*((e + Sqrt[e^2 - 4*d*f] + 2*f*x)/(e 
 + Sqrt[e^2 - 4*d*f]))^q) + (3*2^q*a*(e - Sqrt[e^2 - 4*d*f] + 2*f*x)*Hyper 
geometric2F1[-q, 1 + q, 2 + q, (-e + Sqrt[e^2 - 4*d*f] - 2*f*x)/(2*Sqrt[e^ 
2 - 4*d*f])])/(f*(1 + q)*((e + Sqrt[e^2 - 4*d*f] + 2*f*x)/Sqrt[e^2 - 4*d*f 
])^q)))/6
 

Rubi [A] (warning: unable to verify)

Time = 0.39 (sec) , antiderivative size = 236, normalized size of antiderivative = 1.18, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2192, 25, 1160, 1096}

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 \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx\)

\(\Big \downarrow \) 2192

\(\displaystyle \frac {\int -\left ((c d-a f (2 q+3)+(c e (q+2)-b f (2 q+3)) x) \left (f x^2+e x+d\right )^q\right )dx}{f (2 q+3)}+\frac {c x \left (d+e x+f x^2\right )^{q+1}}{f (2 q+3)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {c x \left (d+e x+f x^2\right )^{q+1}}{f (2 q+3)}-\frac {\int (c d-a f (2 q+3)+(c e (q+2)-b f (2 q+3)) x) \left (f x^2+e x+d\right )^qdx}{f (2 q+3)}\)

\(\Big \downarrow \) 1160

\(\displaystyle \frac {c x \left (d+e x+f x^2\right )^{q+1}}{f (2 q+3)}-\frac {\frac {\left (f (2 q+3) (b e-2 a f)+2 c d f-c e^2 (q+2)\right ) \int \left (f x^2+e x+d\right )^qdx}{2 f}+\frac {(c e (q+2)-b f (2 q+3)) \left (d+e x+f x^2\right )^{q+1}}{2 f (q+1)}}{f (2 q+3)}\)

\(\Big \downarrow \) 1096

\(\displaystyle \frac {c x \left (d+e x+f x^2\right )^{q+1}}{f (2 q+3)}-\frac {\frac {(c e (q+2)-b f (2 q+3)) \left (d+e x+f x^2\right )^{q+1}}{2 f (q+1)}-\frac {2^q \left (-\frac {-\sqrt {e^2-4 d f}+e+2 f x}{\sqrt {e^2-4 d f}}\right )^{-q-1} \left (d+e x+f x^2\right )^{q+1} \operatorname {Hypergeometric2F1}\left (-q,q+1,q+2,\frac {e+2 f x+\sqrt {e^2-4 d f}}{2 \sqrt {e^2-4 d f}}\right ) \left (f (2 q+3) (b e-2 a f)+2 c d f-c e^2 (q+2)\right )}{f (q+1) \sqrt {e^2-4 d f}}}{f (2 q+3)}\)

Input:

Int[(a + b*x + c*x^2)*(d + e*x + f*x^2)^q,x]
 

Output:

(c*x*(d + e*x + f*x^2)^(1 + q))/(f*(3 + 2*q)) - (((c*e*(2 + q) - b*f*(3 + 
2*q))*(d + e*x + f*x^2)^(1 + q))/(2*f*(1 + q)) - (2^q*(2*c*d*f - c*e^2*(2 
+ q) + f*(b*e - 2*a*f)*(3 + 2*q))*(-((e - Sqrt[e^2 - 4*d*f] + 2*f*x)/Sqrt[ 
e^2 - 4*d*f]))^(-1 - q)*(d + e*x + f*x^2)^(1 + q)*Hypergeometric2F1[-q, 1 
+ q, 2 + q, (e + Sqrt[e^2 - 4*d*f] + 2*f*x)/(2*Sqrt[e^2 - 4*d*f])])/(f*Sqr 
t[e^2 - 4*d*f]*(1 + q)))/(f*(3 + 2*q))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 1096
Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 
 - 4*a*c, 2]}, Simp[(-(a + b*x + c*x^2)^(p + 1)/(q*(p + 1)*((q - b - 2*c*x) 
/(2*q))^(p + 1)))*Hypergeometric2F1[-p, p + 1, p + 2, (b + q + 2*c*x)/(2*q) 
], x]] /; FreeQ[{a, b, c, p}, x] &&  !IntegerQ[4*p] &&  !IntegerQ[3*p]
 

rule 1160
Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol 
] :> Simp[e*((a + b*x + c*x^2)^(p + 1)/(2*c*(p + 1))), x] + Simp[(2*c*d - b 
*e)/(2*c)   Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] 
 && NeQ[p, -1]
 

rule 2192
Int[(Pq_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = 
Expon[Pq, x], e = Coeff[Pq, x, Expon[Pq, x]]}, Simp[e*x^(q - 1)*((a + b*x + 
 c*x^2)^(p + 1)/(c*(q + 2*p + 1))), x] + Simp[1/(c*(q + 2*p + 1))   Int[(a 
+ b*x + c*x^2)^p*ExpandToSum[c*(q + 2*p + 1)*Pq - a*e*(q - 1)*x^(q - 2) - b 
*e*(q + p)*x^(q - 1) - c*e*(q + 2*p + 1)*x^q, x], x], x]] /; FreeQ[{a, b, c 
, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] &&  !LeQ[p, -1]
 
Maple [F]

\[\int \left (c \,x^{2}+b x +a \right ) \left (f \,x^{2}+e x +d \right )^{q}d x\]

Input:

int((c*x^2+b*x+a)*(f*x^2+e*x+d)^q,x)
 

Output:

int((c*x^2+b*x+a)*(f*x^2+e*x+d)^q,x)
 

Fricas [F]

\[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\int { {\left (c x^{2} + b x + a\right )} {\left (f x^{2} + e x + d\right )}^{q} \,d x } \] Input:

integrate((c*x^2+b*x+a)*(f*x^2+e*x+d)^q,x, algorithm="fricas")
 

Output:

integral((c*x^2 + b*x + a)*(f*x^2 + e*x + d)^q, x)
 

Sympy [F]

\[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\int \left (a + b x + c x^{2}\right ) \left (d + e x + f x^{2}\right )^{q}\, dx \] Input:

integrate((c*x**2+b*x+a)*(f*x**2+e*x+d)**q,x)
 

Output:

Integral((a + b*x + c*x**2)*(d + e*x + f*x**2)**q, x)
 

Maxima [F]

\[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\int { {\left (c x^{2} + b x + a\right )} {\left (f x^{2} + e x + d\right )}^{q} \,d x } \] Input:

integrate((c*x^2+b*x+a)*(f*x^2+e*x+d)^q,x, algorithm="maxima")
 

Output:

integrate((c*x^2 + b*x + a)*(f*x^2 + e*x + d)^q, x)
 

Giac [F]

\[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\int { {\left (c x^{2} + b x + a\right )} {\left (f x^{2} + e x + d\right )}^{q} \,d x } \] Input:

integrate((c*x^2+b*x+a)*(f*x^2+e*x+d)^q,x, algorithm="giac")
 

Output:

integrate((c*x^2 + b*x + a)*(f*x^2 + e*x + d)^q, x)
 

Mupad [F(-1)]

Timed out. \[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\int \left (c\,x^2+b\,x+a\right )\,{\left (f\,x^2+e\,x+d\right )}^q \,d x \] Input:

int((a + b*x + c*x^2)*(d + e*x + f*x^2)^q,x)
 

Output:

int((a + b*x + c*x^2)*(d + e*x + f*x^2)^q, x)
 

Reduce [F]

\[ \int \left (a+b x+c x^2\right ) \left (d+e x+f x^2\right )^q \, dx=\text {too large to display} \] Input:

int((c*x^2+b*x+a)*(f*x^2+e*x+d)^q,x)
 

Output:

(8*(d + e*x + f*x**2)**q*a*d*f**2*q**2 + 20*(d + e*x + f*x**2)**q*a*d*f**2 
*q + 12*(d + e*x + f*x**2)**q*a*d*f**2 + 4*(d + e*x + f*x**2)**q*a*e*f**2* 
q**2*x + 10*(d + e*x + f*x**2)**q*a*e*f**2*q*x + 6*(d + e*x + f*x**2)**q*a 
*e*f**2*x - 2*(d + e*x + f*x**2)**q*b*d*e*f*q - 3*(d + e*x + f*x**2)**q*b* 
d*e*f + 2*(d + e*x + f*x**2)**q*b*e**2*f*q**2*x + 3*(d + e*x + f*x**2)**q* 
b*e**2*f*q*x + 4*(d + e*x + f*x**2)**q*b*e*f**2*q**2*x**2 + 8*(d + e*x + f 
*x**2)**q*b*e*f**2*q*x**2 + 3*(d + e*x + f*x**2)**q*b*e*f**2*x**2 - 4*(d + 
 e*x + f*x**2)**q*c*d**2*f*q - 4*(d + e*x + f*x**2)**q*c*d**2*f + (d + e*x 
 + f*x**2)**q*c*d*e**2*q + 2*(d + e*x + f*x**2)**q*c*d*e**2 + 4*(d + e*x + 
 f*x**2)**q*c*d*e*f*q**2*x + 4*(d + e*x + f*x**2)**q*c*d*e*f*q*x - (d + e* 
x + f*x**2)**q*c*e**3*q**2*x - 2*(d + e*x + f*x**2)**q*c*e**3*q*x + 2*(d + 
 e*x + f*x**2)**q*c*e**2*f*q**2*x**2 + (d + e*x + f*x**2)**q*c*e**2*f*q*x* 
*2 + 4*(d + e*x + f*x**2)**q*c*e*f**2*q**2*x**3 + 6*(d + e*x + f*x**2)**q* 
c*e*f**2*q*x**3 + 2*(d + e*x + f*x**2)**q*c*e*f**2*x**3 - 64*int(((d + e*x 
 + f*x**2)**q*x)/(4*d*q**2 + 8*d*q + 3*d + 4*e*q**2*x + 8*e*q*x + 3*e*x + 
4*f*q**2*x**2 + 8*f*q*x**2 + 3*f*x**2),x)*a*d*f**3*q**5 - 288*int(((d + e* 
x + f*x**2)**q*x)/(4*d*q**2 + 8*d*q + 3*d + 4*e*q**2*x + 8*e*q*x + 3*e*x + 
 4*f*q**2*x**2 + 8*f*q*x**2 + 3*f*x**2),x)*a*d*f**3*q**4 - 464*int(((d + e 
*x + f*x**2)**q*x)/(4*d*q**2 + 8*d*q + 3*d + 4*e*q**2*x + 8*e*q*x + 3*e*x 
+ 4*f*q**2*x**2 + 8*f*q*x**2 + 3*f*x**2),x)*a*d*f**3*q**3 - 312*int(((d...