\(\int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx\) [117]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [A] (verification not implemented)
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 124 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 (d e-c f)^2 (f g-e h) \sqrt {e+f x}}{f^4}-\frac {2 (d e-c f) (2 d f g-3 d e h+c f h) (e+f x)^{3/2}}{3 f^4}+\frac {2 d (d f g-3 d e h+2 c f h) (e+f x)^{5/2}}{5 f^4}+\frac {2 d^2 h (e+f x)^{7/2}}{7 f^4} \] Output:

2*(-c*f+d*e)^2*(-e*h+f*g)*(f*x+e)^(1/2)/f^4-2/3*(-c*f+d*e)*(c*f*h-3*d*e*h+ 
2*d*f*g)*(f*x+e)^(3/2)/f^4+2/5*d*(2*c*f*h-3*d*e*h+d*f*g)*(f*x+e)^(5/2)/f^4 
+2/7*d^2*h*(f*x+e)^(7/2)/f^4
 

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.06 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \sqrt {e+f x} \left (35 c^2 f^2 (3 f g-2 e h+f h x)+14 c d f \left (8 e^2 h-2 e f (5 g+2 h x)+f^2 x (5 g+3 h x)\right )+d^2 \left (-48 e^3 h+8 e^2 f (7 g+3 h x)+3 f^3 x^2 (7 g+5 h x)-2 e f^2 x (14 g+9 h x)\right )\right )}{105 f^4} \] Input:

Integrate[((c + d*x)^2*(g + h*x))/Sqrt[e + f*x],x]
 

Output:

(2*Sqrt[e + f*x]*(35*c^2*f^2*(3*f*g - 2*e*h + f*h*x) + 14*c*d*f*(8*e^2*h - 
 2*e*f*(5*g + 2*h*x) + f^2*x*(5*g + 3*h*x)) + d^2*(-48*e^3*h + 8*e^2*f*(7* 
g + 3*h*x) + 3*f^3*x^2*(7*g + 5*h*x) - 2*e*f^2*x*(14*g + 9*h*x))))/(105*f^ 
4)
 

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 124, 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.091, Rules used = {86, 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 {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx\)

\(\Big \downarrow \) 86

\(\displaystyle \int \left (\frac {d (e+f x)^{3/2} (2 c f h-3 d e h+d f g)}{f^3}+\frac {\sqrt {e+f x} (c f-d e) (c f h-3 d e h+2 d f g)}{f^3}+\frac {(c f-d e)^2 (f g-e h)}{f^3 \sqrt {e+f x}}+\frac {d^2 h (e+f x)^{5/2}}{f^3}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 d (e+f x)^{5/2} (2 c f h-3 d e h+d f g)}{5 f^4}-\frac {2 (e+f x)^{3/2} (d e-c f) (c f h-3 d e h+2 d f g)}{3 f^4}+\frac {2 \sqrt {e+f x} (d e-c f)^2 (f g-e h)}{f^4}+\frac {2 d^2 h (e+f x)^{7/2}}{7 f^4}\)

Input:

Int[((c + d*x)^2*(g + h*x))/Sqrt[e + f*x],x]
 

Output:

(2*(d*e - c*f)^2*(f*g - e*h)*Sqrt[e + f*x])/f^4 - (2*(d*e - c*f)*(2*d*f*g 
- 3*d*e*h + c*f*h)*(e + f*x)^(3/2))/(3*f^4) + (2*d*(d*f*g - 3*d*e*h + 2*c* 
f*h)*(e + f*x)^(5/2))/(5*f^4) + (2*d^2*h*(e + f*x)^(7/2))/(7*f^4)
 

Defintions of rubi rules used

rule 86
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ 
.), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 
] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p 
+ 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
Maple [A] (verified)

Time = 0.67 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.94

method result size
pseudoelliptic \(-\frac {4 \left (\left (-\frac {3 x^{2} \left (\frac {5 h x}{7}+g \right ) d^{2}}{10}-x c \left (\frac {3 h x}{5}+g \right ) d -\frac {3 c^{2} \left (\frac {h x}{3}+g \right )}{2}\right ) f^{3}+e \left (\frac {2 x \left (\frac {9 h x}{14}+g \right ) d^{2}}{5}+2 c \left (\frac {2 h x}{5}+g \right ) d +h \,c^{2}\right ) f^{2}-\frac {8 \left (\frac {\left (\frac {3 h x}{7}+g \right ) d}{2}+c h \right ) e^{2} d f}{5}+\frac {24 d^{2} e^{3} h}{35}\right ) \sqrt {f x +e}}{3 f^{4}}\) \(117\)
derivativedivides \(\frac {\frac {2 d^{2} h \left (f x +e \right )^{\frac {7}{2}}}{7}+\frac {2 \left (2 d \left (c f -d e \right ) h +d^{2} \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {5}{2}}}{5}+\frac {2 \left (\left (c f -d e \right )^{2} h +2 d \left (c f -d e \right ) \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {3}{2}}}{3}+2 \left (c f -d e \right )^{2} \left (-e h +f g \right ) \sqrt {f x +e}}{f^{4}}\) \(121\)
default \(\frac {\frac {2 d^{2} h \left (f x +e \right )^{\frac {7}{2}}}{7}-\frac {2 \left (-2 d \left (c f -d e \right ) h +d^{2} \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {2 \left (-\left (c f -d e \right )^{2} h +2 d \left (c f -d e \right ) \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {3}{2}}}{3}-2 \left (c f -d e \right )^{2} \left (e h -f g \right ) \sqrt {f x +e}}{f^{4}}\) \(123\)
gosper \(-\frac {2 \sqrt {f x +e}\, \left (-15 d^{2} h \,x^{3} f^{3}-42 c d \,f^{3} h \,x^{2}+18 d^{2} e \,f^{2} h \,x^{2}-21 d^{2} f^{3} g \,x^{2}-35 c^{2} f^{3} h x +56 c d e \,f^{2} h x -70 c d \,f^{3} g x -24 d^{2} e^{2} f h x +28 d^{2} e \,f^{2} g x +70 c^{2} e \,f^{2} h -105 c^{2} g \,f^{3}-112 c d \,e^{2} f h +140 c d e \,f^{2} g +48 d^{2} e^{3} h -56 d^{2} e^{2} f g \right )}{105 f^{4}}\) \(169\)
trager \(-\frac {2 \sqrt {f x +e}\, \left (-15 d^{2} h \,x^{3} f^{3}-42 c d \,f^{3} h \,x^{2}+18 d^{2} e \,f^{2} h \,x^{2}-21 d^{2} f^{3} g \,x^{2}-35 c^{2} f^{3} h x +56 c d e \,f^{2} h x -70 c d \,f^{3} g x -24 d^{2} e^{2} f h x +28 d^{2} e \,f^{2} g x +70 c^{2} e \,f^{2} h -105 c^{2} g \,f^{3}-112 c d \,e^{2} f h +140 c d e \,f^{2} g +48 d^{2} e^{3} h -56 d^{2} e^{2} f g \right )}{105 f^{4}}\) \(169\)
risch \(-\frac {2 \sqrt {f x +e}\, \left (-15 d^{2} h \,x^{3} f^{3}-42 c d \,f^{3} h \,x^{2}+18 d^{2} e \,f^{2} h \,x^{2}-21 d^{2} f^{3} g \,x^{2}-35 c^{2} f^{3} h x +56 c d e \,f^{2} h x -70 c d \,f^{3} g x -24 d^{2} e^{2} f h x +28 d^{2} e \,f^{2} g x +70 c^{2} e \,f^{2} h -105 c^{2} g \,f^{3}-112 c d \,e^{2} f h +140 c d e \,f^{2} g +48 d^{2} e^{3} h -56 d^{2} e^{2} f g \right )}{105 f^{4}}\) \(169\)
orering \(-\frac {2 \sqrt {f x +e}\, \left (-15 d^{2} h \,x^{3} f^{3}-42 c d \,f^{3} h \,x^{2}+18 d^{2} e \,f^{2} h \,x^{2}-21 d^{2} f^{3} g \,x^{2}-35 c^{2} f^{3} h x +56 c d e \,f^{2} h x -70 c d \,f^{3} g x -24 d^{2} e^{2} f h x +28 d^{2} e \,f^{2} g x +70 c^{2} e \,f^{2} h -105 c^{2} g \,f^{3}-112 c d \,e^{2} f h +140 c d e \,f^{2} g +48 d^{2} e^{3} h -56 d^{2} e^{2} f g \right )}{105 f^{4}}\) \(169\)

Input:

int((d*x+c)^2*(h*x+g)/(f*x+e)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

-4/3*((-3/10*x^2*(5/7*h*x+g)*d^2-x*c*(3/5*h*x+g)*d-3/2*c^2*(1/3*h*x+g))*f^ 
3+e*(2/5*x*(9/14*h*x+g)*d^2+2*c*(2/5*h*x+g)*d+h*c^2)*f^2-8/5*(1/2*(3/7*h*x 
+g)*d+c*h)*e^2*d*f+24/35*d^2*e^3*h)*(f*x+e)^(1/2)/f^4
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.38 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \, {\left (15 \, d^{2} f^{3} h x^{3} + 3 \, {\left (7 \, d^{2} f^{3} g - 2 \, {\left (3 \, d^{2} e f^{2} - 7 \, c d f^{3}\right )} h\right )} x^{2} + 7 \, {\left (8 \, d^{2} e^{2} f - 20 \, c d e f^{2} + 15 \, c^{2} f^{3}\right )} g - 2 \, {\left (24 \, d^{2} e^{3} - 56 \, c d e^{2} f + 35 \, c^{2} e f^{2}\right )} h - {\left (14 \, {\left (2 \, d^{2} e f^{2} - 5 \, c d f^{3}\right )} g - {\left (24 \, d^{2} e^{2} f - 56 \, c d e f^{2} + 35 \, c^{2} f^{3}\right )} h\right )} x\right )} \sqrt {f x + e}}{105 \, f^{4}} \] Input:

integrate((d*x+c)^2*(h*x+g)/(f*x+e)^(1/2),x, algorithm="fricas")
 

Output:

2/105*(15*d^2*f^3*h*x^3 + 3*(7*d^2*f^3*g - 2*(3*d^2*e*f^2 - 7*c*d*f^3)*h)* 
x^2 + 7*(8*d^2*e^2*f - 20*c*d*e*f^2 + 15*c^2*f^3)*g - 2*(24*d^2*e^3 - 56*c 
*d*e^2*f + 35*c^2*e*f^2)*h - (14*(2*d^2*e*f^2 - 5*c*d*f^3)*g - (24*d^2*e^2 
*f - 56*c*d*e*f^2 + 35*c^2*f^3)*h)*x)*sqrt(f*x + e)/f^4
 

Sympy [A] (verification not implemented)

Time = 0.90 (sec) , antiderivative size = 255, normalized size of antiderivative = 2.06 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\begin {cases} \frac {2 \left (\frac {d^{2} h \left (e + f x\right )^{\frac {7}{2}}}{7 f^{3}} + \frac {\left (e + f x\right )^{\frac {5}{2}} \cdot \left (2 c d f h - 3 d^{2} e h + d^{2} f g\right )}{5 f^{3}} + \frac {\left (e + f x\right )^{\frac {3}{2}} \left (c^{2} f^{2} h - 4 c d e f h + 2 c d f^{2} g + 3 d^{2} e^{2} h - 2 d^{2} e f g\right )}{3 f^{3}} + \frac {\sqrt {e + f x} \left (- c^{2} e f^{2} h + c^{2} f^{3} g + 2 c d e^{2} f h - 2 c d e f^{2} g - d^{2} e^{3} h + d^{2} e^{2} f g\right )}{f^{3}}\right )}{f} & \text {for}\: f \neq 0 \\\frac {c^{2} g x + \frac {d^{2} h x^{4}}{4} + \frac {x^{3} \cdot \left (2 c d h + d^{2} g\right )}{3} + \frac {x^{2} \left (c^{2} h + 2 c d g\right )}{2}}{\sqrt {e}} & \text {otherwise} \end {cases} \] Input:

integrate((d*x+c)**2*(h*x+g)/(f*x+e)**(1/2),x)
 

Output:

Piecewise((2*(d**2*h*(e + f*x)**(7/2)/(7*f**3) + (e + f*x)**(5/2)*(2*c*d*f 
*h - 3*d**2*e*h + d**2*f*g)/(5*f**3) + (e + f*x)**(3/2)*(c**2*f**2*h - 4*c 
*d*e*f*h + 2*c*d*f**2*g + 3*d**2*e**2*h - 2*d**2*e*f*g)/(3*f**3) + sqrt(e 
+ f*x)*(-c**2*e*f**2*h + c**2*f**3*g + 2*c*d*e**2*f*h - 2*c*d*e*f**2*g - d 
**2*e**3*h + d**2*e**2*f*g)/f**3)/f, Ne(f, 0)), ((c**2*g*x + d**2*h*x**4/4 
 + x**3*(2*c*d*h + d**2*g)/3 + x**2*(c**2*h + 2*c*d*g)/2)/sqrt(e), True))
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.33 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \, {\left (15 \, {\left (f x + e\right )}^{\frac {7}{2}} d^{2} h + 21 \, {\left (d^{2} f g - {\left (3 \, d^{2} e - 2 \, c d f\right )} h\right )} {\left (f x + e\right )}^{\frac {5}{2}} - 35 \, {\left (2 \, {\left (d^{2} e f - c d f^{2}\right )} g - {\left (3 \, d^{2} e^{2} - 4 \, c d e f + c^{2} f^{2}\right )} h\right )} {\left (f x + e\right )}^{\frac {3}{2}} + 105 \, {\left ({\left (d^{2} e^{2} f - 2 \, c d e f^{2} + c^{2} f^{3}\right )} g - {\left (d^{2} e^{3} - 2 \, c d e^{2} f + c^{2} e f^{2}\right )} h\right )} \sqrt {f x + e}\right )}}{105 \, f^{4}} \] Input:

integrate((d*x+c)^2*(h*x+g)/(f*x+e)^(1/2),x, algorithm="maxima")
 

Output:

2/105*(15*(f*x + e)^(7/2)*d^2*h + 21*(d^2*f*g - (3*d^2*e - 2*c*d*f)*h)*(f* 
x + e)^(5/2) - 35*(2*(d^2*e*f - c*d*f^2)*g - (3*d^2*e^2 - 4*c*d*e*f + c^2* 
f^2)*h)*(f*x + e)^(3/2) + 105*((d^2*e^2*f - 2*c*d*e*f^2 + c^2*f^3)*g - (d^ 
2*e^3 - 2*c*d*e^2*f + c^2*e*f^2)*h)*sqrt(f*x + e))/f^4
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.66 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \, {\left (105 \, \sqrt {f x + e} c^{2} g + \frac {70 \, {\left ({\left (f x + e\right )}^{\frac {3}{2}} - 3 \, \sqrt {f x + e} e\right )} c d g}{f} + \frac {35 \, {\left ({\left (f x + e\right )}^{\frac {3}{2}} - 3 \, \sqrt {f x + e} e\right )} c^{2} h}{f} + \frac {7 \, {\left (3 \, {\left (f x + e\right )}^{\frac {5}{2}} - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} e + 15 \, \sqrt {f x + e} e^{2}\right )} d^{2} g}{f^{2}} + \frac {14 \, {\left (3 \, {\left (f x + e\right )}^{\frac {5}{2}} - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} e + 15 \, \sqrt {f x + e} e^{2}\right )} c d h}{f^{2}} + \frac {3 \, {\left (5 \, {\left (f x + e\right )}^{\frac {7}{2}} - 21 \, {\left (f x + e\right )}^{\frac {5}{2}} e + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} e^{2} - 35 \, \sqrt {f x + e} e^{3}\right )} d^{2} h}{f^{3}}\right )}}{105 \, f} \] Input:

integrate((d*x+c)^2*(h*x+g)/(f*x+e)^(1/2),x, algorithm="giac")
                                                                                    
                                                                                    
 

Output:

2/105*(105*sqrt(f*x + e)*c^2*g + 70*((f*x + e)^(3/2) - 3*sqrt(f*x + e)*e)* 
c*d*g/f + 35*((f*x + e)^(3/2) - 3*sqrt(f*x + e)*e)*c^2*h/f + 7*(3*(f*x + e 
)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*d^2*g/f^2 + 14*(3*( 
f*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*c*d*h/f^2 + 
3*(5*(f*x + e)^(7/2) - 21*(f*x + e)^(5/2)*e + 35*(f*x + e)^(3/2)*e^2 - 35* 
sqrt(f*x + e)*e^3)*d^2*h/f^3)/f
 

Mupad [B] (verification not implemented)

Time = 2.48 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.93 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {{\left (e+f\,x\right )}^{5/2}\,\left (2\,d^2\,f\,g-6\,d^2\,e\,h+4\,c\,d\,f\,h\right )}{5\,f^4}+\frac {2\,{\left (e+f\,x\right )}^{3/2}\,\left (c\,f-d\,e\right )\,\left (c\,f\,h-3\,d\,e\,h+2\,d\,f\,g\right )}{3\,f^4}-\frac {2\,\sqrt {e+f\,x}\,{\left (c\,f-d\,e\right )}^2\,\left (e\,h-f\,g\right )}{f^4}+\frac {2\,d^2\,h\,{\left (e+f\,x\right )}^{7/2}}{7\,f^4} \] Input:

int(((g + h*x)*(c + d*x)^2)/(e + f*x)^(1/2),x)
 

Output:

((e + f*x)^(5/2)*(2*d^2*f*g - 6*d^2*e*h + 4*c*d*f*h))/(5*f^4) + (2*(e + f* 
x)^(3/2)*(c*f - d*e)*(c*f*h - 3*d*e*h + 2*d*f*g))/(3*f^4) - (2*(e + f*x)^( 
1/2)*(c*f - d*e)^2*(e*h - f*g))/f^4 + (2*d^2*h*(e + f*x)^(7/2))/(7*f^4)
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.35 \[ \int \frac {(c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \sqrt {f x +e}\, \left (15 d^{2} f^{3} h \,x^{3}+42 c d \,f^{3} h \,x^{2}-18 d^{2} e \,f^{2} h \,x^{2}+21 d^{2} f^{3} g \,x^{2}+35 c^{2} f^{3} h x -56 c d e \,f^{2} h x +70 c d \,f^{3} g x +24 d^{2} e^{2} f h x -28 d^{2} e \,f^{2} g x -70 c^{2} e \,f^{2} h +105 c^{2} f^{3} g +112 c d \,e^{2} f h -140 c d e \,f^{2} g -48 d^{2} e^{3} h +56 d^{2} e^{2} f g \right )}{105 f^{4}} \] Input:

int((d*x+c)^2*(h*x+g)/(f*x+e)^(1/2),x)
 

Output:

(2*sqrt(e + f*x)*( - 70*c**2*e*f**2*h + 105*c**2*f**3*g + 35*c**2*f**3*h*x 
 + 112*c*d*e**2*f*h - 140*c*d*e*f**2*g - 56*c*d*e*f**2*h*x + 70*c*d*f**3*g 
*x + 42*c*d*f**3*h*x**2 - 48*d**2*e**3*h + 56*d**2*e**2*f*g + 24*d**2*e**2 
*f*h*x - 28*d**2*e*f**2*g*x - 18*d**2*e*f**2*h*x**2 + 21*d**2*f**3*g*x**2 
+ 15*d**2*f**3*h*x**3))/(105*f**4)