\(\int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx\) [846]

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

Optimal result

Integrand size = 30, antiderivative size = 132 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=-\frac {f (4 b e-a f) \sqrt {a+b x} \sqrt {a c-b c x}}{2 b^3 c}-\frac {f^2 (a+b x)^{3/2} \sqrt {a c-b c x}}{2 b^3 c}+\frac {\left (2 b^2 e^2+a^2 f^2\right ) \arctan \left (\frac {\sqrt {c} \sqrt {a+b x}}{\sqrt {a c-b c x}}\right )}{b^3 \sqrt {c}} \] Output:

-1/2*f*(-a*f+4*b*e)*(b*x+a)^(1/2)*(-b*c*x+a*c)^(1/2)/b^3/c-1/2*f^2*(b*x+a) 
^(3/2)*(-b*c*x+a*c)^(1/2)/b^3/c+(a^2*f^2+2*b^2*e^2)*arctan(c^(1/2)*(b*x+a) 
^(1/2)/(-b*c*x+a*c)^(1/2))/b^3/c^(1/2)
 

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.72 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=\frac {b f (-a+b x) \sqrt {a+b x} (4 e+f x)+2 \left (2 b^2 e^2+a^2 f^2\right ) \sqrt {a-b x} \arctan \left (\frac {\sqrt {a+b x}}{\sqrt {a-b x}}\right )}{2 b^3 \sqrt {c (a-b x)}} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {101, 25, 27, 90, 45, 218}

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

\(\Big \downarrow \) 101

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 90

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

\(\Big \downarrow \) 45

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

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {2 \left (a^2 f^2+2 b^2 e^2\right ) \arctan \left (\frac {\sqrt {c} \sqrt {a+b x}}{\sqrt {a c-b c x}}\right )}{b \sqrt {c}}-\frac {3 e f \sqrt {a+b x} \sqrt {a c-b c x}}{c}}{2 b^2}-\frac {f \sqrt {a+b x} (e+f x) \sqrt {a c-b c x}}{2 b^2 c}\)

Input:

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

Output:

-1/2*(f*Sqrt[a + b*x]*Sqrt[a*c - b*c*x]*(e + f*x))/(b^2*c) + ((-3*e*f*Sqrt 
[a + b*x]*Sqrt[a*c - b*c*x])/c + (2*(2*b^2*e^2 + a^2*f^2)*ArcTan[(Sqrt[c]* 
Sqrt[a + b*x])/Sqrt[a*c - b*c*x]])/(b*Sqrt[c]))/(2*b^2)
 

Defintions of rubi rules used

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

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 45
Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[ 
2   Subst[Int[1/(b - d*x^2), x], x, Sqrt[a + b*x]/Sqrt[c + d*x]], x] /; Fre 
eQ[{a, b, c, d}, x] && EqQ[b*c + a*d, 0] &&  !GtQ[c, 0]
 

rule 90
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p 
_.), x_] :> Simp[b*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), 
 x] + Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(d*f*(n + p 
+ 2))   Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, 
p}, x] && NeQ[n + p + 2, 0]
 

rule 101
Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^( 
p_), x_] :> Simp[b*(a + b*x)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + 
 p + 3))), x] + Simp[1/(d*f*(n + p + 3))   Int[(c + d*x)^n*(e + f*x)^p*Simp 
[a^2*d*f*(n + p + 3) - b*(b*c*e + a*(d*e*(n + 1) + c*f*(p + 1))) + b*(a*d*f 
*(n + p + 4) - b*(d*e*(n + 2) + c*f*(p + 2)))*x, x], x], x] /; FreeQ[{a, b, 
 c, d, e, f, n, p}, x] && NeQ[n + p + 3, 0]
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 
Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.99

method result size
risch \(-\frac {f \left (f x +4 e \right ) \left (-b x +a \right ) \sqrt {b x +a}}{2 b^{2} \sqrt {-c \left (b x -a \right )}}+\frac {\left (a^{2} f^{2}+2 b^{2} e^{2}\right ) \arctan \left (\frac {\sqrt {b^{2} c}\, x}{\sqrt {-b^{2} c \,x^{2}+a^{2} c}}\right ) \sqrt {-\left (b x +a \right ) c \left (b x -a \right )}}{2 b^{2} \sqrt {b^{2} c}\, \sqrt {b x +a}\, \sqrt {-c \left (b x -a \right )}}\) \(131\)
default \(\frac {\sqrt {b x +a}\, \sqrt {c \left (-b x +a \right )}\, \left (\arctan \left (\frac {\sqrt {b^{2} c}\, x}{\sqrt {c \left (-b^{2} x^{2}+a^{2}\right )}}\right ) a^{2} c \,f^{2}+2 \arctan \left (\frac {\sqrt {b^{2} c}\, x}{\sqrt {c \left (-b^{2} x^{2}+a^{2}\right )}}\right ) b^{2} c \,e^{2}-\sqrt {c \left (-b^{2} x^{2}+a^{2}\right )}\, \sqrt {b^{2} c}\, f^{2} x -4 \sqrt {b^{2} c}\, \sqrt {c \left (-b^{2} x^{2}+a^{2}\right )}\, e f \right )}{2 b^{2} \sqrt {c \left (-b^{2} x^{2}+a^{2}\right )}\, c \sqrt {b^{2} c}}\) \(175\)

Input:

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

Output:

-1/2*f*(f*x+4*e)/b^2*(-b*x+a)*(b*x+a)^(1/2)/(-c*(b*x-a))^(1/2)+1/2*(a^2*f^ 
2+2*b^2*e^2)/b^2/(b^2*c)^(1/2)*arctan((b^2*c)^(1/2)*x/(-b^2*c*x^2+a^2*c)^( 
1/2))*(-(b*x+a)*c*(b*x-a))^(1/2)/(b*x+a)^(1/2)/(-c*(b*x-a))^(1/2)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.59 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=\left [-\frac {{\left (2 \, b^{2} e^{2} + a^{2} f^{2}\right )} \sqrt {-c} \log \left (2 \, b^{2} c x^{2} - 2 \, \sqrt {-b c x + a c} \sqrt {b x + a} b \sqrt {-c} x - a^{2} c\right ) + 2 \, {\left (b f^{2} x + 4 \, b e f\right )} \sqrt {-b c x + a c} \sqrt {b x + a}}{4 \, b^{3} c}, -\frac {{\left (2 \, b^{2} e^{2} + a^{2} f^{2}\right )} \sqrt {c} \arctan \left (\frac {\sqrt {-b c x + a c} \sqrt {b x + a} b \sqrt {c} x}{b^{2} c x^{2} - a^{2} c}\right ) + {\left (b f^{2} x + 4 \, b e f\right )} \sqrt {-b c x + a c} \sqrt {b x + a}}{2 \, b^{3} c}\right ] \] Input:

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

Output:

[-1/4*((2*b^2*e^2 + a^2*f^2)*sqrt(-c)*log(2*b^2*c*x^2 - 2*sqrt(-b*c*x + a* 
c)*sqrt(b*x + a)*b*sqrt(-c)*x - a^2*c) + 2*(b*f^2*x + 4*b*e*f)*sqrt(-b*c*x 
 + a*c)*sqrt(b*x + a))/(b^3*c), -1/2*((2*b^2*e^2 + a^2*f^2)*sqrt(c)*arctan 
(sqrt(-b*c*x + a*c)*sqrt(b*x + a)*b*sqrt(c)*x/(b^2*c*x^2 - a^2*c)) + (b*f^ 
2*x + 4*b*e*f)*sqrt(-b*c*x + a*c)*sqrt(b*x + a))/(b^3*c)]
 

Sympy [F(-1)]

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

integrate((f*x+e)**2/(b*x+a)**(1/2)/(-b*c*x+a*c)**(1/2),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.72 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=\frac {e^{2} \arcsin \left (\frac {b x}{a}\right )}{b \sqrt {c}} + \frac {a^{2} f^{2} \arcsin \left (\frac {b x}{a}\right )}{2 \, b^{3} \sqrt {c}} - \frac {\sqrt {-b^{2} c x^{2} + a^{2} c} f^{2} x}{2 \, b^{2} c} - \frac {2 \, \sqrt {-b^{2} c x^{2} + a^{2} c} e f}{b^{2} c} \] Input:

integrate((f*x+e)^2/(b*x+a)^(1/2)/(-b*c*x+a*c)^(1/2),x, algorithm="maxima" 
)
 

Output:

e^2*arcsin(b*x/a)/(b*sqrt(c)) + 1/2*a^2*f^2*arcsin(b*x/a)/(b^3*sqrt(c)) - 
1/2*sqrt(-b^2*c*x^2 + a^2*c)*f^2*x/(b^2*c) - 2*sqrt(-b^2*c*x^2 + a^2*c)*e* 
f/(b^2*c)
 

Giac [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.87 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=-\frac {\sqrt {-{\left (b x + a\right )} c + 2 \, a c} {\left (\frac {{\left (b x + a\right )} f^{2}}{c} + \frac {4 \, b c e f - a c f^{2}}{c^{2}}\right )} \sqrt {b x + a} + \frac {2 \, {\left (2 \, b^{2} e^{2} + a^{2} f^{2}\right )} \log \left ({\left | -\sqrt {b x + a} \sqrt {-c} + \sqrt {-{\left (b x + a\right )} c + 2 \, a c} \right |}\right )}{\sqrt {-c}}}{2 \, b^{3}} \] Input:

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

Output:

-1/2*(sqrt(-(b*x + a)*c + 2*a*c)*((b*x + a)*f^2/c + (4*b*c*e*f - a*c*f^2)/ 
c^2)*sqrt(b*x + a) + 2*(2*b^2*e^2 + a^2*f^2)*log(abs(-sqrt(b*x + a)*sqrt(- 
c) + sqrt(-(b*x + a)*c + 2*a*c)))/sqrt(-c))/b^3
 

Mupad [B] (verification not implemented)

Time = 9.23 (sec) , antiderivative size = 581, normalized size of antiderivative = 4.40 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=-\frac {\frac {2\,a^2\,f^2\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^7}{b^3\,{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^7}-\frac {2\,a^2\,c^3\,f^2\,\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}{b^3\,\left (\sqrt {a+b\,x}-\sqrt {a}\right )}-\frac {14\,a^2\,c\,f^2\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^5}{b^3\,{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^5}+\frac {14\,a^2\,c^2\,f^2\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^3}{b^3\,{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^3}+\frac {16\,\sqrt {a}\,e\,f\,\sqrt {a\,c}\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^6}{b^2\,{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^6}+\frac {16\,\sqrt {a}\,c^2\,e\,f\,\sqrt {a\,c}\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^2}{b^2\,{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^2}+\frac {32\,\sqrt {a}\,c\,e\,f\,\sqrt {a\,c}\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^4}{b^2\,{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^4}}{\frac {{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^8}{{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^8}+c^4+\frac {4\,c\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^6}{{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^6}+\frac {4\,c^3\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^2}{{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^2}+\frac {6\,c^2\,{\left (\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}\right )}^4}{{\left (\sqrt {a+b\,x}-\sqrt {a}\right )}^4}}-\frac {2\,\mathrm {atan}\left (\frac {\sqrt {a\,c-b\,c\,x}-\sqrt {a\,c}}{\sqrt {c}\,\left (\sqrt {a+b\,x}-\sqrt {a}\right )}\right )\,\left (a^2\,f^2+2\,b^2\,e^2\right )}{b^3\,\sqrt {c}} \] Input:

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

Output:

- ((2*a^2*f^2*((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^7)/(b^3*((a + b*x)^(1/2) 
 - a^(1/2))^7) - (2*a^2*c^3*f^2*((a*c - b*c*x)^(1/2) - (a*c)^(1/2)))/(b^3* 
((a + b*x)^(1/2) - a^(1/2))) - (14*a^2*c*f^2*((a*c - b*c*x)^(1/2) - (a*c)^ 
(1/2))^5)/(b^3*((a + b*x)^(1/2) - a^(1/2))^5) + (14*a^2*c^2*f^2*((a*c - b* 
c*x)^(1/2) - (a*c)^(1/2))^3)/(b^3*((a + b*x)^(1/2) - a^(1/2))^3) + (16*a^( 
1/2)*e*f*(a*c)^(1/2)*((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^6)/(b^2*((a + b*x 
)^(1/2) - a^(1/2))^6) + (16*a^(1/2)*c^2*e*f*(a*c)^(1/2)*((a*c - b*c*x)^(1/ 
2) - (a*c)^(1/2))^2)/(b^2*((a + b*x)^(1/2) - a^(1/2))^2) + (32*a^(1/2)*c*e 
*f*(a*c)^(1/2)*((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^4)/(b^2*((a + b*x)^(1/2 
) - a^(1/2))^4))/(((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^8/((a + b*x)^(1/2) - 
 a^(1/2))^8 + c^4 + (4*c*((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^6)/((a + b*x) 
^(1/2) - a^(1/2))^6 + (4*c^3*((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^2)/((a + 
b*x)^(1/2) - a^(1/2))^2 + (6*c^2*((a*c - b*c*x)^(1/2) - (a*c)^(1/2))^4)/(( 
a + b*x)^(1/2) - a^(1/2))^4) - (2*atan(((a*c - b*c*x)^(1/2) - (a*c)^(1/2)) 
/(c^(1/2)*((a + b*x)^(1/2) - a^(1/2))))*(a^2*f^2 + 2*b^2*e^2))/(b^3*c^(1/2 
))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.75 \[ \int \frac {(e+f x)^2}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx=\frac {\sqrt {c}\, \left (-2 \mathit {asin} \left (\frac {\sqrt {-b x +a}}{\sqrt {a}\, \sqrt {2}}\right ) a^{2} f^{2}-4 \mathit {asin} \left (\frac {\sqrt {-b x +a}}{\sqrt {a}\, \sqrt {2}}\right ) b^{2} e^{2}-4 \sqrt {b x +a}\, \sqrt {-b x +a}\, b e f -\sqrt {b x +a}\, \sqrt {-b x +a}\, b \,f^{2} x \right )}{2 b^{3} c} \] Input:

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

Output:

(sqrt(c)*( - 2*asin(sqrt(a - b*x)/(sqrt(a)*sqrt(2)))*a**2*f**2 - 4*asin(sq 
rt(a - b*x)/(sqrt(a)*sqrt(2)))*b**2*e**2 - 4*sqrt(a + b*x)*sqrt(a - b*x)*b 
*e*f - sqrt(a + b*x)*sqrt(a - b*x)*b*f**2*x))/(2*b**3*c)