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

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

Optimal result

Integrand size = 39, antiderivative size = 367 \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x)^2 \sqrt {a+b x+c x^2}} \, dx=\frac {\left (C f^2-g (B f-A g)\right ) \sqrt {a+b x+c x^2}}{(e f-d g) \left (c f^2-b f g+a g^2\right ) (f+g x)}+\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 )}{\sqrt {c d^2-b d e+a e^2} (e f-d g)^2}+\frac {\left (2 a (B d-A e) g^3-b C f^2 (e f-3 d g)+2 a C f g (e f-2 d g)-2 c f \left (C d f^2-B e f^2+A g (2 e f-d g)\right )+b g (A g (3 e f-d g)-B f (e f+d 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 )}{2 (e f-d g)^2 \left (c f^2-b f g+a g^2\right )^{3/2}} \] Output:

(C*f^2-g*(-A*g+B*f))*(c*x^2+b*x+a)^(1/2)/(-d*g+e*f)/(a*g^2-b*f*g+c*f^2)/(g 
*x+f)+(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))/(a*e^2-b*d*e+c*d^2)^(1/2)/(-d*g+e*f 
)^2+1/2*(2*a*(-A*e+B*d)*g^3-b*C*f^2*(-3*d*g+e*f)+2*a*C*f*g*(-2*d*g+e*f)-2* 
c*f*(C*d*f^2-B*e*f^2+A*g*(-d*g+2*e*f))+b*g*(A*g*(-d*g+3*e*f)-B*f*(d*g+e*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))/(-d*g+e*f)^2/(a*g^2-b*f*g+c*f^2)^(3/2)
 

Mathematica [A] (verified)

Time = 11.57 (sec) , antiderivative size = 392, normalized size of antiderivative = 1.07 \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x)^2 \sqrt {a+b x+c x^2}} \, dx=\frac {\frac {2 (e f-d g) \left (C f^2+g (-B f+A g)\right ) \sqrt {a+x (b+c x)}}{\left (c f^2+g (-b f+a g)\right ) (f+g x)}+\frac {2 \left (C d^2+e (-B d+A e)\right ) \text {arctanh}\left (\frac {-2 a e+2 c d x+b (d-e x)}{2 \sqrt {c d^2+e (-b d+a e)} \sqrt {a+x (b+c x)}}\right )}{\sqrt {c d^2+e (-b d+a e)}}-\frac {(2 c f-b g) (e f-d g) \left (C f^2+g (-B f+A g)\right ) \text {arctanh}\left (\frac {-2 a g+2 c f x+b (f-g x)}{2 \sqrt {c f^2+g (-b f+a g)} \sqrt {a+x (b+c x)}}\right )}{g \left (c f^2+g (-b f+a g)\right )^{3/2}}+\frac {2 \left ((B d-A e) g^2+C f (e f-2 d g)\right ) \text {arctanh}\left (\frac {-2 a g+2 c f x+b (f-g x)}{2 \sqrt {c f^2+g (-b f+a g)} \sqrt {a+x (b+c x)}}\right )}{g \sqrt {c f^2+g (-b f+a g)}}}{2 (e f-d g)^2} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 1.41 (sec) , antiderivative size = 411, normalized size of antiderivative = 1.12, 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)^2 \sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 2153

\(\displaystyle \int \left (\frac {A e^2-B d e+C d^2}{(d+e x) \sqrt {a+b x+c x^2} (e f-d g)^2}+\frac {A g^2-B f g+C f^2}{g (f+g x)^2 \sqrt {a+b x+c x^2} (d g-e f)}+\frac {g^2 (B d-A e)+C f (e f-2 d g)}{g (f+g x) \sqrt {a+b x+c x^2} (e f-d g)^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 f-d g)^2 \sqrt {a e^2-b d e+c d^2}}-\frac {(2 c f-b g) \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 )}{2 g (e f-d g) \left (a g^2-b f g+c f^2\right )^{3/2}}+\frac {\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 ) \left (g^2 (B d-A e)+C f (e f-2 d g)\right )}{g (e f-d g)^2 \sqrt {a g^2-b f g+c f^2}}+\frac {\sqrt {a+b x+c x^2} \left (C f^2-g (B f-A g)\right )}{(f+g x) (e f-d g) \left (a g^2-b f g+c f^2\right )}\)

Input:

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

Output:

((C*f^2 - g*(B*f - A*g))*Sqrt[a + b*x + c*x^2])/((e*f - d*g)*(c*f^2 - b*f* 
g + a*g^2)*(f + g*x)) + ((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])])/(Sq 
rt[c*d^2 - b*d*e + a*e^2]*(e*f - d*g)^2) - ((2*c*f - b*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])])/(2*g*(e*f - d*g)*(c*f^2 - b*f*g + a*g^2)^(3/ 
2)) + (((B*d - A*e)*g^2 + C*f*(e*f - 2*d*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)^2*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.82 (sec) , antiderivative size = 672, normalized size of antiderivative = 1.83

method result size
default \(-\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 )}{\left (d g -e f \right )^{2} e \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 ) \left (-\frac {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}}}}{\left (a \,g^{2}-b f g +c \,f^{2}\right ) \left (x +\frac {f}{g}\right )}+\frac {\left (b g -2 c f \right ) g \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 )}{2 \left (a \,g^{2}-b f g +c \,f^{2}\right ) \sqrt {\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}}\right )}{g^{3} \left (d g -e f \right )}+\frac {\left (A e \,g^{2}-B d \,g^{2}+2 C d f g -C e \,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 )}{\left (d g -e f \right )^{2} g^{2} \sqrt {\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}}\) \(672\)

Input:

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

Output:

-(A*e^2-B*d*e+C*d^2)/(d*g-e*f)^2/e/((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))+(A*g^2-B*f*g+C*f^2)/g^3/(d*g-e*f)*(-1/(a*g^2-b*f*g+c*f^2)*g^2/(x+f/ 
g)*((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)+1/2*( 
b*g-2*c*f)*g/(a*g^2-b*f*g+c*f^2)/((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)))+(A*e*g^2-B*d*g^2+2*C*d*f*g-C*e*f^2)/(d*g-e*f)^2/g^2/((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)^2 \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)^2/(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)^2 \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 )^{2} \sqrt {a + b x + c x^{2}}}\, dx \] Input:

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

Output:

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

Maxima [F]

\[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x)^2 \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 )}^{2}} \,d x } \] Input:

integrate((C*x^2+B*x+A)/(e*x+d)/(g*x+f)^2/(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)^2), 
 x)
 

Giac [F(-1)]

Timed out. \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x)^2 \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)^2/(c*x^2+b*x+a)^(1/2),x, algorithm 
="giac")
 

Output:

Timed out
 

Mupad [F(-1)]

Timed out. \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x)^2 \sqrt {a+b x+c x^2}} \, dx=\int \frac {C\,x^2+B\,x+A}{{\left (f+g\,x\right )}^2\,\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)^2*(d + e*x)*(a + b*x + c*x^2)^(1/2)),x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 1758, normalized size of antiderivative = 4.79 \[ \int \frac {A+B x+C x^2}{(d+e x) (f+g x)^2 \sqrt {a+b x+c x^2}} \, dx =\text {Too large to display} \] Input:

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

Output:

(2*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)*a*f*g**2 + 2*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)*a*g**3*x - 2*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)*b*f**2*g - 2*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)*b*f*g**2*x + 2*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) 
*c*f**3 + 2*sqrt(a*e**2 - b*d*e + c*d**2)*log(2*sqrt(a + b*x + c*x**2)*sqr 
t(a*e**2 - b*d*e + c*d**2) - 2*a*e + b*d - b*e*x + 2*c*d*x)*c*f**2*g*x - 2 
*sqrt(a*e**2 - b*d*e + c*d**2)*log(d + e*x)*a*f*g**2 - 2*sqrt(a*e**2 - b*d 
*e + c*d**2)*log(d + e*x)*a*g**3*x + 2*sqrt(a*e**2 - b*d*e + c*d**2)*log(d 
 + e*x)*b*f**2*g + 2*sqrt(a*e**2 - b*d*e + c*d**2)*log(d + e*x)*b*f*g**2*x 
 - 2*sqrt(a*e**2 - b*d*e + c*d**2)*log(d + e*x)*c*f**3 - 2*sqrt(a*e**2 - b 
*d*e + c*d**2)*log(d + e*x)*c*f**2*g*x + 2*sqrt(a*g**2 - b*f*g + c*f**2)*l 
og( - 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)*a*e*f*g + 2*sqrt(a*g**2 - b*f*g + c*f**2)*log( - 2*sqr 
t(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)*a*e*g**2*x - sqrt(a*g**2 - b*f*g + c*f**2)*log( - 2*sqrt(a + b...