Incorrect antiderivative for product of powers of linears

Mathematica 10.3 evaluates

Integrate[((a+b x)^m (c+d x)^n) / (e+f x)^(m+n+2),x]

to

\frac{(a+b x)^{m+1} (c+d x)^n (e+f x)^{-m-n-2} \left(\frac{b (c+d x)}{b c-a d}\right)^{-n} \left(\frac{b (e+f x)}{b e-a f}\right)^{n+1} \, _2F_1\left(m+1,-n;m+2;\frac{(c f-d e) (a+b x)}{(b c-a d) (e+f x)}\right)}{b (m+1)}

which is incorrect, in the sense that its derivative is not equal to the integrand.
This can be verified by noting that the substitution

Simplify[D[Integrate[((a + b*x)^m*(c + d*x)^n)/(e + f*x)^(m + n + 2), x], x]] /.
     {a -> 2, b -> -2, c -> -2, d -> 4, e -> 7, f -> -4, m -> 1, n -> 1/2, x -> 2}

evaluates to 2 i \sqrt{6}; whereas

((a + b*x)^m*(c + d*x)^n)/(e + f*x)^(m + n + 2) /.
     {a -> 2, b -> -2, c -> -2, d -> 4, e -> 7, f -> -4, m -> 1, n -> 1/2, x -> 2}

evalues to -2 i \sqrt{6}. A correct antiderivative of \int \frac{(a+b x)^m (c+d x)^n}{(e+f x)^{m+n+2}} \, dx is

\frac{(a+b x)^{m+1} (c+d x)^n \, _2F_1\left(m+1,-n;m+2;-\frac{(d e-c f) (a+b x)}{(b c-a d) (e+f x)}\right)}{(m+1) (b e-a f) (e+f x)^{m+n+1} \left(\frac{(c+d x) (b e-a f)}{(e+f x) (b c-a d)}\right)^n}

Albert

Hi Albert,

I would be careful with the use of the term “incorrect”. One has to make proper assumption to enable Mathematica to do cancelations. Try this:

ClearAll["Global`*"]
$Assumptions = {n >= 0, n \[Element] Integers};
origExpr = ((a + b x)^m (c + d x)^n)/(e + f x)^(m + n + 2);
iexpr = Integrate[origExpr, x];
dexpr = D[iexpr, x] // Simplify;
dexpr === origExpr
(* Out:  True *)

Regards – Henrik

PS.: I hope this is not one of those cases you count as “Mathematica fails” on your website …

Appears to be a branch cut issue in that the derivative of the symbolic antiderivative power-expands to the integrand.

Yes, the problem is the expansion of the factor

\left(\frac{(c+d x) (b e-a f)}{(e+f x) (b c-a d)}\right)^{-n}

in my proposed antiderivative to

\left(\frac{b (c+d x)}{b c-a d}\right)^{-n} \left(\frac{b (e+f x)}{b e-a f}\right)^n

in Mathematica’s result, which unfortunately is not always valid if n is not an integer.

Albert