Integrand size = 22, antiderivative size = 86 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=2 a^2 A \sqrt {x}+\frac {2 a (2 A b+a B) x^{\frac {1}{2}+n}}{1+2 n}+\frac {2 b (A b+2 a B) x^{\frac {1}{2}+2 n}}{1+4 n}+\frac {2 b^2 B x^{\frac {1}{2}+3 n}}{1+6 n} \] Output:
2*a^2*A*x^(1/2)+2*a*(2*A*b+B*a)*x^(1/2+n)/(1+2*n)+2*b*(A*b+2*B*a)*x^(1/2+2 *n)/(1+4*n)+2*b^2*B*x^(1/2+3*n)/(1+6*n)
Time = 0.21 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.98 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=2 \left (a^2 A \sqrt {x}+\frac {a (2 A b+a B) x^{\frac {1}{2}+n}}{1+2 n}+\frac {b (A b+2 a B) x^{\frac {1}{2}+2 n}}{1+4 n}+\frac {b^2 B x^{\frac {1}{2}+3 n}}{1+6 n}\right ) \] Input:
Integrate[((a + b*x^n)^2*(A + B*x^n))/Sqrt[x],x]
Output:
2*(a^2*A*Sqrt[x] + (a*(2*A*b + a*B)*x^(1/2 + n))/(1 + 2*n) + (b*(A*b + 2*a *B)*x^(1/2 + 2*n))/(1 + 4*n) + (b^2*B*x^(1/2 + 3*n))/(1 + 6*n))
Time = 0.37 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {950, 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 {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx\) |
\(\Big \downarrow \) 950 |
\(\displaystyle \int \left (\frac {a^2 A}{\sqrt {x}}+a x^{n-\frac {1}{2}} (a B+2 A b)+b x^{2 n-\frac {1}{2}} (2 a B+A b)+b^2 B x^{3 n-\frac {1}{2}}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle 2 a^2 A \sqrt {x}+\frac {2 a x^{n+\frac {1}{2}} (a B+2 A b)}{2 n+1}+\frac {2 b x^{2 n+\frac {1}{2}} (2 a B+A b)}{4 n+1}+\frac {2 b^2 B x^{3 n+\frac {1}{2}}}{6 n+1}\) |
Input:
Int[((a + b*x^n)^2*(A + B*x^n))/Sqrt[x],x]
Output:
2*a^2*A*Sqrt[x] + (2*a*(2*A*b + a*B)*x^(1/2 + n))/(1 + 2*n) + (2*b*(A*b + 2*a*B)*x^(1/2 + 2*n))/(1 + 4*n) + (2*b^2*B*x^(1/2 + 3*n))/(1 + 6*n)
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n _))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(a + b*x^n)^p*(c + d*x^ n)^q, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] && IGt Q[p, 0] && IGtQ[q, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(613\) vs. \(2(78)=156\).
Time = 0.28 (sec) , antiderivative size = 614, normalized size of antiderivative = 7.14
method | result | size |
orering | \(\frac {24 \sqrt {x}\, n \left (4 n^{2}+1\right ) \left (a +b \,x^{n}\right )^{2} \left (A +B \,x^{n}\right )}{48 n^{3}+44 n^{2}+12 n +1}-\frac {8 x^{2} \left (22 n^{2}-18 n +5\right ) \left (\frac {2 \left (a +b \,x^{n}\right ) \left (A +B \,x^{n}\right ) b \,x^{n} n}{x^{\frac {3}{2}}}+\frac {\left (a +b \,x^{n}\right )^{2} B \,x^{n} n}{x^{\frac {3}{2}}}-\frac {\left (a +b \,x^{n}\right )^{2} \left (A +B \,x^{n}\right )}{2 x^{\frac {3}{2}}}\right )}{48 n^{3}+44 n^{2}+12 n +1}+\frac {32 x^{3} \left (-2+3 n \right ) \left (\frac {2 b^{2} x^{2 n} n^{2} \left (A +B \,x^{n}\right )}{x^{\frac {5}{2}}}+\frac {4 \left (a +b \,x^{n}\right ) B \,x^{2 n} n^{2} b}{x^{\frac {5}{2}}}-\frac {4 \left (a +b \,x^{n}\right ) \left (A +B \,x^{n}\right ) b \,x^{n} n}{x^{\frac {5}{2}}}+\frac {2 \left (a +b \,x^{n}\right ) \left (A +B \,x^{n}\right ) b \,x^{n} n^{2}}{x^{\frac {5}{2}}}+\frac {\left (a +b \,x^{n}\right )^{2} B \,x^{n} n^{2}}{x^{\frac {5}{2}}}-\frac {2 \left (a +b \,x^{n}\right )^{2} B \,x^{n} n}{x^{\frac {5}{2}}}+\frac {3 \left (a +b \,x^{n}\right )^{2} \left (A +B \,x^{n}\right )}{4 x^{\frac {5}{2}}}\right )}{48 n^{3}+44 n^{2}+12 n +1}-\frac {16 x^{4} \left (\frac {6 b^{2} x^{2 n} n^{3} \left (A +B \,x^{n}\right )}{x^{\frac {7}{2}}}-\frac {9 b^{2} x^{2 n} n^{2} \left (A +B \,x^{n}\right )}{x^{\frac {7}{2}}}+\frac {6 b^{2} x^{3 n} n^{3} B}{x^{\frac {7}{2}}}+\frac {12 \left (a +b \,x^{n}\right ) B \,x^{2 n} n^{3} b}{x^{\frac {7}{2}}}-\frac {18 \left (a +b \,x^{n}\right ) B \,x^{2 n} n^{2} b}{x^{\frac {7}{2}}}+\frac {23 \left (a +b \,x^{n}\right ) \left (A +B \,x^{n}\right ) b \,x^{n} n}{2 x^{\frac {7}{2}}}-\frac {9 \left (a +b \,x^{n}\right ) \left (A +B \,x^{n}\right ) b \,x^{n} n^{2}}{x^{\frac {7}{2}}}+\frac {2 \left (a +b \,x^{n}\right ) \left (A +B \,x^{n}\right ) b \,x^{n} n^{3}}{x^{\frac {7}{2}}}+\frac {\left (a +b \,x^{n}\right )^{2} B \,x^{n} n^{3}}{x^{\frac {7}{2}}}-\frac {9 \left (a +b \,x^{n}\right )^{2} B \,x^{n} n^{2}}{2 x^{\frac {7}{2}}}+\frac {23 \left (a +b \,x^{n}\right )^{2} B \,x^{n} n}{4 x^{\frac {7}{2}}}-\frac {15 \left (a +b \,x^{n}\right )^{2} \left (A +B \,x^{n}\right )}{8 x^{\frac {7}{2}}}\right )}{48 n^{3}+44 n^{2}+12 n +1}\) | \(614\) |
Input:
int((a+b*x^n)^2*(A+B*x^n)/x^(1/2),x,method=_RETURNVERBOSE)
Output:
24*x^(1/2)*n*(4*n^2+1)/(48*n^3+44*n^2+12*n+1)*(a+b*x^n)^2*(A+B*x^n)-8*x^2* (22*n^2-18*n+5)/(48*n^3+44*n^2+12*n+1)*(2*(a+b*x^n)*(A+B*x^n)/x^(3/2)*b*x^ n*n+(a+b*x^n)^2*B*x^n*n/x^(3/2)-1/2*(a+b*x^n)^2*(A+B*x^n)/x^(3/2))+32*x^3* (-2+3*n)/(48*n^3+44*n^2+12*n+1)*(2*b^2*(x^n)^2*n^2/x^(5/2)*(A+B*x^n)+4*(a+ b*x^n)*B*(x^n)^2*n^2/x^(5/2)*b-4*(a+b*x^n)*(A+B*x^n)/x^(5/2)*b*x^n*n+2*(a+ b*x^n)*(A+B*x^n)/x^(5/2)*b*x^n*n^2+(a+b*x^n)^2*B*x^n*n^2/x^(5/2)-2*(a+b*x^ n)^2*B*x^n*n/x^(5/2)+3/4*(a+b*x^n)^2*(A+B*x^n)/x^(5/2))-16/(48*n^3+44*n^2+ 12*n+1)*x^4*(6*b^2*(x^n)^2*n^3/x^(7/2)*(A+B*x^n)-9*b^2*(x^n)^2*n^2/x^(7/2) *(A+B*x^n)+6*b^2*(x^n)^3*n^3/x^(7/2)*B+12*(a+b*x^n)*B*(x^n)^2*n^3/x^(7/2)* b-18*(a+b*x^n)*B*(x^n)^2*n^2/x^(7/2)*b+23/2*(a+b*x^n)*(A+B*x^n)/x^(7/2)*b* x^n*n-9*(a+b*x^n)*(A+B*x^n)/x^(7/2)*b*x^n*n^2+2*(a+b*x^n)*(A+B*x^n)/x^(7/2 )*b*x^n*n^3+(a+b*x^n)^2*B*x^n*n^3/x^(7/2)-9/2*(a+b*x^n)^2*B*x^n*n^2/x^(7/2 )+23/4*(a+b*x^n)^2*B*x^n*n/x^(7/2)-15/8*(a+b*x^n)^2*(A+B*x^n)/x^(7/2))
Leaf count of result is larger than twice the leaf count of optimal. 184 vs. \(2 (78) = 156\).
Time = 0.11 (sec) , antiderivative size = 184, normalized size of antiderivative = 2.14 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=\frac {2 \, {\left ({\left (8 \, B b^{2} n^{2} + 6 \, B b^{2} n + B b^{2}\right )} \sqrt {x} x^{3 \, n} + {\left (2 \, B a b + A b^{2} + 12 \, {\left (2 \, B a b + A b^{2}\right )} n^{2} + 8 \, {\left (2 \, B a b + A b^{2}\right )} n\right )} \sqrt {x} x^{2 \, n} + {\left (B a^{2} + 2 \, A a b + 24 \, {\left (B a^{2} + 2 \, A a b\right )} n^{2} + 10 \, {\left (B a^{2} + 2 \, A a b\right )} n\right )} \sqrt {x} x^{n} + {\left (48 \, A a^{2} n^{3} + 44 \, A a^{2} n^{2} + 12 \, A a^{2} n + A a^{2}\right )} \sqrt {x}\right )}}{48 \, n^{3} + 44 \, n^{2} + 12 \, n + 1} \] Input:
integrate((a+b*x^n)^2*(A+B*x^n)/x^(1/2),x, algorithm="fricas")
Output:
2*((8*B*b^2*n^2 + 6*B*b^2*n + B*b^2)*sqrt(x)*x^(3*n) + (2*B*a*b + A*b^2 + 12*(2*B*a*b + A*b^2)*n^2 + 8*(2*B*a*b + A*b^2)*n)*sqrt(x)*x^(2*n) + (B*a^2 + 2*A*a*b + 24*(B*a^2 + 2*A*a*b)*n^2 + 10*(B*a^2 + 2*A*a*b)*n)*sqrt(x)*x^ n + (48*A*a^2*n^3 + 44*A*a^2*n^2 + 12*A*a^2*n + A*a^2)*sqrt(x))/(48*n^3 + 44*n^2 + 12*n + 1)
Time = 3.03 (sec) , antiderivative size = 233, normalized size of antiderivative = 2.71 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=2 A a^{2} \sqrt {x} - 4 A a b \left (\begin {cases} \frac {\sqrt {x} x^{n}}{- 2 n - 1} & \text {for}\: n \neq - \frac {1}{2} \\\sqrt {x} x^{n} \log {\left (\frac {1}{\sqrt {x}} \right )} & \text {otherwise} \end {cases}\right ) - 2 A b^{2} \left (\begin {cases} \frac {\sqrt {x} x^{2 n}}{- 4 n - 1} & \text {for}\: n \neq - \frac {1}{4} \\\sqrt {x} x^{2 n} \log {\left (\frac {1}{\sqrt {x}} \right )} & \text {otherwise} \end {cases}\right ) - 2 B a^{2} \left (\begin {cases} \frac {\sqrt {x} x^{n}}{- 2 n - 1} & \text {for}\: n \neq - \frac {1}{2} \\\sqrt {x} x^{n} \log {\left (\frac {1}{\sqrt {x}} \right )} & \text {otherwise} \end {cases}\right ) - 4 B a b \left (\begin {cases} \frac {\sqrt {x} x^{2 n}}{- 4 n - 1} & \text {for}\: n \neq - \frac {1}{4} \\\sqrt {x} x^{2 n} \log {\left (\frac {1}{\sqrt {x}} \right )} & \text {otherwise} \end {cases}\right ) - 2 B b^{2} \left (\begin {cases} \frac {\sqrt {x} x^{3 n}}{- 6 n - 1} & \text {for}\: n \neq - \frac {1}{6} \\\sqrt {x} x^{3 n} \log {\left (\frac {1}{\sqrt {x}} \right )} & \text {otherwise} \end {cases}\right ) \] Input:
integrate((a+b*x**n)**2*(A+B*x**n)/x**(1/2),x)
Output:
2*A*a**2*sqrt(x) - 4*A*a*b*Piecewise((sqrt(x)*x**n/(-2*n - 1), Ne(n, -1/2) ), (sqrt(x)*x**n*log(1/sqrt(x)), True)) - 2*A*b**2*Piecewise((sqrt(x)*x**( 2*n)/(-4*n - 1), Ne(n, -1/4)), (sqrt(x)*x**(2*n)*log(1/sqrt(x)), True)) - 2*B*a**2*Piecewise((sqrt(x)*x**n/(-2*n - 1), Ne(n, -1/2)), (sqrt(x)*x**n*l og(1/sqrt(x)), True)) - 4*B*a*b*Piecewise((sqrt(x)*x**(2*n)/(-4*n - 1), Ne (n, -1/4)), (sqrt(x)*x**(2*n)*log(1/sqrt(x)), True)) - 2*B*b**2*Piecewise( (sqrt(x)*x**(3*n)/(-6*n - 1), Ne(n, -1/6)), (sqrt(x)*x**(3*n)*log(1/sqrt(x )), True))
Time = 0.03 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.21 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=2 \, A a^{2} \sqrt {x} + \frac {2 \, B b^{2} x^{3 \, n + \frac {1}{2}}}{6 \, n + 1} + \frac {4 \, B a b x^{2 \, n + \frac {1}{2}}}{4 \, n + 1} + \frac {2 \, A b^{2} x^{2 \, n + \frac {1}{2}}}{4 \, n + 1} + \frac {2 \, B a^{2} x^{n + \frac {1}{2}}}{2 \, n + 1} + \frac {4 \, A a b x^{n + \frac {1}{2}}}{2 \, n + 1} \] Input:
integrate((a+b*x^n)^2*(A+B*x^n)/x^(1/2),x, algorithm="maxima")
Output:
2*A*a^2*sqrt(x) + 2*B*b^2*x^(3*n + 1/2)/(6*n + 1) + 4*B*a*b*x^(2*n + 1/2)/ (4*n + 1) + 2*A*b^2*x^(2*n + 1/2)/(4*n + 1) + 2*B*a^2*x^(n + 1/2)/(2*n + 1 ) + 4*A*a*b*x^(n + 1/2)/(2*n + 1)
Time = 0.13 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.21 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=2 \, A a^{2} \sqrt {x} + \frac {2 \, B b^{2} x^{3 \, n + \frac {1}{2}}}{6 \, n + 1} + \frac {4 \, B a b x^{2 \, n + \frac {1}{2}}}{4 \, n + 1} + \frac {2 \, A b^{2} x^{2 \, n + \frac {1}{2}}}{4 \, n + 1} + \frac {2 \, B a^{2} x^{n + \frac {1}{2}}}{2 \, n + 1} + \frac {4 \, A a b x^{n + \frac {1}{2}}}{2 \, n + 1} \] Input:
integrate((a+b*x^n)^2*(A+B*x^n)/x^(1/2),x, algorithm="giac")
Output:
2*A*a^2*sqrt(x) + 2*B*b^2*x^(3*n + 1/2)/(6*n + 1) + 4*B*a*b*x^(2*n + 1/2)/ (4*n + 1) + 2*A*b^2*x^(2*n + 1/2)/(4*n + 1) + 2*B*a^2*x^(n + 1/2)/(2*n + 1 ) + 4*A*a*b*x^(n + 1/2)/(2*n + 1)
Time = 4.13 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.99 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=2\,A\,a^2\,\sqrt {x}+\frac {x^n\,\sqrt {x}\,\left (2\,B\,a^2+4\,A\,b\,a\right )}{2\,n+1}+\frac {x^{2\,n}\,\sqrt {x}\,\left (2\,A\,b^2+4\,B\,a\,b\right )}{4\,n+1}+\frac {2\,B\,b^2\,x^{3\,n}\,\sqrt {x}}{6\,n+1} \] Input:
int(((A + B*x^n)*(a + b*x^n)^2)/x^(1/2),x)
Output:
2*A*a^2*x^(1/2) + (x^n*x^(1/2)*(2*B*a^2 + 4*A*a*b))/(2*n + 1) + (x^(2*n)*x ^(1/2)*(2*A*b^2 + 4*B*a*b))/(4*n + 1) + (2*B*b^2*x^(3*n)*x^(1/2))/(6*n + 1 )
Time = 0.20 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.72 \[ \int \frac {\left (a+b x^n\right )^2 \left (A+B x^n\right )}{\sqrt {x}} \, dx=\frac {2 \sqrt {x}\, \left (8 x^{3 n} b^{3} n^{2}+6 x^{3 n} b^{3} n +x^{3 n} b^{3}+36 x^{2 n} a \,b^{2} n^{2}+24 x^{2 n} a \,b^{2} n +3 x^{2 n} a \,b^{2}+72 x^{n} a^{2} b \,n^{2}+30 x^{n} a^{2} b n +3 x^{n} a^{2} b +48 a^{3} n^{3}+44 a^{3} n^{2}+12 a^{3} n +a^{3}\right )}{48 n^{3}+44 n^{2}+12 n +1} \] Input:
int((a+b*x^n)^2*(A+B*x^n)/x^(1/2),x)
Output:
(2*sqrt(x)*(8*x**(3*n)*b**3*n**2 + 6*x**(3*n)*b**3*n + x**(3*n)*b**3 + 36* x**(2*n)*a*b**2*n**2 + 24*x**(2*n)*a*b**2*n + 3*x**(2*n)*a*b**2 + 72*x**n* a**2*b*n**2 + 30*x**n*a**2*b*n + 3*x**n*a**2*b + 48*a**3*n**3 + 44*a**3*n* *2 + 12*a**3*n + a**3))/(48*n**3 + 44*n**2 + 12*n + 1)