\(\int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx\) [171]

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

Optimal result

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

1/3*B*(d*x+c)^2*(b*x^2+a)^(1/2)/b-1/6*(4*a*B*d^2-4*b*c*(3*A*d+B*c)-b*d*(3* 
A*d+2*B*c)*x)*(b*x^2+a)^(1/2)/b^2+1/2*(-A*a*d^2+2*A*b*c^2-2*B*a*c*d)*arcta 
nh(b^(1/2)*x/(b*x^2+a)^(1/2))/b^(3/2)
 

Mathematica [A] (verified)

Time = 0.95 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.85 \[ \int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx=\frac {\sqrt {a+b x^2} \left (-4 a B d^2+3 A b d (4 c+d x)+2 b B \left (3 c^2+3 c d x+d^2 x^2\right )\right )+3 \sqrt {b} \left (-2 A b c^2+2 a B c d+a A d^2\right ) \log \left (-\sqrt {b} x+\sqrt {a+b x^2}\right )}{6 b^2} \] Input:

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

Output:

(Sqrt[a + b*x^2]*(-4*a*B*d^2 + 3*A*b*d*(4*c + d*x) + 2*b*B*(3*c^2 + 3*c*d* 
x + d^2*x^2)) + 3*Sqrt[b]*(-2*A*b*c^2 + 2*a*B*c*d + a*A*d^2)*Log[-(Sqrt[b] 
*x) + Sqrt[a + b*x^2]])/(6*b^2)
 

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {687, 676, 224, 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 {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx\)

\(\Big \downarrow \) 687

\(\displaystyle \frac {\int \frac {(c+d x) (3 A b c-2 a B d+b (2 B c+3 A d) x)}{\sqrt {b x^2+a}}dx}{3 b}+\frac {B \sqrt {a+b x^2} (c+d x)^2}{3 b}\)

\(\Big \downarrow \) 676

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

\(\Big \downarrow \) 224

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

\(\Big \downarrow \) 219

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

Input:

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

Output:

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

Defintions of rubi rules used

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 224
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], 
x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] &&  !GtQ[a, 0]
 

rule 676
Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x 
_Symbol] :> Simp[(e*f + d*g)*((a + c*x^2)^(p + 1)/(2*c*(p + 1))), x] + (Sim 
p[e*g*x*((a + c*x^2)^(p + 1)/(c*(2*p + 3))), x] - Simp[(a*e*g - c*d*f*(2*p 
+ 3))/(c*(2*p + 3))   Int[(a + c*x^2)^p, x], x]) /; FreeQ[{a, c, d, e, f, g 
, p}, x] &&  !LeQ[p, -1]
 

rule 687
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p 
_.), x_Symbol] :> Simp[g*(d + e*x)^m*((a + c*x^2)^(p + 1)/(c*(m + 2*p + 2)) 
), x] + Simp[1/(c*(m + 2*p + 2))   Int[(d + e*x)^(m - 1)*(a + c*x^2)^p*Simp 
[c*d*f*(m + 2*p + 2) - a*e*g*m + c*(e*f*(m + 2*p + 2) + d*g*m)*x, x], x], x 
] /; FreeQ[{a, c, d, e, f, g, p}, x] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && 
 (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p]) &&  !(IGtQ[m, 0] && Eq 
Q[f, 0])
 
Maple [A] (verified)

Time = 1.01 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.79

method result size
risch \(\frac {\left (2 B b \,d^{2} x^{2}+3 A b \,d^{2} x +6 B b c d x +12 A b c d -4 a B \,d^{2}+6 B b \,c^{2}\right ) \sqrt {b \,x^{2}+a}}{6 b^{2}}-\frac {\left (A a \,d^{2}-2 A b \,c^{2}+2 B a c d \right ) \ln \left (\sqrt {b}\, x +\sqrt {b \,x^{2}+a}\right )}{2 b^{\frac {3}{2}}}\) \(103\)
default \(\frac {A \,c^{2} \ln \left (\sqrt {b}\, x +\sqrt {b \,x^{2}+a}\right )}{\sqrt {b}}+d \left (A d +2 B c \right ) \left (\frac {x \sqrt {b \,x^{2}+a}}{2 b}-\frac {a \ln \left (\sqrt {b}\, x +\sqrt {b \,x^{2}+a}\right )}{2 b^{\frac {3}{2}}}\right )+\frac {c \left (2 A d +B c \right ) \sqrt {b \,x^{2}+a}}{b}+B \,d^{2} \left (\frac {x^{2} \sqrt {b \,x^{2}+a}}{3 b}-\frac {2 a \sqrt {b \,x^{2}+a}}{3 b^{2}}\right )\) \(134\)

Input:

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

Output:

1/6*(2*B*b*d^2*x^2+3*A*b*d^2*x+6*B*b*c*d*x+12*A*b*c*d-4*B*a*d^2+6*B*b*c^2) 
*(b*x^2+a)^(1/2)/b^2-1/2/b^(3/2)*(A*a*d^2-2*A*b*c^2+2*B*a*c*d)*ln(b^(1/2)* 
x+(b*x^2+a)^(1/2))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 226, normalized size of antiderivative = 1.74 \[ \int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx=\left [-\frac {3 \, {\left (2 \, A b c^{2} - 2 \, B a c d - A a d^{2}\right )} \sqrt {b} \log \left (-2 \, b x^{2} + 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right ) - 2 \, {\left (2 \, B b d^{2} x^{2} + 6 \, B b c^{2} + 12 \, A b c d - 4 \, B a d^{2} + 3 \, {\left (2 \, B b c d + A b d^{2}\right )} x\right )} \sqrt {b x^{2} + a}}{12 \, b^{2}}, -\frac {3 \, {\left (2 \, A b c^{2} - 2 \, B a c d - A a d^{2}\right )} \sqrt {-b} \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right ) - {\left (2 \, B b d^{2} x^{2} + 6 \, B b c^{2} + 12 \, A b c d - 4 \, B a d^{2} + 3 \, {\left (2 \, B b c d + A b d^{2}\right )} x\right )} \sqrt {b x^{2} + a}}{6 \, b^{2}}\right ] \] Input:

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

Output:

[-1/12*(3*(2*A*b*c^2 - 2*B*a*c*d - A*a*d^2)*sqrt(b)*log(-2*b*x^2 + 2*sqrt( 
b*x^2 + a)*sqrt(b)*x - a) - 2*(2*B*b*d^2*x^2 + 6*B*b*c^2 + 12*A*b*c*d - 4* 
B*a*d^2 + 3*(2*B*b*c*d + A*b*d^2)*x)*sqrt(b*x^2 + a))/b^2, -1/6*(3*(2*A*b* 
c^2 - 2*B*a*c*d - A*a*d^2)*sqrt(-b)*arctan(sqrt(-b)*x/sqrt(b*x^2 + a)) - ( 
2*B*b*d^2*x^2 + 6*B*b*c^2 + 12*A*b*c*d - 4*B*a*d^2 + 3*(2*B*b*c*d + A*b*d^ 
2)*x)*sqrt(b*x^2 + a))/b^2]
 

Sympy [A] (verification not implemented)

Time = 0.58 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.42 \[ \int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx=\begin {cases} \sqrt {a + b x^{2}} \left (\frac {B d^{2} x^{2}}{3 b} + \frac {x \left (A d^{2} + 2 B c d\right )}{2 b} + \frac {2 A c d - \frac {2 B a d^{2}}{3 b} + B c^{2}}{b}\right ) + \left (A c^{2} - \frac {a \left (A d^{2} + 2 B c d\right )}{2 b}\right ) \left (\begin {cases} \frac {\log {\left (2 \sqrt {b} \sqrt {a + b x^{2}} + 2 b x \right )}}{\sqrt {b}} & \text {for}\: a \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {b x^{2}}} & \text {otherwise} \end {cases}\right ) & \text {for}\: b \neq 0 \\\frac {A c^{2} x + \frac {B d^{2} x^{4}}{4} + \frac {x^{3} \left (A d^{2} + 2 B c d\right )}{3} + \frac {x^{2} \cdot \left (2 A c d + B c^{2}\right )}{2}}{\sqrt {a}} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((sqrt(a + b*x**2)*(B*d**2*x**2/(3*b) + x*(A*d**2 + 2*B*c*d)/(2*b 
) + (2*A*c*d - 2*B*a*d**2/(3*b) + B*c**2)/b) + (A*c**2 - a*(A*d**2 + 2*B*c 
*d)/(2*b))*Piecewise((log(2*sqrt(b)*sqrt(a + b*x**2) + 2*b*x)/sqrt(b), Ne( 
a, 0)), (x*log(x)/sqrt(b*x**2), True)), Ne(b, 0)), ((A*c**2*x + B*d**2*x** 
4/4 + x**3*(A*d**2 + 2*B*c*d)/3 + x**2*(2*A*c*d + B*c**2)/2)/sqrt(a), True 
))
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.11 \[ \int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx=\frac {\sqrt {b x^{2} + a} B d^{2} x^{2}}{3 \, b} + \frac {A c^{2} \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {b}} + \frac {\sqrt {b x^{2} + a} B c^{2}}{b} + \frac {2 \, \sqrt {b x^{2} + a} A c d}{b} - \frac {2 \, \sqrt {b x^{2} + a} B a d^{2}}{3 \, b^{2}} + \frac {{\left (2 \, B c d + A d^{2}\right )} \sqrt {b x^{2} + a} x}{2 \, b} - \frac {{\left (2 \, B c d + A d^{2}\right )} a \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{2 \, b^{\frac {3}{2}}} \] Input:

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

Output:

1/3*sqrt(b*x^2 + a)*B*d^2*x^2/b + A*c^2*arcsinh(b*x/sqrt(a*b))/sqrt(b) + s 
qrt(b*x^2 + a)*B*c^2/b + 2*sqrt(b*x^2 + a)*A*c*d/b - 2/3*sqrt(b*x^2 + a)*B 
*a*d^2/b^2 + 1/2*(2*B*c*d + A*d^2)*sqrt(b*x^2 + a)*x/b - 1/2*(2*B*c*d + A* 
d^2)*a*arcsinh(b*x/sqrt(a*b))/b^(3/2)
 

Giac [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.95 \[ \int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx=\frac {1}{6} \, \sqrt {b x^{2} + a} {\left ({\left (\frac {2 \, B d^{2} x}{b} + \frac {3 \, {\left (2 \, B b^{2} c d + A b^{2} d^{2}\right )}}{b^{3}}\right )} x + \frac {2 \, {\left (3 \, B b^{2} c^{2} + 6 \, A b^{2} c d - 2 \, B a b d^{2}\right )}}{b^{3}}\right )} - \frac {{\left (2 \, A b c^{2} - 2 \, B a c d - A a d^{2}\right )} \log \left ({\left | -\sqrt {b} x + \sqrt {b x^{2} + a} \right |}\right )}{2 \, b^{\frac {3}{2}}} \] Input:

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

Output:

1/6*sqrt(b*x^2 + a)*((2*B*d^2*x/b + 3*(2*B*b^2*c*d + A*b^2*d^2)/b^3)*x + 2 
*(3*B*b^2*c^2 + 6*A*b^2*c*d - 2*B*a*b*d^2)/b^3) - 1/2*(2*A*b*c^2 - 2*B*a*c 
*d - A*a*d^2)*log(abs(-sqrt(b)*x + sqrt(b*x^2 + a)))/b^(3/2)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.43 \[ \int \frac {(A+B x) (c+d x)^2}{\sqrt {a+b x^2}} \, dx=\frac {12 \sqrt {b \,x^{2}+a}\, a b c d +3 \sqrt {b \,x^{2}+a}\, a b \,d^{2} x -4 \sqrt {b \,x^{2}+a}\, a b \,d^{2}+6 \sqrt {b \,x^{2}+a}\, b^{2} c^{2}+6 \sqrt {b \,x^{2}+a}\, b^{2} c d x +2 \sqrt {b \,x^{2}+a}\, b^{2} d^{2} x^{2}-3 \sqrt {b}\, \mathrm {log}\left (\frac {\sqrt {b \,x^{2}+a}+\sqrt {b}\, x}{\sqrt {a}}\right ) a^{2} d^{2}+6 \sqrt {b}\, \mathrm {log}\left (\frac {\sqrt {b \,x^{2}+a}+\sqrt {b}\, x}{\sqrt {a}}\right ) a b \,c^{2}-6 \sqrt {b}\, \mathrm {log}\left (\frac {\sqrt {b \,x^{2}+a}+\sqrt {b}\, x}{\sqrt {a}}\right ) a b c d}{6 b^{2}} \] Input:

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

Output:

(12*sqrt(a + b*x**2)*a*b*c*d + 3*sqrt(a + b*x**2)*a*b*d**2*x - 4*sqrt(a + 
b*x**2)*a*b*d**2 + 6*sqrt(a + b*x**2)*b**2*c**2 + 6*sqrt(a + b*x**2)*b**2* 
c*d*x + 2*sqrt(a + b*x**2)*b**2*d**2*x**2 - 3*sqrt(b)*log((sqrt(a + b*x**2 
) + sqrt(b)*x)/sqrt(a))*a**2*d**2 + 6*sqrt(b)*log((sqrt(a + b*x**2) + sqrt 
(b)*x)/sqrt(a))*a*b*c**2 - 6*sqrt(b)*log((sqrt(a + b*x**2) + sqrt(b)*x)/sq 
rt(a))*a*b*c*d)/(6*b**2)