Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

Integrate[x,{x,x1,x2}]

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

Integrate[x^2/(1-x),{x,x1,x2}]

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 –  belisarius Feb 26 '13 at 1:20
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.