# Complex double integration problem

fanttamdiv

## Homework Statement

This isn't for homework but the question fits the general HW format. Basically, I am getting a different answer from my colleague on the double integral below so I am trying to find out why. I am trying to put this into excel so I can play with the numbers and see the different results. The double integral is attached (Image upload wasn't working, hopefully this isn't a big deal).

## Homework Equations

The values I am using are as follows:

a: 2
b:1.2
c:1

## The Attempt at a Solution

So the first integration (with respect to y) yields me this:

(.5)*(((x^2)*(arsinh((sqrt((a^2)-(x^2)))/x)))-(b*(sqrt((x^2)+(b^2))))+(a*(sqrt((a^2)-(x^2))))-((x^2)*(arsinh(b/x))))

Remember, I am putting this through excel so I am keeping the variables in there until the end. The second integration (with respect to x now) yields me this:

.5*(((-b^3)*(arsinh(c/b)))+((a^3)*(arcsin(c/a)))-((b*c)*(sqrt((c^2)+(b^2))))+((a*c)*(sqrt((a^2)-(c^2)))))

So now that I have this, I can have excel plug in the variables listed in the above section and get the answer. With the variables above, I am getting ~2.234. My colleague, however, is getting ~2.361. I do not have access to his work, and he seems confident in his answer. Basically I am bringing up this issue a couple years after he did the original problems and he isn't allotted any more time to work on this so I'm on my own. Is there something I am doing wrong?

Thanks

#### Attachments

• DoubleIntegral.png
1.7 KB · Views: 414
Last edited:

brmath
Hi,

It was a little hard to follow because the Latex didn't render. Did you use Latex?

That said, I wonder whether you would be better off switching to polar coordinates and integrating over r and ##\theta##. The expressions might be shorter to write out, making it easier to see if there is a computational error.

Another thing is whether Excel is creating a rounding error. For example, when you plug in b = 1.2, are you forcing Excel to use exactly 1.2, or is it using 1.9999999? Or is your friend doing it in double precision and you in single precision? Given the complexity of the expressions, the small difference in your answers could be due to rounding.

fanttamdiv
brmath,

I used a calculator online, and plugged the values in and got the same answers as excel so I don't think it is an excel rounding error. The calculator I used is: http://www.integral-calculator.com/# . You should be able to plug those equations into the calculator and it will show it in an easier to read format. Probably should have posted this to begin with. Also, I'm not familiar with the term double/single precision, care to enlighten me?

brmath
It is a matter of how many digits the computer is carrying along in the computations. Traditionally a single precision number was stored 32 bits, which gives you a certain number of decimal places of accuracy. A double precision number is stored in 64 bits, which more than doubles the accuracy (more than double because you don't need a sign bit in the extra 32 bits).

If both your online calculator and Excel give the same answer, I agree it is probably not a rounding error. I was not able to plow thru the derivation you gave to see if I could spot a mistake because I could barely read it. It is perfectly possible that you have some small error; but then I wonder why your answer is so close.

http://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel . There are many other articles around on this subject.

There are occasions where the computation is 'ill conditioned' -- that is, a small change in the inputs can result in a large change in the outputs. Given the arcsin's and other irrational numbers and the subtractions floating around in your solution, that could be the case here. It is possible that different versions of Excel compute the arcsin a bit differently -- who knows what they change from one version to the next.

Now, with that said, I strongly suggest you try again in polar coordinates. The computations are much simpler, so you are less likely to make an error.

For the y integral let y = asinu (where this is the same a you have in the limit of integration). dy = acosu and u = arcsin(x/a). Assuming x = acosu you get

##\int_{-c}^c dx \int_{arcsin(b/a)}^d## ##a^2##cos du where d = arcsin(##\frac {\sqrt{a^2 - x^2}}{a}##). When you evaluate this the assorted arcsins will go away. Now tackle the x integral similarly.

See if what you get:
a) gives you the right answer
b) matches the computation you did in cartesian coordinates