How to do Double numerical integration with a variable limits
Show older comments
Can someone please help me in doing numerical integration on the following function, I want to do double numerical integration with respect to y and x, such that the final answer will be a function of z only. Also the limit of integration is not a constant, it is basically something like (x-y, x+y), not sure if there exist a way to do this, can someone please advise me on how to proceed?
Thank you

10 Comments
Torsten
on 3 Sep 2022
Please write out precisely the integral with limits of integration you want to compute.
Abdulaziz Al-Amodi
on 3 Sep 2022
John D'Errico
on 3 Sep 2022
Edited: John D'Errico
on 3 Sep 2022
Are lamdas and lamdab known? If they are not, you can do nothing, since this would not be a numerical integration.
Regardless, since z lies internal to the kernel, you cannot solve for the integral in any form, unless you also know the value of z.
A numerical integration requires that all variables you will not be integrating out are known constants.
Abdulaziz Al-Amodi
on 3 Sep 2022
John D'Errico
on 3 Sep 2022
Again, you CANNOT do a numerical integration where z (or ANY variable) is an unknown parameter to the problem. If the end goal is to integrate over z also, then you do indeed need to perform a triple integration.
Walter Roberson
on 3 Sep 2022
numeric integration can never be done on expressions that involve unresolved variables.
Consider for example that a numeric integration routine would not know whether z has a very small absolute value (such as 1e-200) that makes no difference to the integration... or if z will have a large enough absolute value that it overwhelms the x y contributions making the overall term very small.
Abdulaziz Al-Amodi
on 3 Sep 2022
Your sqrt expression becomes negative if you integrate from -Inf to +Inf in the z-direction.
Is it a special geometrical object you try to integrate over ?
And
fun = @(x,y,z) 4.*pi.*lambda1.*lambda2.*z.*exp(-pi.*(lambda2.*x.^2+lambda1.*y.^2))./sqrt(1-((x.^2+y.^2-z.^2)/(2.*x.*y)).^2);
instead of
fun = @(x,y,z) 4.*pi.*lambda1.*lambda2.*z.*exp(-pi.*(lambda2.*x.^2+lambda1.*y.^2))./(sqrt(1-((x.^2+y.^2-z.^2)/2.*x.*y).^2));
Torsten
on 4 Sep 2022
The integral (once it is correctly written) could be considered as a function of z. Then numerical integration can be carried out.
Abdulaziz Al-Amodi
on 6 Sep 2022
Edited: Abdulaziz Al-Amodi
on 6 Sep 2022
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!