Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to do a double integral on matlab?

  1. Mar 1, 2016 #1
    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. jcsd
  3. Mar 1, 2016 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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.
     
  4. Mar 1, 2016 #3

    ##∫ ∫ 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
  5. Mar 1, 2016 #4

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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?
     
  6. Mar 1, 2016 #5
    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
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook