Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been having trouble to make mathematica evaluate an integral without specifying the values of the limits of integration. I mean, if I write


Mathematica returns the correct answer: $\frac{(x2)^2-(x1)^2}{2}$. But If I write something like


Mathematica just keeps the evaluation forever...

Is there something that I can do to avoid this behaviour?

share|improve this question
Consider what happens when x1 <= 1 <= x2 – Dr. belisarius Feb 26 '13 at 1:20
up vote 3 down vote accepted

The integral doesn't converge everywhere, see @belisarius comment, so tell Integrate what constraints you have on x1 and x2 via the Assumptions option:

Integrate[x^2/(1 - x), {x, x1, x2}, Assumptions -> 1 < x1 < x2 || x1 < x2 < 1]
(* 1/2 (x1 - x2) (2 + x1 + x2) + Log[1 - x1] - Log[1 - x2] *)
share|improve this answer
Oh, thank you. I din't know that I had to specify that, but obviously it makes perfect sense. Thank you – PML Feb 26 '13 at 2:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.