Optimal. Leaf size=138 \[ \frac {d (6 a c-b d (2-m)) \left (a+\frac {b}{x}\right )^{1+m} x^2}{6 a^2}+\frac {d^2 \left (a+\frac {b}{x}\right )^{1+m} x^3}{3 a}-\frac {b \left (6 a^2 c^2-6 a b c d (1-m)+b^2 d^2 \left (2-3 m+m^2\right )\right ) \left (a+\frac {b}{x}\right )^{1+m} \, _2F_1\left (2,1+m;2+m;1+\frac {b}{a x}\right )}{6 a^4 (1+m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {445, 457, 91,
79, 67} \begin {gather*} \frac {d x^2 \left (a+\frac {b}{x}\right )^{m+1} (6 a c-b d (2-m))}{6 a^2}-\frac {b \left (a+\frac {b}{x}\right )^{m+1} \left (6 a^2 c^2-6 a b c d (1-m)+b^2 d^2 \left (m^2-3 m+2\right )\right ) \, _2F_1\left (2,m+1;m+2;\frac {b}{a x}+1\right )}{6 a^4 (m+1)}+\frac {d^2 x^3 \left (a+\frac {b}{x}\right )^{m+1}}{3 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 67
Rule 79
Rule 91
Rule 445
Rule 457
Rubi steps
\begin {align*} \int \left (a+\frac {b}{x}\right )^m (c+d x)^2 \, dx &=\int \left (a+\frac {b}{x}\right )^m \left (d+\frac {c}{x}\right )^2 x^2 \, dx\\ &=-\text {Subst}\left (\int \frac {(a+b x)^m (d+c x)^2}{x^4} \, dx,x,\frac {1}{x}\right )\\ &=\frac {d^2 \left (a+\frac {b}{x}\right )^{1+m} x^3}{3 a}-\frac {\text {Subst}\left (\int \frac {(a+b x)^m \left (d (6 a c-b d (2-m))+3 a c^2 x\right )}{x^3} \, dx,x,\frac {1}{x}\right )}{3 a}\\ &=\frac {d (6 a c-b d (2-m)) \left (a+\frac {b}{x}\right )^{1+m} x^2}{6 a^2}+\frac {d^2 \left (a+\frac {b}{x}\right )^{1+m} x^3}{3 a}-\frac {1}{6} \left (6 c^2-\frac {b d (6 a c-b d (2-m)) (1-m)}{a^2}\right ) \text {Subst}\left (\int \frac {(a+b x)^m}{x^2} \, dx,x,\frac {1}{x}\right )\\ &=\frac {d (6 a c-b d (2-m)) \left (a+\frac {b}{x}\right )^{1+m} x^2}{6 a^2}+\frac {d^2 \left (a+\frac {b}{x}\right )^{1+m} x^3}{3 a}-\frac {b \left (6 a^2 c^2-6 a b c d (1-m)+b^2 d^2 \left (2-3 m+m^2\right )\right ) \left (a+\frac {b}{x}\right )^{1+m} \, _2F_1\left (2,1+m;2+m;1+\frac {b}{a x}\right )}{6 a^4 (1+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.16, size = 112, normalized size = 0.81 \begin {gather*} \frac {\left (a+\frac {b}{x}\right )^m (b+a x) \left (a^2 d (1+m) x^2 (b d (-2+m)+2 a (3 c+d x))-b \left (6 a^2 c^2+6 a b c d (-1+m)+b^2 d^2 \left (2-3 m+m^2\right )\right ) \, _2F_1\left (2,1+m;2+m;1+\frac {b}{a x}\right )\right )}{6 a^4 (1+m) x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \left (a +\frac {b}{x}\right )^{m} \left (d x +c \right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 12.60, size = 121, normalized size = 0.88 \begin {gather*} \frac {b^{m} c^{2} x x^{- m} \Gamma \left (1 - m\right ) {{}_{2}F_{1}\left (\begin {matrix} - m, 1 - m \\ 2 - m \end {matrix}\middle | {\frac {a x e^{i \pi }}{b}} \right )}}{\Gamma \left (2 - m\right )} + \frac {2 b^{m} c d x^{2} x^{- m} \Gamma \left (2 - m\right ) {{}_{2}F_{1}\left (\begin {matrix} - m, 2 - m \\ 3 - m \end {matrix}\middle | {\frac {a x e^{i \pi }}{b}} \right )}}{\Gamma \left (3 - m\right )} + \frac {b^{m} d^{2} x^{3} x^{- m} \Gamma \left (3 - m\right ) {{}_{2}F_{1}\left (\begin {matrix} - m, 3 - m \\ 4 - m \end {matrix}\middle | {\frac {a x e^{i \pi }}{b}} \right )}}{\Gamma \left (4 - m\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+\frac {b}{x}\right )}^m\,{\left (c+d\,x\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________