\(\int \frac {A+B x+C x^2}{(d+e x) (f+g x) \sqrt {a+b x+c x^2}} \, dx\) [47]

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

Optimal result

Integrand size = 39, antiderivative size = 263 \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x) \sqrt {a+b x+c x^2}} \, dx=\frac {C \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} e g}+\frac {\left (C d^2-e (B d-A e)\right ) \text {arctanh}\left (\frac {b d-2 a e+(2 c d-b e) x}{2 \sqrt {c d^2-b d e+a e^2} \sqrt {a+b x+c x^2}}\right )}{e \sqrt {c d^2-b d e+a e^2} (e f-d g)}-\frac {\left (C f^2-g (B f-A g)\right ) \text {arctanh}\left (\frac {b f-2 a g+(2 c f-b g) x}{2 \sqrt {c f^2-b f g+a g^2} \sqrt {a+b x+c x^2}}\right )}{g (e f-d g) \sqrt {c f^2-b f g+a g^2}} \] Output:

C*arctanh(1/2*(2*c*x+b)/c^(1/2)/(c*x^2+b*x+a)^(1/2))/c^(1/2)/e/g+(C*d^2-e* 
(-A*e+B*d))*arctanh(1/2*(b*d-2*a*e+(-b*e+2*c*d)*x)/(a*e^2-b*d*e+c*d^2)^(1/ 
2)/(c*x^2+b*x+a)^(1/2))/e/(a*e^2-b*d*e+c*d^2)^(1/2)/(-d*g+e*f)-(C*f^2-g*(- 
A*g+B*f))*arctanh(1/2*(b*f-2*a*g+(-b*g+2*c*f)*x)/(a*g^2-b*f*g+c*f^2)^(1/2) 
/(c*x^2+b*x+a)^(1/2))/g/(-d*g+e*f)/(a*g^2-b*f*g+c*f^2)^(1/2)
 

Mathematica [A] (verified)

Time = 1.17 (sec) , antiderivative size = 287, normalized size of antiderivative = 1.09 \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x) \sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {-c d^2+e (b d-a e)} \left (C d^2+e (-B d+A e)\right ) \arctan \left (\frac {\sqrt {c} (d+e x)-e \sqrt {a+x (b+c x)}}{\sqrt {-c d^2+e (b d-a e)}}\right )}{e \left (c d^2+e (-b d+a e)\right ) (e f-d g)}+\frac {2 \sqrt {-c f^2+b f g-a g^2} \left (C f^2+g (-B f+A g)\right ) \arctan \left (\frac {\sqrt {c} (f+g x)-g \sqrt {a+x (b+c x)}}{\sqrt {-c f^2+g (b f-a g)}}\right )}{g (-e f+d g) \left (c f^2+g (-b f+a g)\right )}-\frac {C \log \left (e g \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )\right )}{\sqrt {c} e g} \] Input:

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

Output:

(2*Sqrt[-(c*d^2) + e*(b*d - a*e)]*(C*d^2 + e*(-(B*d) + A*e))*ArcTan[(Sqrt[ 
c]*(d + e*x) - e*Sqrt[a + x*(b + c*x)])/Sqrt[-(c*d^2) + e*(b*d - a*e)]])/( 
e*(c*d^2 + e*(-(b*d) + a*e))*(e*f - d*g)) + (2*Sqrt[-(c*f^2) + b*f*g - a*g 
^2]*(C*f^2 + g*(-(B*f) + A*g))*ArcTan[(Sqrt[c]*(f + g*x) - g*Sqrt[a + x*(b 
 + c*x)])/Sqrt[-(c*f^2) + g*(b*f - a*g)]])/(g*(-(e*f) + d*g)*(c*f^2 + g*(- 
(b*f) + a*g))) - (C*Log[e*g*(b + 2*c*x - 2*Sqrt[c]*Sqrt[a + x*(b + c*x)])] 
)/(Sqrt[c]*e*g)
 

Rubi [A] (verified)

Time = 1.07 (sec) , antiderivative size = 263, 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.051, Rules used = {2153, 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 {A+B x+C x^2}{(d+e x) (f+g x) \sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 2153

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2153
Int[(Px_)*((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.)*((a_.) + (b 
_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Px*(d + e* 
x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, 
 m, n, p}, x] && PolyQ[Px, x] && (IntegerQ[p] || (IntegerQ[2*p] && IntegerQ 
[m] && ILtQ[n, 0])) &&  !(IGtQ[m, 0] && IGtQ[n, 0])
 
Maple [A] (verified)

Time = 0.71 (sec) , antiderivative size = 401, normalized size of antiderivative = 1.52

method result size
default \(\frac {C \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{e g \sqrt {c}}+\frac {\left (A \,e^{2}-B d e +C \,d^{2}\right ) \ln \left (\frac {\frac {2 a \,e^{2}-2 b d e +2 c \,d^{2}}{e^{2}}+\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+2 \sqrt {\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}\, \sqrt {\left (x +\frac {d}{e}\right )^{2} c +\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}}{x +\frac {d}{e}}\right )}{e^{2} \left (d g -e f \right ) \sqrt {\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}}-\frac {\left (A \,g^{2}-B f g +C \,f^{2}\right ) \ln \left (\frac {\frac {2 a \,g^{2}-2 b f g +2 c \,f^{2}}{g^{2}}+\frac {\left (b g -2 c f \right ) \left (x +\frac {f}{g}\right )}{g}+2 \sqrt {\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}\, \sqrt {\left (x +\frac {f}{g}\right )^{2} c +\frac {\left (b g -2 c f \right ) \left (x +\frac {f}{g}\right )}{g}+\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}}{x +\frac {f}{g}}\right )}{g^{2} \left (d g -e f \right ) \sqrt {\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}}\) \(401\)

Input:

int((C*x^2+B*x+A)/(e*x+d)/(g*x+f)/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERB 
OSE)
 

Output:

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

Fricas [F(-1)]

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

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

Output:

Timed out
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

integrate((C*x^2+B*x+A)/(e*x+d)/(g*x+f)/(c*x^2+b*x+a)^(1/2),x, algorithm=" 
maxima")
 

Output:

integrate((C*x^2 + B*x + A)/(sqrt(c*x^2 + b*x + a)*(e*x + d)*(g*x + f)), x 
)
 

Giac [F(-2)]

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

integrate((C*x^2+B*x+A)/(e*x+d)/(g*x+f)/(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:sym2poly/r2sym(const gen & e,const 
index_m & i,const vecteur & l) Error: Bad Argument Value
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 5.17 (sec) , antiderivative size = 265, normalized size of antiderivative = 1.01 \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x) \sqrt {a+b x+c x^2}} \, dx=\frac {\sqrt {a \,e^{2}-b d e +c \,d^{2}}\, \mathrm {log}\left (-2 \sqrt {c \,x^{2}+b x +a}\, \sqrt {a \,e^{2}-b d e +c \,d^{2}}-2 a e +b d -b e x +2 c d x \right ) g -\sqrt {a \,e^{2}-b d e +c \,d^{2}}\, \mathrm {log}\left (e x +d \right ) g +\sqrt {a \,g^{2}-b f g +c \,f^{2}}\, \mathrm {log}\left (2 \sqrt {c \,x^{2}+b x +a}\, \sqrt {a \,g^{2}-b f g +c \,f^{2}}-2 a g +b f -b g x +2 c f x \right ) e -\sqrt {a \,g^{2}-b f g +c \,f^{2}}\, \mathrm {log}\left (g x +f \right ) e +\sqrt {c}\, \mathrm {log}\left (-2 \sqrt {c}\, \sqrt {c \,x^{2}+b x +a}-b -2 c x \right ) d g -\sqrt {c}\, \mathrm {log}\left (-2 \sqrt {c}\, \sqrt {c \,x^{2}+b x +a}-b -2 c x \right ) e f}{e g \left (d g -e f \right )} \] Input:

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

Output:

(sqrt(a*e**2 - b*d*e + c*d**2)*log( - 2*sqrt(a + b*x + c*x**2)*sqrt(a*e**2 
 - b*d*e + c*d**2) - 2*a*e + b*d - b*e*x + 2*c*d*x)*g - sqrt(a*e**2 - b*d* 
e + c*d**2)*log(d + e*x)*g + sqrt(a*g**2 - b*f*g + c*f**2)*log(2*sqrt(a + 
b*x + c*x**2)*sqrt(a*g**2 - b*f*g + c*f**2) - 2*a*g + b*f - b*g*x + 2*c*f* 
x)*e - sqrt(a*g**2 - b*f*g + c*f**2)*log(f + g*x)*e + sqrt(c)*log( - 2*sqr 
t(c)*sqrt(a + b*x + c*x**2) - b - 2*c*x)*d*g - sqrt(c)*log( - 2*sqrt(c)*sq 
rt(a + b*x + c*x**2) - b - 2*c*x)*e*f)/(e*g*(d*g - e*f))