
Student Support Forum: 'Definite integrals - slow, garbage output Re & Im' topicStudent Support Forum > General > "Definite integrals - slow, garbage output Re & Im"
| Author |
Comment/Response |
FRB
|
05/12/12 1:25pm
Hi
I'm not not new to math, but new to Mathematica. And frustrated.
The definite integral from a to b of, say, Sqrt[r-x] is: 2/3[(-a + r)^(3/2) - (-b + r)^(3/2)]by doing it manually.
Using the indefinite Integrate[Sqrt[r - x], x] I get -(2/3) (r - x)^(3/2), which is the correct answer.
However, the moment I go a simple step further and make it definite, i.e. Integrate[Sqrt[r - x], {x, a, b}], it takes forever, uses all my CPU and eventually produces the following garbage:
{If[((Im[a] >= Im[b] &&
Im[b] Re[a] <= Im[a] Re[b]) || (Im[b] Re[a] >= Im[a] Re[b] &&
Im[a] <= Im[b])) && ((a - r)/(a - b) \[NotElement] Reals ||
Re[(a - r)/(a - b)] >= 1 || Re[(a - r)/(a - b)] <= 0),
2/3 (-a + r)^(3/2) - 2/3 (-b + r)^(3/2),
Integrate[Sqrt[-x + r], {x, a, b},
Assumptions -> ! (((Im[a] >= Im[b] &&
Im[b] Re[a] <= Im[a] Re[b]) || (Im[b] Re[a] >=
Im[a] Re[b] && Im[a] <= Im[b])) && ((a - r)/(
a - b) \[NotElement] Reals || Re[(a - r)/(a - b)] >= 1 ||
Re[(a - r)/(a - b)] <= 0))]]}
This is a simple example - the actual integrations I need to do become almost unworkable.
What gives? How do I cut out all the extra time and rubbish around the actual answer?
Thanks
FRB
URL: , |
|
| | | |
 | |
|