"Marcio Barbalho" <firstname.lastname@example.org> wrote in message <email@example.com>... > I have abso-bloody-lutely nothing against numerial integration. In actuality, I love numerical methods, of course, that does not mean I am an expert. I am just a junior engineer who loves maths and eventually find it interesting to play with calculus on rainy weekends. > > Alright... my question is... how do I solve the inner integral numerically if the upper limit is not a number but an expression? I tried with the substitutions you proposed it pushed me to the drawing board, meaning it hit some point that neither mupad nor maple could go any further. > > Thank you - - - - - - - - - - OK, do you agree with me that changing to polar coordinates gives you this equivalent double integral:
int (0,asec(5/3)) int (3*sec(t),5) sqrt((625-16*r^2)/(25-r^2))*r dr dt ?
I'm not certain but I don't believe Mupad or Maple can do that for you. It takes a little calculus on your part.
However, I strongly suspect that Maple can obtain a formula in terms of t for that inner integral taken with respect to r:
int (3*sec(t),5) sqrt((625-16*r^2)/(25-r^2))*r dr
If I can do it using the substitution u = sqrt(25-r^2) as I showed you earlier, presumably Maple can also do it with some trick or other. If not, here is the basic form out of my integral table that will allow you to solve that indefinite integral in terms of u I mentioned:
int sqrt(a^2+z^2) dz = 1/2*z*sqrt(a^2+z^2)+1/2*a^2*log(z+sqrt(a^2+z^2))
From that you can derive a solution to the above inner definite integral. Either way, this inner integral does not require numerical integration. The result is a specific formula in terms of t for the inner integral.
Using the resulting formula for the inner definite integral as a function of t, you can then use one of matlab's numerical quadrature functions, 'quad', 'quadgk', or 'quadl', to do a single numerical (outer) integration with respect to t using the inner integral expression as an integrand between the two limits t=0 and t=asec(5/3). You do need to do a little study on these routines to be able to set up the desired error tolerances, etc.
As I mentioned earlier there should be no trouble with singularities if you proceed along the above lines. On the other hand, if you were to integrate with respect to t first and then with respect to r afterwards, I believe you would have trouble with a singularity at r = 5, so it is advisable to integrate with respect to r first.
Does all that make sense? If not, just ask for further help.