Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Double integration
Replies: 10   Last Post: Dec 6, 2011 12:42 PM

 Messages: [ Previous | Next ]
 Roger Stafford Posts: 5,929 Registered: 12/7/04
Re: Double integration
Posted: Dec 6, 2011 12:42 PM

"Steven_Lord" <slord@mathworks.com> wrote in message <jbhhc3\$bau\$1@newscl01ah.mathworks.com>...
- - - - - - - -
Hi Marcio and Steve. In the case of that particular double integral I suggest that, rather than doing a fully two-dimensional numerical integration with 'quad2d', it may be preferable to transform to polar coordinates and take advantage of the fact that the resulting inner integrand now has a known analytic solution, so the problem can be reduced to a single numerical integration.

With the change to polar coordinates, x = r*cos(t), y = r*sin(t), the problem assumes the form

int(int('k*sqrt(b^2-r^2)/sqrt(a^2-r^2)*r','r',h*sec(t),a),'t',0,asec(a/h))

where h = 3, k = 4, a = 5, and b = 6.25 . Particularly if r is transformed to u = sqrt(a^2-r^2), a symbolic solution can readily be determined for this inner integrand. When evaluated at the two limits of integration the resulting function, though no longer approaching infinity at the upper limit, nevertheless still possesses an infinite derivative as t approaches asec(a/h), something that may disturb a numerical integration procedure. The transformation sin(v) = h/sqrt(a^2-h^2)*tan(t) remedies that also.

The final result of all this is a single integral from v = 0 to v = pi/2 of the function

f(v) = k*h*sqrt(a^2-h^2)/2*cos(v)./(a^2-(a^2-h^2)*cos(v).^2) .* ...
(sqrt(a^2-h^2)*cos(v).*sqrt(b^2-a^2+(a^2-h^2)*cos(v).^2) ...
+ (b^2-a^2)*asinh(sqrt(a^2-h^2)/sqrt(b^2-a^2)*cos(v)));

This is a very well-behaved curve without singularities or infinite slopes. In fact if plotted all the way from v = -pi/2 to +pi/2 it looks remarkably like a gaussian bell-shaped curve. On my system the integral yields an answer of 53.57353374498558 when the tolerance is set to a tight value.

The advantage this procedure has over a double numerical integration is presumably that far fewer points need be evaluated in the one-dimensional case, and there is no difficulty with the singularity that occurs all the way along the circular boundary. On the other hand, there is admittedly more work for the user to do in the necessary algebra involved in performing these transformations.

Roger Stafford

Date Subject Author
12/1/11 Marcio
12/1/11 Roger Stafford
12/1/11 Roger Stafford
12/2/11 Marcio Barbalho
12/2/11 Roger Stafford
12/2/11 Marcio Barbalho
12/2/11 Roger Stafford
12/4/11 Steven Lord
12/6/11 Roger Stafford
12/3/11 Roger Stafford
12/3/11 Marcio Barbalho