Integrand size = 17, antiderivative size = 70 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=a c^2 x+\frac {c (b c+2 a d) x^{1+n}}{1+n}+\frac {d (2 b c+a d) x^{1+2 n}}{1+2 n}+\frac {b d^2 x^{1+3 n}}{1+3 n} \] Output:
a*c^2*x+c*(2*a*d+b*c)*x^(1+n)/(1+n)+d*(a*d+2*b*c)*x^(1+2*n)/(1+2*n)+b*d^2* x^(1+3*n)/(1+3*n)
Time = 0.16 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.00 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=\frac {b x \left (c+d x^n\right )^3-(b c-a d (1+3 n)) x \left (c^2+\frac {2 c d x^n}{1+n}+\frac {d^2 x^{2 n}}{1+2 n}\right )}{d+3 d n} \] Input:
Integrate[(a + b*x^n)*(c + d*x^n)^2,x]
Output:
(b*x*(c + d*x^n)^3 - (b*c - a*d*(1 + 3*n))*x*(c^2 + (2*c*d*x^n)/(1 + n) + (d^2*x^(2*n))/(1 + 2*n)))/(d + 3*d*n)
Time = 0.37 (sec) , antiderivative size = 70, 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.118, Rules used = {897, 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 \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx\) |
\(\Big \downarrow \) 897 |
\(\displaystyle \int \left (d x^{2 n} (a d+2 b c)+c x^n (2 a d+b c)+a c^2+b d^2 x^{3 n}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {c x^{n+1} (2 a d+b c)}{n+1}+\frac {d x^{2 n+1} (a d+2 b c)}{2 n+1}+a c^2 x+\frac {b d^2 x^{3 n+1}}{3 n+1}\) |
Input:
Int[(a + b*x^n)*(c + d*x^n)^2,x]
Output:
a*c^2*x + (c*(b*c + 2*a*d)*x^(1 + n))/(1 + n) + (d*(2*b*c + a*d)*x^(1 + 2* n))/(1 + 2*n) + (b*d^2*x^(1 + 3*n))/(1 + 3*n)
Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol ] :> Int[ExpandIntegrand[(a + b*x^n)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b , c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && IGtQ[q, 0]
Time = 0.72 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.97
method | result | size |
risch | \(a \,c^{2} x +\frac {b \,d^{2} x \,x^{3 n}}{1+3 n}+\frac {c \left (2 a d +b c \right ) x \,x^{n}}{1+n}+\frac {d \left (a d +2 b c \right ) x \,x^{2 n}}{1+2 n}\) | \(68\) |
norman | \(a \,c^{2} x +\frac {b \,d^{2} x \,{\mathrm e}^{3 n \ln \left (x \right )}}{1+3 n}+\frac {c \left (2 a d +b c \right ) x \,{\mathrm e}^{n \ln \left (x \right )}}{1+n}+\frac {d \left (a d +2 b c \right ) x \,{\mathrm e}^{2 n \ln \left (x \right )}}{1+2 n}\) | \(74\) |
parallelrisch | \(\frac {2 x \,x^{3 n} b \,d^{2} n^{2}+3 x \,x^{3 n} b \,d^{2} n +3 x \,x^{2 n} a \,d^{2} n^{2}+6 x \,x^{2 n} b c d \,n^{2}+b \,d^{2} x \,x^{3 n}+4 x \,x^{2 n} a \,d^{2} n +8 x \,x^{2 n} b c d n +12 x \,x^{n} a c d \,n^{2}+6 x \,x^{n} b \,c^{2} n^{2}+6 x a \,c^{2} n^{3}+x \,x^{2 n} a \,d^{2}+2 x \,x^{2 n} b c d +10 x \,x^{n} a c d n +5 x \,x^{n} b \,c^{2} n +11 x a \,c^{2} n^{2}+2 x \,x^{n} a c d +x \,x^{n} b \,c^{2}+6 x a \,c^{2} n +a \,c^{2} x}{\left (1+3 n \right ) \left (1+n \right ) \left (1+2 n \right )}\) | \(235\) |
orering | \(x \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right )^{2}-\frac {x^{2} \left (11 n^{2}+1\right ) \left (\frac {b \,x^{n} n \left (c +d \,x^{n}\right )^{2}}{x}+\frac {2 \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right ) d \,x^{n} n}{x}\right )}{\left (2 n^{2}+3 n +1\right ) \left (1+3 n \right )}+\frac {2 x^{3} \left (-1+3 n \right ) \left (\frac {b \,x^{n} n^{2} \left (c +d \,x^{n}\right )^{2}}{x^{2}}-\frac {b \,x^{n} n \left (c +d \,x^{n}\right )^{2}}{x^{2}}+\frac {4 b \,x^{2 n} n^{2} \left (c +d \,x^{n}\right ) d}{x^{2}}+\frac {2 \left (a +b \,x^{n}\right ) d^{2} x^{2 n} n^{2}}{x^{2}}+\frac {2 \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right ) d \,x^{n} n^{2}}{x^{2}}-\frac {2 \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right ) d \,x^{n} n}{x^{2}}\right )}{\left (2 n^{2}+3 n +1\right ) \left (1+3 n \right )}-\frac {x^{4} \left (\frac {b \,x^{n} n^{3} \left (c +d \,x^{n}\right )^{2}}{x^{3}}-\frac {3 b \,x^{n} n^{2} \left (c +d \,x^{n}\right )^{2}}{x^{3}}+\frac {12 b \,x^{2 n} n^{3} \left (c +d \,x^{n}\right ) d}{x^{3}}+\frac {2 b \,x^{n} n \left (c +d \,x^{n}\right )^{2}}{x^{3}}-\frac {12 b \,x^{2 n} n^{2} \left (c +d \,x^{n}\right ) d}{x^{3}}+\frac {6 x^{3 n} d^{2} n^{3} b}{x^{3}}+\frac {6 \left (a +b \,x^{n}\right ) d^{2} x^{2 n} n^{3}}{x^{3}}-\frac {6 \left (a +b \,x^{n}\right ) d^{2} x^{2 n} n^{2}}{x^{3}}+\frac {2 \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right ) d \,x^{n} n^{3}}{x^{3}}-\frac {6 \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right ) d \,x^{n} n^{2}}{x^{3}}+\frac {4 \left (a +b \,x^{n}\right ) \left (c +d \,x^{n}\right ) d \,x^{n} n}{x^{3}}\right )}{6 n^{3}+11 n^{2}+6 n +1}\) | \(524\) |
Input:
int((a+b*x^n)*(c+d*x^n)^2,x,method=_RETURNVERBOSE)
Output:
a*c^2*x+b*d^2/(1+3*n)*x*(x^n)^3+c*(2*a*d+b*c)/(1+n)*x*x^n+d*(a*d+2*b*c)/(1 +2*n)*x*(x^n)^2
Leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (70) = 140\).
Time = 0.16 (sec) , antiderivative size = 175, normalized size of antiderivative = 2.50 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=\frac {{\left (2 \, b d^{2} n^{2} + 3 \, b d^{2} n + b d^{2}\right )} x x^{3 \, n} + {\left (2 \, b c d + a d^{2} + 3 \, {\left (2 \, b c d + a d^{2}\right )} n^{2} + 4 \, {\left (2 \, b c d + a d^{2}\right )} n\right )} x x^{2 \, n} + {\left (b c^{2} + 2 \, a c d + 6 \, {\left (b c^{2} + 2 \, a c d\right )} n^{2} + 5 \, {\left (b c^{2} + 2 \, a c d\right )} n\right )} x x^{n} + {\left (6 \, a c^{2} n^{3} + 11 \, a c^{2} n^{2} + 6 \, a c^{2} n + a c^{2}\right )} x}{6 \, n^{3} + 11 \, n^{2} + 6 \, n + 1} \] Input:
integrate((a+b*x^n)*(c+d*x^n)^2,x, algorithm="fricas")
Output:
((2*b*d^2*n^2 + 3*b*d^2*n + b*d^2)*x*x^(3*n) + (2*b*c*d + a*d^2 + 3*(2*b*c *d + a*d^2)*n^2 + 4*(2*b*c*d + a*d^2)*n)*x*x^(2*n) + (b*c^2 + 2*a*c*d + 6* (b*c^2 + 2*a*c*d)*n^2 + 5*(b*c^2 + 2*a*c*d)*n)*x*x^n + (6*a*c^2*n^3 + 11*a *c^2*n^2 + 6*a*c^2*n + a*c^2)*x)/(6*n^3 + 11*n^2 + 6*n + 1)
Leaf count of result is larger than twice the leaf count of optimal. 726 vs. \(2 (63) = 126\).
Time = 0.43 (sec) , antiderivative size = 726, normalized size of antiderivative = 10.37 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=\begin {cases} a c^{2} x + 2 a c d \log {\left (x \right )} - \frac {a d^{2}}{x} + b c^{2} \log {\left (x \right )} - \frac {2 b c d}{x} - \frac {b d^{2}}{2 x^{2}} & \text {for}\: n = -1 \\a c^{2} x + 4 a c d \sqrt {x} + a d^{2} \log {\left (x \right )} + 2 b c^{2} \sqrt {x} + 2 b c d \log {\left (x \right )} - \frac {2 b d^{2}}{\sqrt {x}} & \text {for}\: n = - \frac {1}{2} \\a c^{2} x + 3 a c d x^{\frac {2}{3}} + 3 a d^{2} \sqrt [3]{x} + \frac {3 b c^{2} x^{\frac {2}{3}}}{2} + 6 b c d \sqrt [3]{x} + b d^{2} \log {\left (x \right )} & \text {for}\: n = - \frac {1}{3} \\\frac {6 a c^{2} n^{3} x}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {11 a c^{2} n^{2} x}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {6 a c^{2} n x}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {a c^{2} x}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {12 a c d n^{2} x x^{n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {10 a c d n x x^{n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {2 a c d x x^{n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {3 a d^{2} n^{2} x x^{2 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {4 a d^{2} n x x^{2 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {a d^{2} x x^{2 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {6 b c^{2} n^{2} x x^{n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {5 b c^{2} n x x^{n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {b c^{2} x x^{n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {6 b c d n^{2} x x^{2 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {8 b c d n x x^{2 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {2 b c d x x^{2 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {2 b d^{2} n^{2} x x^{3 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {3 b d^{2} n x x^{3 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} + \frac {b d^{2} x x^{3 n}}{6 n^{3} + 11 n^{2} + 6 n + 1} & \text {otherwise} \end {cases} \] Input:
integrate((a+b*x**n)*(c+d*x**n)**2,x)
Output:
Piecewise((a*c**2*x + 2*a*c*d*log(x) - a*d**2/x + b*c**2*log(x) - 2*b*c*d/ x - b*d**2/(2*x**2), Eq(n, -1)), (a*c**2*x + 4*a*c*d*sqrt(x) + a*d**2*log( x) + 2*b*c**2*sqrt(x) + 2*b*c*d*log(x) - 2*b*d**2/sqrt(x), Eq(n, -1/2)), ( a*c**2*x + 3*a*c*d*x**(2/3) + 3*a*d**2*x**(1/3) + 3*b*c**2*x**(2/3)/2 + 6* b*c*d*x**(1/3) + b*d**2*log(x), Eq(n, -1/3)), (6*a*c**2*n**3*x/(6*n**3 + 1 1*n**2 + 6*n + 1) + 11*a*c**2*n**2*x/(6*n**3 + 11*n**2 + 6*n + 1) + 6*a*c* *2*n*x/(6*n**3 + 11*n**2 + 6*n + 1) + a*c**2*x/(6*n**3 + 11*n**2 + 6*n + 1 ) + 12*a*c*d*n**2*x*x**n/(6*n**3 + 11*n**2 + 6*n + 1) + 10*a*c*d*n*x*x**n/ (6*n**3 + 11*n**2 + 6*n + 1) + 2*a*c*d*x*x**n/(6*n**3 + 11*n**2 + 6*n + 1) + 3*a*d**2*n**2*x*x**(2*n)/(6*n**3 + 11*n**2 + 6*n + 1) + 4*a*d**2*n*x*x* *(2*n)/(6*n**3 + 11*n**2 + 6*n + 1) + a*d**2*x*x**(2*n)/(6*n**3 + 11*n**2 + 6*n + 1) + 6*b*c**2*n**2*x*x**n/(6*n**3 + 11*n**2 + 6*n + 1) + 5*b*c**2* n*x*x**n/(6*n**3 + 11*n**2 + 6*n + 1) + b*c**2*x*x**n/(6*n**3 + 11*n**2 + 6*n + 1) + 6*b*c*d*n**2*x*x**(2*n)/(6*n**3 + 11*n**2 + 6*n + 1) + 8*b*c*d* n*x*x**(2*n)/(6*n**3 + 11*n**2 + 6*n + 1) + 2*b*c*d*x*x**(2*n)/(6*n**3 + 1 1*n**2 + 6*n + 1) + 2*b*d**2*n**2*x*x**(3*n)/(6*n**3 + 11*n**2 + 6*n + 1) + 3*b*d**2*n*x*x**(3*n)/(6*n**3 + 11*n**2 + 6*n + 1) + b*d**2*x*x**(3*n)/( 6*n**3 + 11*n**2 + 6*n + 1), True))
Time = 0.03 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.34 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=a c^{2} x + \frac {b d^{2} x^{3 \, n + 1}}{3 \, n + 1} + \frac {2 \, b c d x^{2 \, n + 1}}{2 \, n + 1} + \frac {a d^{2} x^{2 \, n + 1}}{2 \, n + 1} + \frac {b c^{2} x^{n + 1}}{n + 1} + \frac {2 \, a c d x^{n + 1}}{n + 1} \] Input:
integrate((a+b*x^n)*(c+d*x^n)^2,x, algorithm="maxima")
Output:
a*c^2*x + b*d^2*x^(3*n + 1)/(3*n + 1) + 2*b*c*d*x^(2*n + 1)/(2*n + 1) + a* d^2*x^(2*n + 1)/(2*n + 1) + b*c^2*x^(n + 1)/(n + 1) + 2*a*c*d*x^(n + 1)/(n + 1)
Leaf count of result is larger than twice the leaf count of optimal. 232 vs. \(2 (70) = 140\).
Time = 0.13 (sec) , antiderivative size = 232, normalized size of antiderivative = 3.31 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=\frac {6 \, a c^{2} n^{3} x + 2 \, b d^{2} n^{2} x x^{3 \, n} + 6 \, b c d n^{2} x x^{2 \, n} + 3 \, a d^{2} n^{2} x x^{2 \, n} + 6 \, b c^{2} n^{2} x x^{n} + 12 \, a c d n^{2} x x^{n} + 11 \, a c^{2} n^{2} x + 3 \, b d^{2} n x x^{3 \, n} + 8 \, b c d n x x^{2 \, n} + 4 \, a d^{2} n x x^{2 \, n} + 5 \, b c^{2} n x x^{n} + 10 \, a c d n x x^{n} + 6 \, a c^{2} n x + b d^{2} x x^{3 \, n} + 2 \, b c d x x^{2 \, n} + a d^{2} x x^{2 \, n} + b c^{2} x x^{n} + 2 \, a c d x x^{n} + a c^{2} x}{6 \, n^{3} + 11 \, n^{2} + 6 \, n + 1} \] Input:
integrate((a+b*x^n)*(c+d*x^n)^2,x, algorithm="giac")
Output:
(6*a*c^2*n^3*x + 2*b*d^2*n^2*x*x^(3*n) + 6*b*c*d*n^2*x*x^(2*n) + 3*a*d^2*n ^2*x*x^(2*n) + 6*b*c^2*n^2*x*x^n + 12*a*c*d*n^2*x*x^n + 11*a*c^2*n^2*x + 3 *b*d^2*n*x*x^(3*n) + 8*b*c*d*n*x*x^(2*n) + 4*a*d^2*n*x*x^(2*n) + 5*b*c^2*n *x*x^n + 10*a*c*d*n*x*x^n + 6*a*c^2*n*x + b*d^2*x*x^(3*n) + 2*b*c*d*x*x^(2 *n) + a*d^2*x*x^(2*n) + b*c^2*x*x^n + 2*a*c*d*x*x^n + a*c^2*x)/(6*n^3 + 11 *n^2 + 6*n + 1)
Time = 0.81 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.01 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=a\,c^2\,x+\frac {x\,x^{2\,n}\,\left (a\,d^2+2\,b\,c\,d\right )}{2\,n+1}+\frac {x\,x^n\,\left (b\,c^2+2\,a\,d\,c\right )}{n+1}+\frac {b\,d^2\,x\,x^{3\,n}}{3\,n+1} \] Input:
int((a + b*x^n)*(c + d*x^n)^2,x)
Output:
a*c^2*x + (x*x^(2*n)*(a*d^2 + 2*b*c*d))/(2*n + 1) + (x*x^n*(b*c^2 + 2*a*c* d))/(n + 1) + (b*d^2*x*x^(3*n))/(3*n + 1)
Time = 0.22 (sec) , antiderivative size = 214, normalized size of antiderivative = 3.06 \[ \int \left (a+b x^n\right ) \left (c+d x^n\right )^2 \, dx=\frac {x \left (2 x^{3 n} b \,d^{2} n^{2}+3 x^{3 n} b \,d^{2} n +x^{3 n} b \,d^{2}+3 x^{2 n} a \,d^{2} n^{2}+4 x^{2 n} a \,d^{2} n +x^{2 n} a \,d^{2}+6 x^{2 n} b c d \,n^{2}+8 x^{2 n} b c d n +2 x^{2 n} b c d +12 x^{n} a c d \,n^{2}+10 x^{n} a c d n +2 x^{n} a c d +6 x^{n} b \,c^{2} n^{2}+5 x^{n} b \,c^{2} n +x^{n} b \,c^{2}+6 a \,c^{2} n^{3}+11 a \,c^{2} n^{2}+6 a \,c^{2} n +a \,c^{2}\right )}{6 n^{3}+11 n^{2}+6 n +1} \] Input:
int((a+b*x^n)*(c+d*x^n)^2,x)
Output:
(x*(2*x**(3*n)*b*d**2*n**2 + 3*x**(3*n)*b*d**2*n + x**(3*n)*b*d**2 + 3*x** (2*n)*a*d**2*n**2 + 4*x**(2*n)*a*d**2*n + x**(2*n)*a*d**2 + 6*x**(2*n)*b*c *d*n**2 + 8*x**(2*n)*b*c*d*n + 2*x**(2*n)*b*c*d + 12*x**n*a*c*d*n**2 + 10* x**n*a*c*d*n + 2*x**n*a*c*d + 6*x**n*b*c**2*n**2 + 5*x**n*b*c**2*n + x**n* b*c**2 + 6*a*c**2*n**3 + 11*a*c**2*n**2 + 6*a*c**2*n + a*c**2))/(6*n**3 + 11*n**2 + 6*n + 1)