I am trying to do the following definite integral:
Integrate[(a x^2 + b x + c)^k, {x, 0, 1}]
where $a,b,c,k \in \mathbb{R}$
Now, the problem is Mathematica takes forever to produce a result which I understand is happening because of some complicated simplification procedure.
Note that the indefinite integral is done in a flash:
Integrate[(a x^2 + b x + c)^k, x]
(2^(-1 + k) (b - Sqrt[b^2 - 4 a c] + 2 a x) (( b + Sqrt[b^2 - 4 a c] + 2 a x)/Sqrt[ b^2 - 4 a c])^-k (c + x (b + a x))^k Hypergeometric2F1[-k, 1 + k, 2 + k, (-b + Sqrt[b^2 - 4 a c] - 2 a x)/( 2 Sqrt[b^2 - 4 a c])])/(a (1 + k))
After which the following:
(% /. x -> 1 - % /. x -> 0) //PowerExpand //Simplify
does give a result, but its overly complicated and I think it can be simplified further. The reason I think so is that I have not been able to exhaust the simplification situation with say FullSimplify
, that is taking forever to return a result.
Can anyone suggest any workaround here?
Edit 1:
I made a simple mistake by not putting some brackets.
((% /. x -> 1) - (% /. x -> 0)) //PowerExpand //FullSimplify
does work now.
However, I am still curious why the definite integral doesn't work in the first place. Thoughts and comments will be appreciated.
Edit 2:
Given that my original problem is solved, I would like to ask another related question. What if I wanted to do the 2-variable generalization of the same:
Integrate[(a*x^2 + b*y^2 + c x y + d x + f y + g)^k, {x, 0, 1}, {y, 0,
1}, Assumptions -> (a*x^2 + b*y^2 + c x y + d x + f y +
g) \[Element] Reals && Im[b] == 0 && Im[a] == 0 && Im[c] == 0 &&
Im[d] == 0 && Im[f] == 0 && Im[g] == 0 && Im[k] == 0]
After a while, Mathematica returns the input back. Can this be done analytically, at all?
(% /. x -> 1) - (% /. x -> 0) // PowerExpand // Simplify
$\endgroup$ – Ulrich Neumann Jun 9 '18 at 14:09Integrate[(a*x^2 + b*x + c)^k, {x, 0, 1}, Assumptions -> {a > 0, b > 0, c > 0, k > 0, k \[Element] Integers}]
$\endgroup$ – Mariusz Iwaniuk Jun 9 '18 at 16:19k
is a positive integer, your integrand will have singularities at the zeros of your quadratic. Those potentially make direct evaluation from the indefinite integral unreliable. I believe that Mathematica's difficulty here lies in the difficulty of avoiding trouble with singularities. $\endgroup$ – John Doty Jun 10 '18 at 9:23