3.3.9 \(\int (a+b x) (1+(c+a x+\frac {b x^2}{2})^n) \, dx\) [209]

Optimal. Leaf size=35 \[ a x+\frac {b x^2}{2}+\frac {\left (c+a x+\frac {b x^2}{2}\right )^{1+n}}{1+n} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {1605} \begin {gather*} \frac {\left (a x+\frac {b x^2}{2}+c\right )^{n+1}}{n+1}+a x+\frac {b x^2}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

a*x + (b*x^2)/2 + (c + a*x + (b*x^2)/2)^(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*} \int (a+b x) \left (1+\left (c+a x+\frac {b x^2}{2}\right )^n\right ) \, dx &=\text {Subst}\left (\int \left (1+x^n\right ) \, dx,x,c+a x+\frac {b x^2}{2}\right )\\ &=a x+\frac {b x^2}{2}+\frac {\left (c+a x+\frac {b x^2}{2}\right )^{1+n}}{1+n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(73\) vs. \(2(35)=70\).
time = 0.16, size = 73, normalized size = 2.09 \begin {gather*} \frac {2 c \left (c+a x+\frac {b x^2}{2}\right )^n+2 a x \left (1+n+\left (c+a x+\frac {b x^2}{2}\right )^n\right )+b x^2 \left (1+n+\left (c+a x+\frac {b x^2}{2}\right )^n\right )}{2 (1+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.25, size = 33, normalized size = 0.94

method result size
derivativedivides \(c +a x +\frac {b \,x^{2}}{2}+\frac {\left (c +a x +\frac {1}{2} b \,x^{2}\right )^{1+n}}{1+n}\) \(33\)
default \(c +a x +\frac {b \,x^{2}}{2}+\frac {\left (c +a x +\frac {1}{2} b \,x^{2}\right )^{1+n}}{1+n}\) \(33\)
risch \(a x +\frac {b \,x^{2}}{2}+\frac {\left (b \,x^{2}+2 a x +2 c \right ) \left (b \,x^{2}+2 a x +2 c \right )^{n} \left (\frac {1}{2}\right )^{n}}{2+2 n}\) \(49\)
norman \(a x +\frac {c \,{\mathrm e}^{n \ln \left (c +a x +\frac {1}{2} b \,x^{2}\right )}}{1+n}+\frac {a x \,{\mathrm e}^{n \ln \left (c +a x +\frac {1}{2} b \,x^{2}\right )}}{1+n}+\frac {b \,x^{2}}{2}+\frac {b \,x^{2} {\mathrm e}^{n \ln \left (c +a x +\frac {1}{2} b \,x^{2}\right )}}{2+2 n}\) \(82\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 54, normalized size = 1.54 \begin {gather*} \frac {1}{2} \, b x^{2} + a x + \frac {{\left (b x^{2} + 2 \, a x + 2 \, c\right )} {\left (b x^{2} + 2 \, a x + 2 \, c\right )}^{n}}{2^{n + 1} n + 2^{n + 1}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 52, normalized size = 1.49 \begin {gather*} \frac {{\left (b n + b\right )} x^{2} + {\left (b x^{2} + 2 \, a x + 2 \, c\right )} {\left (\frac {1}{2} \, b x^{2} + a x + c\right )}^{n} + 2 \, {\left (a n + a\right )} x}{2 \, {\left (n + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 328 vs. \(2 (27) = 54\).
time = 118.66, size = 328, normalized size = 9.37 \begin {gather*} \begin {cases} a \left (x + \frac {\log {\left (x + \frac {c}{a} \right )}}{a}\right ) & \text {for}\: b = 0 \wedge n = -1 \\a \left (\frac {a n x}{a n + a} + \frac {a x \left (a x + c\right )^{n}}{a n + a} + \frac {a x}{a n + a} + \frac {c \left (a x + c\right )^{n}}{a n + a}\right ) & \text {for}\: b = 0 \\a x + \frac {b x^{2}}{2} + \log {\left (\frac {a}{b} + x - \frac {\sqrt {a^{2} - 2 b c}}{b} \right )} + \log {\left (\frac {a}{b} + x + \frac {\sqrt {a^{2} - 2 b c}}{b} \right )} & \text {for}\: n = -1 \\\frac {2 \cdot 2^{n} a b n x}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} + \frac {2 \cdot 2^{n} a b x}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} + \frac {2^{n} b^{2} n x^{2}}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} + \frac {2^{n} b^{2} x^{2}}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} + \frac {2 a b x \left (2 a x + b x^{2} + 2 c\right )^{n}}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} + \frac {b^{2} x^{2} \left (2 a x + b x^{2} + 2 c\right )^{n}}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} + \frac {2 b c \left (2 a x + b x^{2} + 2 c\right )^{n}}{2 \cdot 2^{n} b n + 2 \cdot 2^{n} b} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((a*(x + log(x + c/a)/a), Eq(b, 0) & Eq(n, -1)), (a*(a*n*x/(a*n + a) + a*x*(a*x + c)**n/(a*n + a) + a
*x/(a*n + a) + c*(a*x + c)**n/(a*n + a)), Eq(b, 0)), (a*x + b*x**2/2 + log(a/b + x - sqrt(a**2 - 2*b*c)/b) + l
og(a/b + x + sqrt(a**2 - 2*b*c)/b), Eq(n, -1)), (2*2**n*a*b*n*x/(2*2**n*b*n + 2*2**n*b) + 2*2**n*a*b*x/(2*2**n
*b*n + 2*2**n*b) + 2**n*b**2*n*x**2/(2*2**n*b*n + 2*2**n*b) + 2**n*b**2*x**2/(2*2**n*b*n + 2*2**n*b) + 2*a*b*x
*(2*a*x + b*x**2 + 2*c)**n/(2*2**n*b*n + 2*2**n*b) + b**2*x**2*(2*a*x + b*x**2 + 2*c)**n/(2*2**n*b*n + 2*2**n*
b) + 2*b*c*(2*a*x + b*x**2 + 2*c)**n/(2*2**n*b*n + 2*2**n*b), True))

________________________________________________________________________________________

Giac [A]
time = 4.59, size = 32, normalized size = 0.91 \begin {gather*} \frac {1}{2} \, b x^{2} + a x + c + \frac {{\left (\frac {1}{2} \, b x^{2} + a x + c\right )}^{n + 1}}{n + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 2.11, size = 58, normalized size = 1.66 \begin {gather*} a\,x+{\left (\frac {b\,x^2}{2}+a\,x+c\right )}^n\,\left (\frac {2\,c}{2\,n+2}+\frac {b\,x^2}{2\,n+2}+\frac {2\,a\,x}{2\,n+2}\right )+\frac {b\,x^2}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*x + (c + a*x + (b*x^2)/2)^n*((2*c)/(2*n + 2) + (b*x^2)/(2*n + 2) + (2*a*x)/(2*n + 2)) + (b*x^2)/2

________________________________________________________________________________________