Double integral, inner function has variable limit (very particular case)

15 visualizaciones (últimos 30 días)
I need to calculate a double integral where the inner function depends on both x and y (I integrate it on y and one of the limit depends on x), then I integrate the remaining on x. This is an example of code:
f1=@(x,y) x.^2+y; %inner function to be integrated on y
f2=@(x) sqrt(x).*integral(@(y)f1(x,y),x,3); %second function, to be integrated on x
V = integral(@(x)f2(x),0,2) %final calculation
PS: I don't want to use symbolic functions
PPS: I know that this case could be solved by simple calculation on papar, but it's only a trivial case, what I need to do is way more complex
Thanks

Respuestas (1)

Steven Lord
Steven Lord el 22 de Ag. de 2016
Use the integral2 function instead of calling integral twice.
  1 comentario
Marco Ballerini
Marco Ballerini el 22 de Ag. de 2016
I know that integral2 exists, however I don't know how to use it... my inner function is "smaller" than the outer, with integral2 I integrate the whole expression on two variables and I need something quite different (see how my f2 is defined).
If instead using integral2 is possible, I will be glad if you write me how to correct my code.
Thank you

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by