How to do a double integral on matlab?

Click For Summary

Discussion Overview

The discussion revolves around performing a double integral calculation in MATLAB for the integral ##∫∫ xy/(xy^2 +1)^2## over a specified region. Participants are seeking assistance with syntax and correctness of their MATLAB code.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant shares their MATLAB code for calculating the double integral but encounters issues, asking for help with the syntax.
  • Another participant points out a potential misunderstanding regarding the notation of the double integral, suggesting that clarity in the integral's expression and limits would be beneficial.
  • A third participant emphasizes the difference in the denominator of the integrand as presented in the initial posts, questioning whether it is correctly defined in the code.
  • One participant acknowledges a mistake in their earlier post regarding the integrand's denominator but asserts that their definition of the function is correct.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the correct formulation of the integral and the MATLAB syntax. There is no consensus on the resolution of the issues raised, as multiple interpretations of the integral and its implementation exist.

Contextual Notes

Participants have not fully clarified the integral's notation or the specific limits of integration, which may affect the understanding and execution of the MATLAB code.

Lucas94
Messages
7
Reaction score
0
Hey! I want to do a double integral calculation of this problem##∫∫ xy/(xy^2 +1)^2##

over the region bounded by 2 ≤ x ≤ 3 and 2*sqrt(1+x) ≤ y ≤ 2*sqrt(2+4x)
on MATLAB and i have tried the following syntax:

clc

clear all

fun=@(x,y) x*y./((x*y.^2+1).^2);

ymax=@(x) 2*sqrt(2+4*x);
q=integral2(fun,2,3,2*sqrt(1+x),ymax);But its doesn't work, can someone see what I am doing wrong?
 
Last edited:
Physics news on Phys.org
Lucas94 said:
Hey! I want to do a doubble integral calculation on MATLAB and i have tried the following syntax:

clc

clear all

fun=@(x,y) x*y./((x*y.^2+1).^2);

ymax=@(x) 2*sqrt(2+4*x);
q=integral2(fun,2,3,2*sqrt(1+x),ymax);But its doesn't work, can someone see what I am doing wrong?
It's not clear which double (only one 'b' in double) integral you are trying to evaluate.

If you would provide the actual integral using calculus notation, that would be a big help. Also, specify the region of integration or the limits, as required.
 
SteamKing said:
It's not clear which double (only one 'b' in double) integral you are trying to evaluate.

If you would provide the actual integral using calculus notation, that would be a big help. Also, specify the region of integration or the limits, as required.
##∫ ∫ xy/(xy^2 +1)^2##

over the region bounded by 2 ≤ x ≤ 3 and 2*sqrt(1+x) ≤ y ≤ 2*sqrt(2+4x)
 
Last edited:
Lucas94 said:
##∫ ∫ xy/(xy^2 +1)##

over the region bounded by 2 ≤ x ≤ 3 and 2*sqrt(1+x) ≤ y ≤ 2*sqrt(2+4x)

The denominator of the integrand above is (xy2 + 1)

Lucas94 said:
clc

clear all

fun=@(x,y) x*y./((x*y.^2+1).^2);

ymax=@(x) 2*sqrt(2+4*x);

In the definition fun above, the denominator appears to be (xy2 + 1)2. See the difference?
 
SteamKing said:
The denominator of the integrand above is (xy2 + 1)
In the definition fun above, the denominator appears to be (xy2 + 1)2. See the difference?
My bad i forgot to write it on the integrand , the denominator should be ##(xy^2 + 1)^2## soo my definition of fun is correct
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K