\(\int \sqrt {-c+d x} \sqrt {c+d x} (a+b x^2) \, dx\) [9]

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

Optimal result

Integrand size = 28, antiderivative size = 114 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=\frac {\left (b c^2+4 a d^2\right ) x \sqrt {-c+d x} \sqrt {c+d x}}{8 d^2}+\frac {b x (-c+d x)^{3/2} (c+d x)^{3/2}}{4 d^2}-\frac {c^2 \left (b c^2+4 a d^2\right ) \text {arctanh}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{4 d^3} \] Output:

1/8*(4*a*d^2+b*c^2)*x*(d*x-c)^(1/2)*(d*x+c)^(1/2)/d^2+1/4*b*x*(d*x-c)^(3/2 
)*(d*x+c)^(3/2)/d^2-1/4*c^2*(4*a*d^2+b*c^2)*arctanh((d*x-c)^(1/2)/(d*x+c)^ 
(1/2))/d^3
 

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.81 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=\frac {d x \sqrt {-c+d x} \sqrt {c+d x} \left (-b c^2+4 a d^2+2 b d^2 x^2\right )-2 c^2 \left (b c^2+4 a d^2\right ) \text {arctanh}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{8 d^3} \] Input:

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

Output:

(d*x*Sqrt[-c + d*x]*Sqrt[c + d*x]*(-(b*c^2) + 4*a*d^2 + 2*b*d^2*x^2) - 2*c 
^2*(b*c^2 + 4*a*d^2)*ArcTanh[Sqrt[-c + d*x]/Sqrt[c + d*x]])/(8*d^3)
 

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.92, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {646, 40, 45, 221}

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

\(\Big \downarrow \) 646

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

\(\Big \downarrow \) 40

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

\(\Big \downarrow \) 45

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

\(\Big \downarrow \) 221

\(\displaystyle \frac {\left (4 a d^2+b c^2\right ) \left (\frac {1}{2} x \sqrt {d x-c} \sqrt {c+d x}-\frac {c^2 \text {arctanh}\left (\frac {\sqrt {d x-c}}{\sqrt {c+d x}}\right )}{d}\right )}{4 d^2}+\frac {b x (d x-c)^{3/2} (c+d x)^{3/2}}{4 d^2}\)

Input:

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

Output:

(b*x*(-c + d*x)^(3/2)*(c + d*x)^(3/2))/(4*d^2) + ((b*c^2 + 4*a*d^2)*((x*Sq 
rt[-c + d*x]*Sqrt[c + d*x])/2 - (c^2*ArcTanh[Sqrt[-c + d*x]/Sqrt[c + d*x]] 
)/d))/(4*d^2)
 

Defintions of rubi rules used

rule 40
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[x* 
(a + b*x)^m*((c + d*x)^m/(2*m + 1)), x] + Simp[2*a*c*(m/(2*m + 1))   Int[(a 
 + b*x)^(m - 1)*(c + d*x)^(m - 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[ 
b*c + a*d, 0] && IGtQ[m + 1/2, 0]
 

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 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 646
Int[((c_) + (d_.)*(x_))^(m_.)*((e_) + (f_.)*(x_))^(n_.)*((a_.) + (b_.)*(x_) 
^2), x_Symbol] :> Simp[b*x*(c + d*x)^(m + 1)*((e + f*x)^(n + 1)/(d*f*(2*m + 
 3))), x] - Simp[(b*c*e - a*d*f*(2*m + 3))/(d*f*(2*m + 3))   Int[(c + d*x)^ 
m*(e + f*x)^n, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && EqQ[m, n] && 
 EqQ[d*e + c*f, 0] &&  !LtQ[m, -1]
 
Maple [A] (verified)

Time = 0.13 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.18

method result size
risch \(-\frac {x \left (2 b \,x^{2} d^{2}+4 a \,d^{2}-b \,c^{2}\right ) \left (-d x +c \right ) \sqrt {d x +c}}{8 d^{2} \sqrt {d x -c}}-\frac {c^{2} \left (4 a \,d^{2}+b \,c^{2}\right ) \ln \left (\frac {d^{2} x}{\sqrt {d^{2}}}+\sqrt {d^{2} x^{2}-c^{2}}\right ) \sqrt {\left (d x -c \right ) \left (d x +c \right )}}{8 d^{2} \sqrt {d^{2}}\, \sqrt {d x -c}\, \sqrt {d x +c}}\) \(135\)
default \(\frac {\sqrt {d x -c}\, \sqrt {d x +c}\, \left (2 \,\operatorname {csgn}\left (d \right ) b \,d^{3} x^{3} \sqrt {d^{2} x^{2}-c^{2}}+4 \,\operatorname {csgn}\left (d \right ) d^{3} \sqrt {d^{2} x^{2}-c^{2}}\, a x -\operatorname {csgn}\left (d \right ) d \sqrt {d^{2} x^{2}-c^{2}}\, b \,c^{2} x -4 \ln \left (\left (\sqrt {d^{2} x^{2}-c^{2}}\, \operatorname {csgn}\left (d \right )+d x \right ) \operatorname {csgn}\left (d \right )\right ) a \,c^{2} d^{2}-\ln \left (\left (\sqrt {d^{2} x^{2}-c^{2}}\, \operatorname {csgn}\left (d \right )+d x \right ) \operatorname {csgn}\left (d \right )\right ) b \,c^{4}\right ) \operatorname {csgn}\left (d \right )}{8 \sqrt {d^{2} x^{2}-c^{2}}\, d^{3}}\) \(182\)

Input:

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

Output:

-1/8*x*(2*b*d^2*x^2+4*a*d^2-b*c^2)*(-d*x+c)*(d*x+c)^(1/2)/d^2/(d*x-c)^(1/2 
)-1/8*c^2*(4*a*d^2+b*c^2)/d^2*ln(d^2*x/(d^2)^(1/2)+(d^2*x^2-c^2)^(1/2))/(d 
^2)^(1/2)*((d*x-c)*(d*x+c))^(1/2)/(d*x-c)^(1/2)/(d*x+c)^(1/2)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.77 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=\frac {{\left (2 \, b d^{3} x^{3} - {\left (b c^{2} d - 4 \, a d^{3}\right )} x\right )} \sqrt {d x + c} \sqrt {d x - c} + {\left (b c^{4} + 4 \, a c^{2} d^{2}\right )} \log \left (-d x + \sqrt {d x + c} \sqrt {d x - c}\right )}{8 \, d^{3}} \] Input:

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

Output:

1/8*((2*b*d^3*x^3 - (b*c^2*d - 4*a*d^3)*x)*sqrt(d*x + c)*sqrt(d*x - c) + ( 
b*c^4 + 4*a*c^2*d^2)*log(-d*x + sqrt(d*x + c)*sqrt(d*x - c)))/d^3
 

Sympy [F]

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

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

Output:

Integral((a + b*x**2)*sqrt(-c + d*x)*sqrt(c + d*x), x)
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.20 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=-\frac {b c^{4} \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - c^{2}} d\right )}{8 \, d^{3}} - \frac {a c^{2} \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - c^{2}} d\right )}{2 \, d} + \frac {1}{2} \, \sqrt {d^{2} x^{2} - c^{2}} a x + \frac {\sqrt {d^{2} x^{2} - c^{2}} b c^{2} x}{8 \, d^{2}} + \frac {{\left (d^{2} x^{2} - c^{2}\right )}^{\frac {3}{2}} b x}{4 \, d^{2}} \] Input:

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

Output:

-1/8*b*c^4*log(2*d^2*x + 2*sqrt(d^2*x^2 - c^2)*d)/d^3 - 1/2*a*c^2*log(2*d^ 
2*x + 2*sqrt(d^2*x^2 - c^2)*d)/d + 1/2*sqrt(d^2*x^2 - c^2)*a*x + 1/8*sqrt( 
d^2*x^2 - c^2)*b*c^2*x/d^2 + 1/4*(d^2*x^2 - c^2)^(3/2)*b*x/d^2
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 276 vs. \(2 (96) = 192\).

Time = 0.18 (sec) , antiderivative size = 276, normalized size of antiderivative = 2.42 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=\frac {24 \, {\left (2 \, c \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right ) + \sqrt {d x + c} \sqrt {d x - c}\right )} a c + {\left ({\left ({\left (d x + c\right )} {\left (2 \, {\left (d x + c\right )} {\left (\frac {3 \, {\left (d x + c\right )}}{d^{3}} - \frac {13 \, c}{d^{3}}\right )} + \frac {43 \, c^{2}}{d^{3}}\right )} - \frac {39 \, c^{3}}{d^{3}}\right )} \sqrt {d x + c} \sqrt {d x - c} - \frac {18 \, c^{4} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right )}{d^{3}}\right )} b d - 12 \, {\left (2 \, c^{2} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right ) - \sqrt {d x + c} \sqrt {d x - c} {\left (d x - 2 \, c\right )}\right )} a + \frac {4 \, {\left (6 \, c^{3} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right ) + {\left ({\left (2 \, d x - 5 \, c\right )} {\left (d x + c\right )} + 9 \, c^{2}\right )} \sqrt {d x + c} \sqrt {d x - c}\right )} b c}{d^{2}}}{24 \, d} \] Input:

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

Output:

1/24*(24*(2*c*log(abs(-sqrt(d*x + c) + sqrt(d*x - c))) + sqrt(d*x + c)*sqr 
t(d*x - c))*a*c + (((d*x + c)*(2*(d*x + c)*(3*(d*x + c)/d^3 - 13*c/d^3) + 
43*c^2/d^3) - 39*c^3/d^3)*sqrt(d*x + c)*sqrt(d*x - c) - 18*c^4*log(abs(-sq 
rt(d*x + c) + sqrt(d*x - c)))/d^3)*b*d - 12*(2*c^2*log(abs(-sqrt(d*x + c) 
+ sqrt(d*x - c))) - sqrt(d*x + c)*sqrt(d*x - c)*(d*x - 2*c))*a + 4*(6*c^3* 
log(abs(-sqrt(d*x + c) + sqrt(d*x - c))) + ((2*d*x - 5*c)*(d*x + c) + 9*c^ 
2)*sqrt(d*x + c)*sqrt(d*x - c))*b*c/d^2)/d
 

Mupad [B] (verification not implemented)

Time = 19.52 (sec) , antiderivative size = 734, normalized size of antiderivative = 6.44 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=\frac {a\,x\,\sqrt {c+d\,x}\,\sqrt {d\,x-c}}{2}-\frac {\frac {b\,c^4\,\left (\sqrt {c+d\,x}-\sqrt {c}\right )}{2\,\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}+\frac {35\,b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^3}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^3}+\frac {273\,b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^5}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^5}+\frac {715\,b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^7}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^7}+\frac {715\,b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^9}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^9}+\frac {273\,b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{11}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{11}}+\frac {35\,b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{13}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{13}}+\frac {b\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{15}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{15}}}{d^3-\frac {8\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^2}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^2}+\frac {28\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^4}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^4}-\frac {56\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^6}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^6}+\frac {70\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^8}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^8}-\frac {56\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{10}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{10}}+\frac {28\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{12}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{12}}-\frac {8\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{14}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{14}}+\frac {d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{16}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{16}}}-\frac {a\,c^2\,\ln \left (d\,x+\sqrt {c+d\,x}\,\sqrt {d\,x-c}\right )}{2\,d}+\frac {b\,c^4\,\mathrm {atanh}\left (\frac {\sqrt {c+d\,x}-\sqrt {c}}{\sqrt {-c}-\sqrt {d\,x-c}}\right )}{2\,d^3} \] Input:

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

Output:

(a*x*(c + d*x)^(1/2)*(d*x - c)^(1/2))/2 - ((b*c^4*((c + d*x)^(1/2) - c^(1/ 
2)))/(2*((-c)^(1/2) - (d*x - c)^(1/2))) + (35*b*c^4*((c + d*x)^(1/2) - c^( 
1/2))^3)/(2*((-c)^(1/2) - (d*x - c)^(1/2))^3) + (273*b*c^4*((c + d*x)^(1/2 
) - c^(1/2))^5)/(2*((-c)^(1/2) - (d*x - c)^(1/2))^5) + (715*b*c^4*((c + d* 
x)^(1/2) - c^(1/2))^7)/(2*((-c)^(1/2) - (d*x - c)^(1/2))^7) + (715*b*c^4*( 
(c + d*x)^(1/2) - c^(1/2))^9)/(2*((-c)^(1/2) - (d*x - c)^(1/2))^9) + (273* 
b*c^4*((c + d*x)^(1/2) - c^(1/2))^11)/(2*((-c)^(1/2) - (d*x - c)^(1/2))^11 
) + (35*b*c^4*((c + d*x)^(1/2) - c^(1/2))^13)/(2*((-c)^(1/2) - (d*x - c)^( 
1/2))^13) + (b*c^4*((c + d*x)^(1/2) - c^(1/2))^15)/(2*((-c)^(1/2) - (d*x - 
 c)^(1/2))^15))/(d^3 - (8*d^3*((c + d*x)^(1/2) - c^(1/2))^2)/((-c)^(1/2) - 
 (d*x - c)^(1/2))^2 + (28*d^3*((c + d*x)^(1/2) - c^(1/2))^4)/((-c)^(1/2) - 
 (d*x - c)^(1/2))^4 - (56*d^3*((c + d*x)^(1/2) - c^(1/2))^6)/((-c)^(1/2) - 
 (d*x - c)^(1/2))^6 + (70*d^3*((c + d*x)^(1/2) - c^(1/2))^8)/((-c)^(1/2) - 
 (d*x - c)^(1/2))^8 - (56*d^3*((c + d*x)^(1/2) - c^(1/2))^10)/((-c)^(1/2) 
- (d*x - c)^(1/2))^10 + (28*d^3*((c + d*x)^(1/2) - c^(1/2))^12)/((-c)^(1/2 
) - (d*x - c)^(1/2))^12 - (8*d^3*((c + d*x)^(1/2) - c^(1/2))^14)/((-c)^(1/ 
2) - (d*x - c)^(1/2))^14 + (d^3*((c + d*x)^(1/2) - c^(1/2))^16)/((-c)^(1/2 
) - (d*x - c)^(1/2))^16) - (a*c^2*log(d*x + (c + d*x)^(1/2)*(d*x - c)^(1/2 
)))/(2*d) + (b*c^4*atanh(((c + d*x)^(1/2) - c^(1/2))/((-c)^(1/2) - (d*x - 
c)^(1/2))))/(2*d^3)
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.20 \[ \int \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx=\frac {4 \sqrt {d x +c}\, \sqrt {d x -c}\, a \,d^{3} x -\sqrt {d x +c}\, \sqrt {d x -c}\, b \,c^{2} d x +2 \sqrt {d x +c}\, \sqrt {d x -c}\, b \,d^{3} x^{3}-8 \,\mathrm {log}\left (\frac {\sqrt {d x -c}+\sqrt {d x +c}}{\sqrt {c}\, \sqrt {2}}\right ) a \,c^{2} d^{2}-2 \,\mathrm {log}\left (\frac {\sqrt {d x -c}+\sqrt {d x +c}}{\sqrt {c}\, \sqrt {2}}\right ) b \,c^{4}}{8 d^{3}} \] Input:

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

Output:

(4*sqrt(c + d*x)*sqrt( - c + d*x)*a*d**3*x - sqrt(c + d*x)*sqrt( - c + d*x 
)*b*c**2*d*x + 2*sqrt(c + d*x)*sqrt( - c + d*x)*b*d**3*x**3 - 8*log((sqrt( 
 - c + d*x) + sqrt(c + d*x))/(sqrt(c)*sqrt(2)))*a*c**2*d**2 - 2*log((sqrt( 
 - c + d*x) + sqrt(c + d*x))/(sqrt(c)*sqrt(2)))*b*c**4)/(8*d**3)