\(\int x^n (c x+d x^2)^n (2 c x+3 d x^2) \, dx\) [188]

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

Optimal result

Integrand size = 26, antiderivative size = 24 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {x^{1+n} \left (c x+d x^2\right )^{1+n}}{1+n} \]

[Out]

x^(1+n)*(d*x^2+c*x)^(1+n)/(1+n)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, 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.077, Rules used = {1598, 777} \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {x^{n+1} \left (c x+d x^2\right )^{n+1}}{n+1} \]

[In]

Int[x^n*(c*x + d*x^2)^n*(2*c*x + 3*d*x^2),x]

[Out]

(x^(1 + n)*(c*x + d*x^2)^(1 + n))/(1 + n)

Rule 777

Int[((e_.)*(x_))^(m_.)*((f_) + (g_.)*(x_))*((b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(e*x)^m*((b*
x + c*x^2)^(p + 1)/(c*(m + 2*p + 2))), x] /; FreeQ[{b, c, e, f, g, m, p}, x] && EqQ[b*g*(m + p + 1) - c*f*(m +
 2*p + 2), 0] && NeQ[m + 2*p + 2, 0]

Rule 1598

Int[(u_.)*(x_)^(m_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(m + n*p)*(a + b*x^(q -
 p))^n, x] /; FreeQ[{a, b, m, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rubi steps \begin{align*} \text {integral}& = \int x^{1+n} (2 c+3 d x) \left (c x+d x^2\right )^n \, dx \\ & = \frac {x^{1+n} \left (c x+d x^2\right )^{1+n}}{1+n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {x^{1+n} (x (c+d x))^{1+n}}{1+n} \]

[In]

Integrate[x^n*(c*x + d*x^2)^n*(2*c*x + 3*d*x^2),x]

[Out]

(x^(1 + n)*(x*(c + d*x))^(1 + n))/(1 + n)

Maple [A] (verified)

Time = 1.18 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.17

method result size
gosper \(\frac {x^{2+n} \left (d x +c \right ) \left (d \,x^{2}+c x \right )^{n}}{1+n}\) \(28\)
parallelrisch \(\frac {x^{3} x^{n} \left (\left (d x +c \right ) x \right )^{n} c d +x^{2} x^{n} \left (\left (d x +c \right ) x \right )^{n} c^{2}}{c \left (1+n \right )}\) \(48\)
risch \(\frac {\left (d x +c \right ) x^{2} x^{2 n} \left (d x +c \right )^{n} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (i x \left (d x +c \right )\right ) \pi n \left (-\operatorname {csgn}\left (i x \left (d x +c \right )\right )+\operatorname {csgn}\left (i \left (d x +c \right )\right )\right ) \left (-\operatorname {csgn}\left (i x \left (d x +c \right )\right )+\operatorname {csgn}\left (i x \right )\right )}{2}}}{1+n}\) \(83\)

[In]

int(x^n*(d*x^2+c*x)^n*(3*d*x^2+2*c*x),x,method=_RETURNVERBOSE)

[Out]

x^(2+n)/(1+n)*(d*x+c)*(d*x^2+c*x)^n

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.29 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {{\left (d x^{3} + c x^{2}\right )} {\left (d x^{2} + c x\right )}^{n} x^{n}}{n + 1} \]

[In]

integrate(x^n*(d*x^2+c*x)^n*(3*d*x^2+2*c*x),x, algorithm="fricas")

[Out]

(d*x^3 + c*x^2)*(d*x^2 + c*x)^n*x^n/(n + 1)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (19) = 38\).

Time = 1.55 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.33 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\begin {cases} \frac {c x^{2} x^{n} \left (c x + d x^{2}\right )^{n}}{n + 1} + \frac {d x^{3} x^{n} \left (c x + d x^{2}\right )^{n}}{n + 1} & \text {for}\: n \neq -1 \\2 \log {\left (x \right )} + \log {\left (\frac {c}{d} + x \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(x**n*(d*x**2+c*x)**n*(3*d*x**2+2*c*x),x)

[Out]

Piecewise((c*x**2*x**n*(c*x + d*x**2)**n/(n + 1) + d*x**3*x**n*(c*x + d*x**2)**n/(n + 1), Ne(n, -1)), (2*log(x
) + log(c/d + x), True))

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.33 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {{\left (d x^{3} + c x^{2}\right )} e^{\left (n \log \left (d x + c\right ) + 2 \, n \log \left (x\right )\right )}}{n + 1} \]

[In]

integrate(x^n*(d*x^2+c*x)^n*(3*d*x^2+2*c*x),x, algorithm="maxima")

[Out]

(d*x^3 + c*x^2)*e^(n*log(d*x + c) + 2*n*log(x))/(n + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 51 vs. \(2 (24) = 48\).

Time = 0.40 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.12 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {d x^{3} x^{n} e^{\left (n \log \left (d x + c\right ) + n \log \left (x\right )\right )} + c x^{2} x^{n} e^{\left (n \log \left (d x + c\right ) + n \log \left (x\right )\right )}}{n + 1} \]

[In]

integrate(x^n*(d*x^2+c*x)^n*(3*d*x^2+2*c*x),x, algorithm="giac")

[Out]

(d*x^3*x^n*e^(n*log(d*x + c) + n*log(x)) + c*x^2*x^n*e^(n*log(d*x + c) + n*log(x)))/(n + 1)

Mupad [B] (verification not implemented)

Time = 9.52 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.17 \[ \int x^n \left (c x+d x^2\right )^n \left (2 c x+3 d x^2\right ) \, dx=\frac {x^n\,x^2\,{\left (d\,x^2+c\,x\right )}^n\,\left (c+d\,x\right )}{n+1} \]

[In]

int(x^n*(c*x + d*x^2)^n*(2*c*x + 3*d*x^2),x)

[Out]

(x^n*x^2*(c*x + d*x^2)^n*(c + d*x))/(n + 1)