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

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

Optimal result

Integrand size = 32, antiderivative size = 179 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx=\frac {f \sqrt {a+b x+c x^2}}{c h}-\frac {(2 c f g-2 c e h+b f h) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{2 c^{3/2} h^2}+\frac {\left (f g^2-h (e g-d h)\right ) \text {arctanh}\left (\frac {b g-2 a h+(2 c g-b h) x}{2 \sqrt {c g^2-b g h+a h^2} \sqrt {a+b x+c x^2}}\right )}{h^2 \sqrt {c g^2-b g h+a h^2}} \] Output:

f*(c*x^2+b*x+a)^(1/2)/c/h-1/2*(b*f*h-2*c*e*h+2*c*f*g)*arctanh(1/2*(2*c*x+b 
)/c^(1/2)/(c*x^2+b*x+a)^(1/2))/c^(3/2)/h^2+(f*g^2-h*(-d*h+e*g))*arctanh(1/ 
2*(b*g-2*a*h+(-b*h+2*c*g)*x)/(a*h^2-b*g*h+c*g^2)^(1/2)/(c*x^2+b*x+a)^(1/2) 
)/h^2/(a*h^2-b*g*h+c*g^2)^(1/2)
 

Mathematica [A] (verified)

Time = 0.98 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.04 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx=\frac {\frac {2 f h \sqrt {a+x (b+c x)}}{c}+\frac {4 \sqrt {-c g^2+b g h-a h^2} \left (f g^2+h (-e g+d h)\right ) \arctan \left (\frac {\sqrt {c} (g+h x)-h \sqrt {a+x (b+c x)}}{\sqrt {-c g^2+h (b g-a h)}}\right )}{c g^2+h (-b g+a h)}-\frac {(2 c f g-2 c e h+b f h) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+x (b+c x)}}\right )}{c^{3/2}}}{2 h^2} \] Input:

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

Output:

((2*f*h*Sqrt[a + x*(b + c*x)])/c + (4*Sqrt[-(c*g^2) + b*g*h - a*h^2]*(f*g^ 
2 + h*(-(e*g) + d*h))*ArcTan[(Sqrt[c]*(g + h*x) - h*Sqrt[a + x*(b + c*x)]) 
/Sqrt[-(c*g^2) + h*(b*g - a*h)]])/(c*g^2 + h*(-(b*g) + a*h)) - ((2*c*f*g - 
 2*c*e*h + b*f*h)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + x*(b + c*x)])])/ 
c^(3/2))/(2*h^2)
 

Rubi [A] (verified)

Time = 0.79 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {2184, 27, 1269, 1092, 219, 1154, 219}

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 x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 2184

\(\displaystyle \frac {\int -\frac {h (b f g-2 c d h+(2 c f g-2 c e h+b f h) x)}{2 (g+h x) \sqrt {c x^2+b x+a}}dx}{c h^2}+\frac {f \sqrt {a+b x+c x^2}}{c h}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {f \sqrt {a+b x+c x^2}}{c h}-\frac {\int \frac {b f g-2 c d h+(2 c f g-2 c e h+b f h) x}{(g+h x) \sqrt {c x^2+b x+a}}dx}{2 c h}\)

\(\Big \downarrow \) 1269

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

\(\Big \downarrow \) 1092

\(\displaystyle \frac {f \sqrt {a+b x+c x^2}}{c h}-\frac {\frac {2 (b f h-2 c e h+2 c f g) \int \frac {1}{4 c-\frac {(b+2 c x)^2}{c x^2+b x+a}}d\frac {b+2 c x}{\sqrt {c x^2+b x+a}}}{h}-\frac {2 c \left (d h^2-e g h+f g^2\right ) \int \frac {1}{(g+h x) \sqrt {c x^2+b x+a}}dx}{h}}{2 c h}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {f \sqrt {a+b x+c x^2}}{c h}-\frac {\frac {\text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) (b f h-2 c e h+2 c f g)}{\sqrt {c} h}-\frac {2 c \left (d h^2-e g h+f g^2\right ) \int \frac {1}{(g+h x) \sqrt {c x^2+b x+a}}dx}{h}}{2 c h}\)

\(\Big \downarrow \) 1154

\(\displaystyle \frac {f \sqrt {a+b x+c x^2}}{c h}-\frac {\frac {4 c \left (d h^2-e g h+f g^2\right ) \int \frac {1}{4 \left (c g^2-b h g+a h^2\right )-\frac {(b g-2 a h+(2 c g-b h) x)^2}{c x^2+b x+a}}d\left (-\frac {b g-2 a h+(2 c g-b h) x}{\sqrt {c x^2+b x+a}}\right )}{h}+\frac {\text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) (b f h-2 c e h+2 c f g)}{\sqrt {c} h}}{2 c h}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {f \sqrt {a+b x+c x^2}}{c h}-\frac {\frac {\text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) (b f h-2 c e h+2 c f g)}{\sqrt {c} h}-\frac {2 c \left (d h^2-e g h+f g^2\right ) \text {arctanh}\left (\frac {-2 a h+x (2 c g-b h)+b g}{2 \sqrt {a+b x+c x^2} \sqrt {a h^2-b g h+c g^2}}\right )}{h \sqrt {a h^2-b g h+c g^2}}}{2 c h}\)

Input:

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

Output:

(f*Sqrt[a + b*x + c*x^2])/(c*h) - (((2*c*f*g - 2*c*e*h + b*f*h)*ArcTanh[(b 
 + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(Sqrt[c]*h) - (2*c*(f*g^2 - 
e*g*h + d*h^2)*ArcTanh[(b*g - 2*a*h + (2*c*g - b*h)*x)/(2*Sqrt[c*g^2 - b*g 
*h + a*h^2]*Sqrt[a + b*x + c*x^2])])/(h*Sqrt[c*g^2 - b*g*h + a*h^2]))/(2*c 
*h)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 1092
Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[2   Subst[I 
nt[1/(4*c - x^2), x], x, (b + 2*c*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a 
, b, c}, x]
 

rule 1154
Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Sym 
bol] :> Simp[-2   Subst[Int[1/(4*c*d^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, ( 
2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c 
, d, e}, x]
 

rule 1269
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g/e   Int[(d + e*x)^(m + 1)*(a + b*x + 
 c*x^2)^p, x], x] + Simp[(e*f - d*g)/e   Int[(d + e*x)^m*(a + b*x + c*x^2)^ 
p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] &&  !IGtQ[m, 0]
 

rule 2184
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff[Pq, x, Expon[Pq, x]]}, S 
imp[f*(d + e*x)^(m + q - 1)*((a + b*x + c*x^2)^(p + 1)/(c*e^(q - 1)*(m + q 
+ 2*p + 1))), x] + Simp[1/(c*e^q*(m + q + 2*p + 1))   Int[(d + e*x)^m*(a + 
b*x + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*f*(m + q + 2*p + 
1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(b*d*e*(p + 1) + a*e^2*(m + q - 1) - c 
*d^2*(m + q + 2*p + 1) - e*(2*c*d - b*e)*(m + q + p)*x), x], x], x] /; GtQ[ 
q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, c, d, e, m, p}, x] && Pol 
yQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] &&  !(IGt 
Q[m, 0] && RationalQ[a, b, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))
 
Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 251, normalized size of antiderivative = 1.40

method result size
risch \(\frac {f \sqrt {c \,x^{2}+b x +a}}{c h}-\frac {\frac {\left (b f h -2 c h e +2 c f g \right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{h \sqrt {c}}+\frac {2 \left (d \,h^{2}-e g h +f \,g^{2}\right ) c \ln \left (\frac {\frac {2 a \,h^{2}-2 b g h +2 c \,g^{2}}{h^{2}}+\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{h^{2} \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}}{2 h c}\) \(251\)
default \(\frac {\frac {e h \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{\sqrt {c}}+f h \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )-\frac {f g \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{\sqrt {c}}}{h^{2}}-\frac {\left (d \,h^{2}-e g h +f \,g^{2}\right ) \ln \left (\frac {\frac {2 a \,h^{2}-2 b g h +2 c \,g^{2}}{h^{2}}+\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{h^{3} \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}\) \(293\)

Input:

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

Output:

f*(c*x^2+b*x+a)^(1/2)/c/h-1/2/h/c*((b*f*h-2*c*e*h+2*c*f*g)/h*ln((1/2*b+c*x 
)/c^(1/2)+(c*x^2+b*x+a)^(1/2))/c^(1/2)+2*(d*h^2-e*g*h+f*g^2)*c/h^2/((a*h^2 
-b*g*h+c*g^2)/h^2)^(1/2)*ln((2*(a*h^2-b*g*h+c*g^2)/h^2+(b*h-2*c*g)/h*(x+g/ 
h)+2*((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*((x+g/h)^2*c+(b*h-2*c*g)/h*(x+g/h)+(a 
*h^2-b*g*h+c*g^2)/h^2)^(1/2))/(x+g/h)))
 

Fricas [F(-1)]

Timed out. \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Sympy [F]

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

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

Output:

Integral((d + e*x + f*x**2)/((g + h*x)*sqrt(a + b*x + c*x**2)), x)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx=\text {Exception raised: ValueError} \] Input:

integrate((f*x^2+e*x+d)/(h*x+g)/(c*x^2+b*x+a)^(1/2),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((b/h-(2*c*g)/h^2)^2>0)', see `as 
sume?` for
 

Giac [F(-2)]

Exception generated. \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx=\text {Exception raised: TypeError} \] Input:

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument Type
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.51 (sec) , antiderivative size = 12390, normalized size of antiderivative = 69.22 \[ \int \frac {d+e x+f x^2}{(g+h x) \sqrt {a+b x+c x^2}} \, dx =\text {Too large to display} \] Input:

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

Output:

( - 2*sqrt(4*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*b*h - 8*sqrt(c)*sqrt(a* 
h**2 - b*g*h + c*g**2)*c*g - 4*a*c*h**2 - b**2*h**2 + 8*b*c*g*h - 8*c**2*g 
**2)*sqrt(a*h**2 - b*g*h + c*g**2)*atan((2*sqrt(c)*sqrt(a + b*x + c*x**2)* 
h + b*h + 2*c*h*x)/sqrt(4*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*b*h - 8*sq 
rt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*c*g - 4*a*c*h**2 - b**2*h**2 + 8*b*c*g 
*h - 8*c**2*g**2))*b*c**2*d*h**3 + 2*sqrt(4*sqrt(c)*sqrt(a*h**2 - b*g*h + 
c*g**2)*b*h - 8*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*c*g - 4*a*c*h**2 - b 
**2*h**2 + 8*b*c*g*h - 8*c**2*g**2)*sqrt(a*h**2 - b*g*h + c*g**2)*atan((2* 
sqrt(c)*sqrt(a + b*x + c*x**2)*h + b*h + 2*c*h*x)/sqrt(4*sqrt(c)*sqrt(a*h* 
*2 - b*g*h + c*g**2)*b*h - 8*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*c*g - 4 
*a*c*h**2 - b**2*h**2 + 8*b*c*g*h - 8*c**2*g**2))*b*c**2*e*g*h**2 - 2*sqrt 
(4*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*b*h - 8*sqrt(c)*sqrt(a*h**2 - b*g 
*h + c*g**2)*c*g - 4*a*c*h**2 - b**2*h**2 + 8*b*c*g*h - 8*c**2*g**2)*sqrt( 
a*h**2 - b*g*h + c*g**2)*atan((2*sqrt(c)*sqrt(a + b*x + c*x**2)*h + b*h + 
2*c*h*x)/sqrt(4*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*b*h - 8*sqrt(c)*sqrt 
(a*h**2 - b*g*h + c*g**2)*c*g - 4*a*c*h**2 - b**2*h**2 + 8*b*c*g*h - 8*c** 
2*g**2))*b*c**2*f*g**2*h + 4*sqrt(4*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)* 
b*h - 8*sqrt(c)*sqrt(a*h**2 - b*g*h + c*g**2)*c*g - 4*a*c*h**2 - b**2*h**2 
 + 8*b*c*g*h - 8*c**2*g**2)*sqrt(a*h**2 - b*g*h + c*g**2)*atan((2*sqrt(c)* 
sqrt(a + b*x + c*x**2)*h + b*h + 2*c*h*x)/sqrt(4*sqrt(c)*sqrt(a*h**2 - ...