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

Numerical Integration of Double integrals

  1. Oct 12, 2012 #1
    I have a double integral:

    A=length along x
    B=length along y

    ranges: 0 to A(for x) & 0 to B (for y)

    Analytical result is: A*B/4 (unit^2)

    Now, I want to evaulate it numerically using trapezoidal rule. Infact, I have done it but not sure whether it is a right procedure although got the same result as analytical. Here is what I did:

    for integrating wrt x I chose y=B and x=0 to A (with an interval Δx)

    evaluated the different values of the function for different x values. Then applied the trapezoidal rule using the evaluated values of the function and x. Got a result A/2 (unit).
    Similar thing I did only this time x=A and y=0 to B (with Δy interval). Got result B/2 (unit).

    Combining this two results gives me the same result as the analytical one. Is this a right way to do numerical integration of a double integral?

    Another question that is bugging me is the unit of the result of a numerical integration. It might sound stupid to most of you but this has been confusing me for the last few days.

    As we all know integration of a function is the area under the curve of that function. Now if a numerical integration technique is applied on that area, I would get the result of the intergation within its limits. Now what would be the unit this case? unit^2???

    Then why the function above if integrated wrt x or y produces a result whose unit is just the unit (e.g. m)? This is where it is confusing. In some examples I have seen, if the unit is not in say m then the whole result becomes inconsistent.

    For example
    ∫ψ(x)dx if integrated analytically in 0 to L range the result is L (m). Same found from numerical integration. If the integration is simply the area under the curve, then the unit should have been m^2 when doing numerically. This is where I have been arguing with someone. I hope someone would explain this stupid argument. Thanks.
  2. jcsd
  3. Oct 12, 2012 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  4. Oct 12, 2012 #3
    Please see the attached for the function psi.

    Attached Files:

    • psi.jpg
      File size:
      9.8 KB
  5. Oct 12, 2012 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    What the function is algebraically is irrelevant. What matters for your question is whether you regard it has having a length dimension. If you do, the integral will have dimension length squared (I'm assuming x has length dimension). If you don't then the integral is not computing an area - it only seems like an area because you drew it as a graph ( thereby giving psi length dimension).
  6. Oct 12, 2012 #5
    so the unit would depend on the unit I am considering for the function. Although the integral is not computing an area but the integral is found from the area of the curve drawn from the function along its limits numerically.

    e.g. ∫x^3dx= x^4/4 [m^4] (limit say 0 to 5)

    So I can evaluate it numerically by plotting a curve and computing the area under the curve within limits. I hope I am not pushing things further!! :S
  7. Oct 16, 2012 #6
    Is my way of doing the double integration correct using the trapezoidal rule?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook