1. Originally Posted by Copernicus
When using Wolframalpha, between -1 to 1, I get some values to be complex numbers and some numbers to be close to . I am wondering if Wolframalpha is spitting out some wrong answers, or if this is actually what is happening.

For example the following yields

n = .9991 ; integrate (x/n)\frac{(x/n)^2 - ((x-1)/n)^2}{(1-(x/n)^2)^{.5}} from x=-n to x=n

3.14159 - 3.23009×10^-16 i

I think it might have something to do with significant digits.
I think what is going on here is we are seeing some loss of accuracy, given that computers only represent numbers to a finite level of precision. The imaginary part has to be zero, since the integrand is real, and the variable of integration takes values on a real interval.

Original problem (after rearranging the integrand a bit),

.

Split the integral into two,

.

Making the substitution ,

.

Evaluating the integrals,

.

2. Established Member
Join Date
Jan 2010
Location
Wisconsin USA
Posts
2,837
Originally Posted by 21st Century Schizoid Man
I think what is going on here is we are seeing some loss of accuracy, given that computers only represent numbers to a finite level of precision. The imaginary part has to be zero, since the integrand is real, and the variable of integration takes values on a real interval.

Original problem (after rearranging the integrand a bit),

.

Split the integral into two,

.

Making the substitution ,

.

Evaluating the integrals,

.
Makes total sense! I wonder if the purchased version of wolframalpha would have done things correctly?

3. Established Member
Join Date
Oct 2009
Posts
1,744
Originally Posted by Copernicus
Makes total sense! I wonder if the purchased version of wolframalpha would have done things correctly?
When you ask a computer to evaluate an expression numerically, it is all but inevitable that finite-precision issues will arise. Here, you are bothered by a residual imaginary part that is 16 or 17 orders of magnitude smaller than the real part. That's like complaining that you have been given the incorrect radius of the earth because it is about one nanometer off.

This issue will not go away with the paid version. You can hide it in many cases by setting the various precision parameters that Wolfram supports, but numerical methods are...numerical. Computers have finite word lengths, so exactness is not to be expected in general. Special heuristics (at which Wolfram does well) can give the appearance of "doing things correctly", but cannot work 100% of the time.

4. Established Member
Join Date
Feb 2010
Posts
744
IIRC, there is software which can represent reals to an arbitrary number of digits (memory limited, of course); not sure if it is free, nor what OS, but very likely is as its origin is academia.

5. Established Member
Join Date
Jan 2010
Location
Wisconsin USA
Posts
2,837
Originally Posted by Geo Kaplan
When you ask a computer to evaluate an expression numerically, it is all but inevitable that finite-precision issues will arise. Here, you are bothered by a residual imaginary part that is 16 or 17 orders of magnitude smaller than the real part. That's like complaining that you have been given the incorrect radius of the earth because it is about one nanometer off.

This issue will not go away with the paid version. You can hide it in many cases by setting the various precision parameters that Wolfram supports, but numerical methods are...numerical. Computers have finite word lengths, so exactness is not to be expected in general. Special heuristics (at which Wolfram does well) can give the appearance of "doing things correctly", but cannot work 100% of the time.
I just have a hard time picturing complex numbers and knowing if any part of it can be ignored.

6. Established Member
Join Date
Jan 2010
Location
Wisconsin USA
Posts
2,837
Originally Posted by Copernicus
Makes total sense! I wonder if the purchased version of wolframalpha would have done things correctly?
Your equation looks a little like a stress energy tensor.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•