Integrand size = 29, antiderivative size = 166 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=-\frac {a (A b-a B) x (a+b x)}{b^3 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {(A b-a B) x^2 (a+b x)}{2 b^2 \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {B x^3 (a+b x)}{3 b \sqrt {a^2+2 a b x+b^2 x^2}}+\frac {a^2 (A b-a B) (a+b x) \log (a+b x)}{b^4 \sqrt {a^2+2 a b x+b^2 x^2}} \] Output:
-a*(A*b-B*a)*x*(b*x+a)/b^3/((b*x+a)^2)^(1/2)+1/2*(A*b-B*a)*x^2*(b*x+a)/b^2 /((b*x+a)^2)^(1/2)+1/3*B*x^3*(b*x+a)/b/((b*x+a)^2)^(1/2)+a^2*(A*b-B*a)*(b* x+a)*ln(b*x+a)/b^4/((b*x+a)^2)^(1/2)
Time = 1.05 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.46 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {(a+b x) \left (b x \left (6 a^2 B-3 a b (2 A+B x)+b^2 x (3 A+2 B x)\right )+6 a^2 (A b-a B) \log (a+b x)\right )}{6 b^4 \sqrt {(a+b x)^2}} \] Input:
Integrate[(x^2*(A + B*x))/Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]
Output:
((a + b*x)*(b*x*(6*a^2*B - 3*a*b*(2*A + B*x) + b^2*x*(3*A + 2*B*x)) + 6*a^ 2*(A*b - a*B)*Log[a + b*x]))/(6*b^4*Sqrt[(a + b*x)^2])
Time = 0.44 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.55, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {1187, 27, 86, 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 {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx\) |
\(\Big \downarrow \) 1187 |
\(\displaystyle \frac {b (a+b x) \int \frac {x^2 (A+B x)}{b (a+b x)}dx}{\sqrt {a^2+2 a b x+b^2 x^2}}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {(a+b x) \int \frac {x^2 (A+B x)}{a+b x}dx}{\sqrt {a^2+2 a b x+b^2 x^2}}\) |
\(\Big \downarrow \) 86 |
\(\displaystyle \frac {(a+b x) \int \left (-\frac {(a B-A b) a^2}{b^3 (a+b x)}+\frac {(a B-A b) a}{b^3}+\frac {B x^2}{b}+\frac {(A b-a B) x}{b^2}\right )dx}{\sqrt {a^2+2 a b x+b^2 x^2}}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {(a+b x) \left (\frac {a^2 (A b-a B) \log (a+b x)}{b^4}-\frac {a x (A b-a B)}{b^3}+\frac {x^2 (A b-a B)}{2 b^2}+\frac {B x^3}{3 b}\right )}{\sqrt {a^2+2 a b x+b^2 x^2}}\) |
Input:
Int[(x^2*(A + B*x))/Sqrt[a^2 + 2*a*b*x + b^2*x^2],x]
Output:
((a + b*x)*(-((a*(A*b - a*B)*x)/b^3) + ((A*b - a*B)*x^2)/(2*b^2) + (B*x^3) /(3*b) + (a^2*(A*b - a*B)*Log[a + b*x])/b^4))/Sqrt[a^2 + 2*a*b*x + b^2*x^2 ]
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ .), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 ] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.)*((a_) + (b_.)*(x_ ) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(a + b*x + c*x^2)^FracPart[p]/(c^ IntPart[p]*(b/2 + c*x)^(2*FracPart[p])) Int[(d + e*x)^m*(f + g*x)^n*(b/2 + c*x)^(2*p), x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && EqQ[b^2 - 4*a*c, 0] && !IntegerQ[p]
Time = 0.80 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.54
method | result | size |
default | \(\frac {\left (b x +a \right ) \left (2 x^{3} B \,b^{3}+3 A \,b^{3} x^{2}-3 B a \,b^{2} x^{2}+6 A \ln \left (b x +a \right ) a^{2} b -6 A a \,b^{2} x -6 B \ln \left (b x +a \right ) a^{3}+6 B \,a^{2} b x \right )}{6 \sqrt {\left (b x +a \right )^{2}}\, b^{4}}\) | \(90\) |
risch | \(\frac {\sqrt {\left (b x +a \right )^{2}}\, \left (\frac {1}{3} x^{3} B \,b^{2}+\frac {1}{2} x^{2} b^{2} A -\frac {1}{2} B a \,x^{2} b -a b A x +a^{2} B x \right )}{\left (b x +a \right ) b^{3}}+\frac {\sqrt {\left (b x +a \right )^{2}}\, a^{2} \left (A b -B a \right ) \ln \left (b x +a \right )}{\left (b x +a \right ) b^{4}}\) | \(98\) |
Input:
int(x^2*(B*x+A)/((b*x+a)^2)^(1/2),x,method=_RETURNVERBOSE)
Output:
1/6*(b*x+a)*(2*x^3*B*b^3+3*A*b^3*x^2-3*B*a*b^2*x^2+6*A*ln(b*x+a)*a^2*b-6*A *a*b^2*x-6*B*ln(b*x+a)*a^3+6*B*a^2*b*x)/((b*x+a)^2)^(1/2)/b^4
Time = 0.07 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.43 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {2 \, B b^{3} x^{3} - 3 \, {\left (B a b^{2} - A b^{3}\right )} x^{2} + 6 \, {\left (B a^{2} b - A a b^{2}\right )} x - 6 \, {\left (B a^{3} - A a^{2} b\right )} \log \left (b x + a\right )}{6 \, b^{4}} \] Input:
integrate(x^2*(B*x+A)/((b*x+a)^2)^(1/2),x, algorithm="fricas")
Output:
1/6*(2*B*b^3*x^3 - 3*(B*a*b^2 - A*b^3)*x^2 + 6*(B*a^2*b - A*a*b^2)*x - 6*( B*a^3 - A*a^2*b)*log(b*x + a))/b^4
Leaf count of result is larger than twice the leaf count of optimal. 330 vs. \(2 (119) = 238\).
Time = 1.21 (sec) , antiderivative size = 330, normalized size of antiderivative = 1.99 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\begin {cases} \sqrt {a^{2} + 2 a b x + b^{2} x^{2}} \left (\frac {B x^{2}}{3 b^{2}} + \frac {x \left (A - \frac {5 B a}{3 b}\right )}{2 b^{2}} + \frac {- \frac {2 B a^{2}}{3 b^{2}} - \frac {3 a \left (A - \frac {5 B a}{3 b}\right )}{2 b}}{b^{2}}\right ) + \frac {\left (\frac {a}{b} + x\right ) \left (- \frac {a^{2} \left (A - \frac {5 B a}{3 b}\right )}{2 b^{2}} - \frac {a \left (- \frac {2 B a^{2}}{3 b^{2}} - \frac {3 a \left (A - \frac {5 B a}{3 b}\right )}{2 b}\right )}{b}\right ) \log {\left (\frac {a}{b} + x \right )}}{\sqrt {b^{2} \left (\frac {a}{b} + x\right )^{2}}} & \text {for}\: b^{2} \neq 0 \\\frac {\frac {A \left (a^{4} \sqrt {a^{2} + 2 a b x} - \frac {2 a^{2} \left (a^{2} + 2 a b x\right )^{\frac {3}{2}}}{3} + \frac {\left (a^{2} + 2 a b x\right )^{\frac {5}{2}}}{5}\right )}{2 a^{2} b^{2}} + \frac {B \left (- a^{6} \sqrt {a^{2} + 2 a b x} + a^{4} \left (a^{2} + 2 a b x\right )^{\frac {3}{2}} - \frac {3 a^{2} \left (a^{2} + 2 a b x\right )^{\frac {5}{2}}}{5} + \frac {\left (a^{2} + 2 a b x\right )^{\frac {7}{2}}}{7}\right )}{4 a^{3} b^{3}}}{2 a b} & \text {for}\: a b \neq 0 \\\frac {\frac {A x^{3}}{3} + \frac {B x^{4}}{4}}{\sqrt {a^{2}}} & \text {otherwise} \end {cases} \] Input:
integrate(x**2*(B*x+A)/((b*x+a)**2)**(1/2),x)
Output:
Piecewise((sqrt(a**2 + 2*a*b*x + b**2*x**2)*(B*x**2/(3*b**2) + x*(A - 5*B* a/(3*b))/(2*b**2) + (-2*B*a**2/(3*b**2) - 3*a*(A - 5*B*a/(3*b))/(2*b))/b** 2) + (a/b + x)*(-a**2*(A - 5*B*a/(3*b))/(2*b**2) - a*(-2*B*a**2/(3*b**2) - 3*a*(A - 5*B*a/(3*b))/(2*b))/b)*log(a/b + x)/sqrt(b**2*(a/b + x)**2), Ne( b**2, 0)), ((A*(a**4*sqrt(a**2 + 2*a*b*x) - 2*a**2*(a**2 + 2*a*b*x)**(3/2) /3 + (a**2 + 2*a*b*x)**(5/2)/5)/(2*a**2*b**2) + B*(-a**6*sqrt(a**2 + 2*a*b *x) + a**4*(a**2 + 2*a*b*x)**(3/2) - 3*a**2*(a**2 + 2*a*b*x)**(5/2)/5 + (a **2 + 2*a*b*x)**(7/2)/7)/(4*a**3*b**3))/(2*a*b), Ne(a*b, 0)), ((A*x**3/3 + B*x**4/4)/sqrt(a**2), True))
Time = 0.03 (sec) , antiderivative size = 125, normalized size of antiderivative = 0.75 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=-\frac {5 \, B a x^{2}}{6 \, b^{2}} + \frac {A x^{2}}{2 \, b} + \frac {\sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} B x^{2}}{3 \, b^{2}} + \frac {5 \, B a^{2} x}{3 \, b^{3}} - \frac {A a x}{b^{2}} - \frac {B a^{3} \log \left (x + \frac {a}{b}\right )}{b^{4}} + \frac {A a^{2} \log \left (x + \frac {a}{b}\right )}{b^{3}} - \frac {2 \, \sqrt {b^{2} x^{2} + 2 \, a b x + a^{2}} B a^{2}}{3 \, b^{4}} \] Input:
integrate(x^2*(B*x+A)/((b*x+a)^2)^(1/2),x, algorithm="maxima")
Output:
-5/6*B*a*x^2/b^2 + 1/2*A*x^2/b + 1/3*sqrt(b^2*x^2 + 2*a*b*x + a^2)*B*x^2/b ^2 + 5/3*B*a^2*x/b^3 - A*a*x/b^2 - B*a^3*log(x + a/b)/b^4 + A*a^2*log(x + a/b)/b^3 - 2/3*sqrt(b^2*x^2 + 2*a*b*x + a^2)*B*a^2/b^4
Time = 0.24 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.68 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {2 \, B b^{2} x^{3} \mathrm {sgn}\left (b x + a\right ) - 3 \, B a b x^{2} \mathrm {sgn}\left (b x + a\right ) + 3 \, A b^{2} x^{2} \mathrm {sgn}\left (b x + a\right ) + 6 \, B a^{2} x \mathrm {sgn}\left (b x + a\right ) - 6 \, A a b x \mathrm {sgn}\left (b x + a\right )}{6 \, b^{3}} - \frac {{\left (B a^{3} \mathrm {sgn}\left (b x + a\right ) - A a^{2} b \mathrm {sgn}\left (b x + a\right )\right )} \log \left ({\left | b x + a \right |}\right )}{b^{4}} \] Input:
integrate(x^2*(B*x+A)/((b*x+a)^2)^(1/2),x, algorithm="giac")
Output:
1/6*(2*B*b^2*x^3*sgn(b*x + a) - 3*B*a*b*x^2*sgn(b*x + a) + 3*A*b^2*x^2*sgn (b*x + a) + 6*B*a^2*x*sgn(b*x + a) - 6*A*a*b*x*sgn(b*x + a))/b^3 - (B*a^3* sgn(b*x + a) - A*a^2*b*sgn(b*x + a))*log(abs(b*x + a))/b^4
Timed out. \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\int \frac {x^2\,\left (A+B\,x\right )}{\sqrt {{\left (a+b\,x\right )}^2}} \,d x \] Input:
int((x^2*(A + B*x))/((a + b*x)^2)^(1/2),x)
Output:
int((x^2*(A + B*x))/((a + b*x)^2)^(1/2), x)
Time = 0.27 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.03 \[ \int \frac {x^2 (A+B x)}{\sqrt {a^2+2 a b x+b^2 x^2}} \, dx=\frac {x^{3}}{3} \] Input:
int(x^2*(B*x+A)/((b*x+a)^2)^(1/2),x)
Output:
x**3/3