# How to do a double integral on matlab?

Tags:
1. Mar 1, 2016

### Lucas94

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 doesnt work, can someone see what im doing wrong?

Last edited: Mar 1, 2016
2. Mar 1, 2016

### SteamKing

Staff Emeritus
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.

3. Mar 1, 2016

### Lucas94

$∫ ∫ 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: Mar 1, 2016
4. Mar 1, 2016

### SteamKing

Staff Emeritus
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?

5. Mar 1, 2016

### Lucas94

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