\(\int (a+c x^2) (1+(a x+\frac {c x^3}{3})^n) \, dx\) [216]

   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 [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

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

[Out]

a*x+1/3*c*x^3+(a*x+1/3*c*x^3)^(1+n)/(1+n)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {1605} \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\frac {\left (a x+\frac {c x^3}{3}\right )^{n+1}}{n+1}+a x+\frac {c x^3}{3} \]

[In]

Int[(a + c*x^2)*(1 + (a*x + (c*x^3)/3)^n),x]

[Out]

a*x + (c*x^3)/3 + (a*x + (c*x^3)/3)^(1 + n)/(1 + n)

Rule 1605

Int[((a_.) + (b_.)*(Pq_)^(n_.))^(p_.)*(Qr_), x_Symbol] :> With[{q = Expon[Pq, x], r = Expon[Qr, x]}, Dist[Coef
f[Qr, x, r]/(q*Coeff[Pq, x, q]), Subst[Int[(a + b*x^n)^p, x], x, Pq], x] /; EqQ[r, q - 1] && EqQ[Coeff[Qr, x,
r]*D[Pq, x], q*Coeff[Pq, x, q]*Qr]] /; FreeQ[{a, b, n, p}, x] && PolyQ[Pq, x] && PolyQ[Qr, x]

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

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.06 \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\frac {x \left (3 a+c x^2\right ) \left (1+n+\left (a x+\frac {c x^3}{3}\right )^n\right )}{3 (1+n)} \]

[In]

Integrate[(a + c*x^2)*(1 + (a*x + (c*x^3)/3)^n),x]

[Out]

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

Maple [A] (verified)

Time = 0.80 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.91

method result size
derivativedivides \(a x +\frac {c \,x^{3}}{3}+\frac {\left (a x +\frac {1}{3} c \,x^{3}\right )^{1+n}}{1+n}\) \(31\)
default \(a x +\frac {c \,x^{3}}{3}+\frac {\left (a x +\frac {1}{3} c \,x^{3}\right )^{1+n}}{1+n}\) \(31\)
risch \(a x +\frac {c \,x^{3}}{3}+\frac {x \left (c \,x^{2}+3 a \right ) \left (\frac {1}{3}\right )^{n} {\left (x \left (c \,x^{2}+3 a \right )\right )}^{n}}{3+3 n}\) \(44\)
norman \(a x +\frac {a x \,{\mathrm e}^{n \ln \left (a x +\frac {1}{3} c \,x^{3}\right )}}{1+n}+\frac {c \,x^{3}}{3}+\frac {c \,x^{3} {\mathrm e}^{n \ln \left (a x +\frac {1}{3} c \,x^{3}\right )}}{3+3 n}\) \(58\)
parallelrisch \(\frac {x^{3} {\left (\frac {x \left (c \,x^{2}+3 a \right )}{3}\right )}^{n} c^{2}+x^{3} c^{2} n +c^{2} x^{3}+3 x {\left (\frac {x \left (c \,x^{2}+3 a \right )}{3}\right )}^{n} a c +3 x a c n +3 a c x}{3 c \left (1+n \right )}\) \(78\)

[In]

int((c*x^2+a)*(1+(a*x+1/3*c*x^3)^n),x,method=_RETURNVERBOSE)

[Out]

a*x+1/3*c*x^3+(a*x+1/3*c*x^3)^(1+n)/(1+n)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.41 \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\frac {{\left (c n + c\right )} x^{3} + {\left (c x^{3} + 3 \, a x\right )} {\left (\frac {1}{3} \, c x^{3} + a x\right )}^{n} + 3 \, {\left (a n + a\right )} x}{3 \, {\left (n + 1\right )}} \]

[In]

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

[Out]

1/3*((c*n + c)*x^3 + (c*x^3 + 3*a*x)*(1/3*c*x^3 + a*x)^n + 3*(a*n + a)*x)/(n + 1)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (26) = 52\).

Time = 40.14 (sec) , antiderivative size = 190, normalized size of antiderivative = 5.59 \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\begin {cases} \frac {3 \cdot 3^{n} a n x}{3 \cdot 3^{n} n + 3 \cdot 3^{n}} + \frac {3 \cdot 3^{n} a x}{3 \cdot 3^{n} n + 3 \cdot 3^{n}} + \frac {3^{n} c n x^{3}}{3 \cdot 3^{n} n + 3 \cdot 3^{n}} + \frac {3^{n} c x^{3}}{3 \cdot 3^{n} n + 3 \cdot 3^{n}} + \frac {3 a x \left (3 a x + c x^{3}\right )^{n}}{3 \cdot 3^{n} n + 3 \cdot 3^{n}} + \frac {c x^{3} \left (3 a x + c x^{3}\right )^{n}}{3 \cdot 3^{n} n + 3 \cdot 3^{n}} & \text {for}\: n \neq -1 \\a x + \frac {c x^{3}}{3} + \log {\left (x \right )} + \log {\left (x - \sqrt {3} \sqrt {- \frac {a}{c}} \right )} + \log {\left (x + \sqrt {3} \sqrt {- \frac {a}{c}} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((c*x**2+a)*(1+(a*x+1/3*c*x**3)**n),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.59 \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\frac {1}{3} \, c x^{3} + a x + \frac {{\left (c x^{3} + 3 \, a x\right )} e^{\left (n \log \left (c x^{2} + 3 \, a\right ) + n \log \left (x\right )\right )}}{3^{n + 1} n + 3^{n + 1}} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.88 \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\frac {1}{3} \, c x^{3} + a x + \frac {{\left (\frac {1}{3} \, c x^{3} + a x\right )}^{n + 1}}{n + 1} \]

[In]

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

[Out]

1/3*c*x^3 + a*x + (1/3*c*x^3 + a*x)^(n + 1)/(n + 1)

Mupad [B] (verification not implemented)

Time = 9.16 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.97 \[ \int \left (a+c x^2\right ) \left (1+\left (a x+\frac {c x^3}{3}\right )^n\right ) \, dx=\frac {x\,\left (c\,x^2+3\,a\right )\,\left (n+{\left (\frac {c\,x^3}{3}+a\,x\right )}^n+1\right )}{3\,\left (n+1\right )} \]

[In]

int((a + c*x^2)*((a*x + (c*x^3)/3)^n + 1),x)

[Out]

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