### 3.947 $$\int (a+b x)^m (a^2-b^2 x^2) \, dx$$

Optimal. Leaf size=40 $\frac{2 a (a+b x)^{m+2}}{b (m+2)}-\frac{(a+b x)^{m+3}}{b (m+3)}$

[Out]

(2*a*(a + b*x)^(2 + m))/(b*(2 + m)) - (a + b*x)^(3 + m)/(b*(3 + m))

________________________________________________________________________________________

Rubi [A]  time = 0.0165849, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 20, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.1, Rules used = {627, 43} $\frac{2 a (a+b x)^{m+2}}{b (m+2)}-\frac{(a+b x)^{m+3}}{b (m+3)}$

Antiderivative was successfully veriﬁed.

[In]

Int[(a + b*x)^m*(a^2 - b^2*x^2),x]

[Out]

(2*a*(a + b*x)^(2 + m))/(b*(2 + m)) - (a + b*x)^(3 + m)/(b*(3 + m))

Rule 627

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c*x)/e)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int (a+b x)^m \left (a^2-b^2 x^2\right ) \, dx &=\int (a-b x) (a+b x)^{1+m} \, dx\\ &=\int \left (2 a (a+b x)^{1+m}-(a+b x)^{2+m}\right ) \, dx\\ &=\frac{2 a (a+b x)^{2+m}}{b (2+m)}-\frac{(a+b x)^{3+m}}{b (3+m)}\\ \end{align*}

Mathematica [A]  time = 0.0284567, size = 36, normalized size = 0.9 $\frac{(a+b x)^{m+2} (a (m+4)-b (m+2) x)}{b (m+2) (m+3)}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(a + b*x)^m*(a^2 - b^2*x^2),x]

[Out]

((a + b*x)^(2 + m)*(a*(4 + m) - b*(2 + m)*x))/(b*(2 + m)*(3 + m))

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 40, normalized size = 1. \begin{align*}{\frac{ \left ( bx+a \right ) ^{2+m} \left ( -bmx+am-2\,bx+4\,a \right ) }{b \left ({m}^{2}+5\,m+6 \right ) }} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^m*(-b^2*x^2+a^2),x)

[Out]

(b*x+a)^(2+m)*(-b*m*x+a*m-2*b*x+4*a)/b/(m^2+5*m+6)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^m*(-b^2*x^2+a^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.81246, size = 151, normalized size = 3.78 \begin{align*} -\frac{{\left (a b^{2} m x^{2} - a^{3} m +{\left (b^{3} m + 2 \, b^{3}\right )} x^{3} - 4 \, a^{3} -{\left (a^{2} b m + 6 \, a^{2} b\right )} x\right )}{\left (b x + a\right )}^{m}}{b m^{2} + 5 \, b m + 6 \, b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^m*(-b^2*x^2+a^2),x, algorithm="fricas")

[Out]

-(a*b^2*m*x^2 - a^3*m + (b^3*m + 2*b^3)*x^3 - 4*a^3 - (a^2*b*m + 6*a^2*b)*x)*(b*x + a)^m/(b*m^2 + 5*b*m + 6*b)

________________________________________________________________________________________

Sympy [A]  time = 1.05682, size = 267, normalized size = 6.68 \begin{align*} \begin{cases} a^{2} a^{m} x & \text{for}\: b = 0 \\- \frac{a \log{\left (\frac{a}{b} + x \right )}}{a b + b^{2} x} - \frac{2 a}{a b + b^{2} x} - \frac{b x \log{\left (\frac{a}{b} + x \right )}}{a b + b^{2} x} & \text{for}\: m = -3 \\\frac{2 a \log{\left (\frac{a}{b} + x \right )}}{b} - x & \text{for}\: m = -2 \\\frac{a^{3} m \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} + \frac{4 a^{3} \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} + \frac{a^{2} b m x \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} + \frac{6 a^{2} b x \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} - \frac{a b^{2} m x^{2} \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} - \frac{b^{3} m x^{3} \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} - \frac{2 b^{3} x^{3} \left (a + b x\right )^{m}}{b m^{2} + 5 b m + 6 b} & \text{otherwise} \end{cases} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**m*(-b**2*x**2+a**2),x)

[Out]

Piecewise((a**2*a**m*x, Eq(b, 0)), (-a*log(a/b + x)/(a*b + b**2*x) - 2*a/(a*b + b**2*x) - b*x*log(a/b + x)/(a*
b + b**2*x), Eq(m, -3)), (2*a*log(a/b + x)/b - x, Eq(m, -2)), (a**3*m*(a + b*x)**m/(b*m**2 + 5*b*m + 6*b) + 4*
a**3*(a + b*x)**m/(b*m**2 + 5*b*m + 6*b) + a**2*b*m*x*(a + b*x)**m/(b*m**2 + 5*b*m + 6*b) + 6*a**2*b*x*(a + b*
x)**m/(b*m**2 + 5*b*m + 6*b) - a*b**2*m*x**2*(a + b*x)**m/(b*m**2 + 5*b*m + 6*b) - b**3*m*x**3*(a + b*x)**m/(b
*m**2 + 5*b*m + 6*b) - 2*b**3*x**3*(a + b*x)**m/(b*m**2 + 5*b*m + 6*b), True))

________________________________________________________________________________________

Giac [B]  time = 1.2403, size = 159, normalized size = 3.98 \begin{align*} -\frac{{\left (b x + a\right )}^{m} b^{3} m x^{3} +{\left (b x + a\right )}^{m} a b^{2} m x^{2} + 2 \,{\left (b x + a\right )}^{m} b^{3} x^{3} -{\left (b x + a\right )}^{m} a^{2} b m x -{\left (b x + a\right )}^{m} a^{3} m - 6 \,{\left (b x + a\right )}^{m} a^{2} b x - 4 \,{\left (b x + a\right )}^{m} a^{3}}{b m^{2} + 5 \, b m + 6 \, b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^m*(-b^2*x^2+a^2),x, algorithm="giac")

[Out]

-((b*x + a)^m*b^3*m*x^3 + (b*x + a)^m*a*b^2*m*x^2 + 2*(b*x + a)^m*b^3*x^3 - (b*x + a)^m*a^2*b*m*x - (b*x + a)^
m*a^3*m - 6*(b*x + a)^m*a^2*b*x - 4*(b*x + a)^m*a^3)/(b*m^2 + 5*b*m + 6*b)