Optimal. Leaf size=60 \[ \frac {a^2 (a+b x)^{1+p}}{b^3 (1+p)}-\frac {2 a (a+b x)^{2+p}}{b^3 (2+p)}+\frac {(a+b x)^{3+p}}{b^3 (3+p)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {45}
\begin {gather*} \frac {a^2 (a+b x)^{p+1}}{b^3 (p+1)}-\frac {2 a (a+b x)^{p+2}}{b^3 (p+2)}+\frac {(a+b x)^{p+3}}{b^3 (p+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rubi steps
\begin {align*} \int x^2 (a+b x)^p \, dx &=\int \left (\frac {a^2 (a+b x)^p}{b^2}-\frac {2 a (a+b x)^{1+p}}{b^2}+\frac {(a+b x)^{2+p}}{b^2}\right ) \, dx\\ &=\frac {a^2 (a+b x)^{1+p}}{b^3 (1+p)}-\frac {2 a (a+b x)^{2+p}}{b^3 (2+p)}+\frac {(a+b x)^{3+p}}{b^3 (3+p)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 57, normalized size = 0.95 \begin {gather*} \frac {(a+b x)^{1+p} \left (2 a^2-2 a b (1+p) x+b^2 \left (2+3 p+p^2\right ) x^2\right )}{b^3 (1+p) (2+p) (3+p)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.03, size = 73, normalized size = 1.22
method | result | size |
gosper | \(\frac {\left (b x +a \right )^{1+p} \left (b^{2} p^{2} x^{2}+3 x^{2} b^{2} p -2 x a p b +2 x^{2} b^{2}-2 a x b +2 a^{2}\right )}{b^{3} \left (p^{3}+6 p^{2}+11 p +6\right )}\) | \(73\) |
risch | \(\frac {\left (b^{3} p^{2} x^{3}+a \,b^{2} p^{2} x^{2}+3 b^{3} p \,x^{3}+x^{2} a p \,b^{2}+2 x^{3} b^{3}-2 a^{2} p x b +2 a^{3}\right ) \left (b x +a \right )^{p}}{\left (2+p \right ) \left (3+p \right ) \left (1+p \right ) b^{3}}\) | \(88\) |
norman | \(\frac {x^{3} {\mathrm e}^{p \ln \left (b x +a \right )}}{3+p}+\frac {a p \,x^{2} {\mathrm e}^{p \ln \left (b x +a \right )}}{b \left (p^{2}+5 p +6\right )}+\frac {2 a^{3} {\mathrm e}^{p \ln \left (b x +a \right )}}{b^{3} \left (p^{3}+6 p^{2}+11 p +6\right )}-\frac {2 p \,a^{2} x \,{\mathrm e}^{p \ln \left (b x +a \right )}}{b^{2} \left (p^{3}+6 p^{2}+11 p +6\right )}\) | \(114\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.16, size = 68, normalized size = 1.13 \begin {gather*} \frac {{\left ({\left (p^{2} + 3 \, p + 2\right )} b^{3} x^{3} + {\left (p^{2} + p\right )} a b^{2} x^{2} - 2 \, a^{2} b p x + 2 \, a^{3}\right )} {\left (b x + a\right )}^{p}}{{\left (p^{3} + 6 \, p^{2} + 11 \, p + 6\right )} b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.58, size = 96, normalized size = 1.60 \begin {gather*} -\frac {{\left (2 \, a^{2} b p x - {\left (b^{3} p^{2} + 3 \, b^{3} p + 2 \, b^{3}\right )} x^{3} - 2 \, a^{3} - {\left (a b^{2} p^{2} + a b^{2} p\right )} x^{2}\right )} {\left (b x + a\right )}^{p}}{b^{3} p^{3} + 6 \, b^{3} p^{2} + 11 \, b^{3} p + 6 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 597 vs.
\(2 (51) = 102\).
time = 0.37, size = 597, normalized size = 9.95 \begin {gather*} \begin {cases} \frac {a^{p} x^{3}}{3} & \text {for}\: b = 0 \\\frac {2 a^{2} \log {\left (\frac {a}{b} + x \right )}}{2 a^{2} b^{3} + 4 a b^{4} x + 2 b^{5} x^{2}} + \frac {3 a^{2}}{2 a^{2} b^{3} + 4 a b^{4} x + 2 b^{5} x^{2}} + \frac {4 a b x \log {\left (\frac {a}{b} + x \right )}}{2 a^{2} b^{3} + 4 a b^{4} x + 2 b^{5} x^{2}} + \frac {4 a b x}{2 a^{2} b^{3} + 4 a b^{4} x + 2 b^{5} x^{2}} + \frac {2 b^{2} x^{2} \log {\left (\frac {a}{b} + x \right )}}{2 a^{2} b^{3} + 4 a b^{4} x + 2 b^{5} x^{2}} & \text {for}\: p = -3 \\- \frac {2 a^{2} \log {\left (\frac {a}{b} + x \right )}}{a b^{3} + b^{4} x} - \frac {2 a^{2}}{a b^{3} + b^{4} x} - \frac {2 a b x \log {\left (\frac {a}{b} + x \right )}}{a b^{3} + b^{4} x} + \frac {b^{2} x^{2}}{a b^{3} + b^{4} x} & \text {for}\: p = -2 \\\frac {a^{2} \log {\left (\frac {a}{b} + x \right )}}{b^{3}} - \frac {a x}{b^{2}} + \frac {x^{2}}{2 b} & \text {for}\: p = -1 \\\frac {2 a^{3} \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} - \frac {2 a^{2} b p x \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} + \frac {a b^{2} p^{2} x^{2} \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} + \frac {a b^{2} p x^{2} \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} + \frac {b^{3} p^{2} x^{3} \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} + \frac {3 b^{3} p x^{3} \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} + \frac {2 b^{3} x^{3} \left (a + b x\right )^{p}}{b^{3} p^{3} + 6 b^{3} p^{2} + 11 b^{3} p + 6 b^{3}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 140 vs.
\(2 (60) = 120\).
time = 0.50, size = 140, normalized size = 2.33 \begin {gather*} \frac {{\left (b x + a\right )}^{p} b^{3} p^{2} x^{3} + {\left (b x + a\right )}^{p} a b^{2} p^{2} x^{2} + 3 \, {\left (b x + a\right )}^{p} b^{3} p x^{3} + {\left (b x + a\right )}^{p} a b^{2} p x^{2} + 2 \, {\left (b x + a\right )}^{p} b^{3} x^{3} - 2 \, {\left (b x + a\right )}^{p} a^{2} b p x + 2 \, {\left (b x + a\right )}^{p} a^{3}}{b^{3} p^{3} + 6 \, b^{3} p^{2} + 11 \, b^{3} p + 6 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.60, size = 192, normalized size = 3.20 \begin {gather*} \left \{\begin {array}{cl} \frac {2\,a^2\,\ln \left (a+b\,x\right )+b^2\,x^2-2\,a\,b\,x}{2\,b^3} & \text {\ if\ \ }p=-1\\ \frac {x}{b^2}-\frac {a^2}{b^3\,\left (a+b\,x\right )}-\frac {2\,a\,\ln \left (a+b\,x\right )}{b^3} & \text {\ if\ \ }p=-2\\ \frac {\ln \left (a+b\,x\right )+\frac {2\,a}{a+b\,x}-\frac {a^2}{2\,{\left (a+b\,x\right )}^2}}{b^3} & \text {\ if\ \ }p=-3\\ \frac {2\,{\left (a+b\,x\right )}^{p+1}\,\left (8\,a^2-8\,a\,b\,p\,x-8\,a\,b\,x+4\,b^2\,p^2\,x^2+12\,b^2\,p\,x^2+8\,b^2\,x^2\right )}{b^3\,\left (8\,p^3+48\,p^2+88\,p+48\right )} & \text {\ if\ \ }p\neq -1\wedge p\neq -2\wedge p\neq -3 \end {array}\right . \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________