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

  1. Nov 28, 2009 #1
    u := x (4 - y - x^2)
    v := y (-1 + x)

    (-2,0)

    du := (4 - y - 3 x^2) dx - x dy
    dv := y dx + (-1 + x) dy

    x := -2 + Cos[\[Theta]]
    y := 0 + Sin[\[Theta]]
    dx := -Sin[\[Theta]]
    dy := Cos[\[Theta]]

    Integrate[1/(2 \[Pi]) Expand[(u dv - v du)/(u^2 + v^2)], {\[Theta], 0,
    2 \[Pi]}]

    If you copy and paste that into mathematica, I'm supposed to get either 1 or -1 but it doesn't work. Does anyone know why?
     
  2. jcsd
  3. Nov 28, 2009 #2
    Even if I use N
     
  4. Nov 28, 2009 #3

    Dale

    Staff: Mentor

    If you want to do a numerical integration then be sure to have some machine precision numbers in either the integrand or the limits of integration. E.g.

    Integrate[1/(2 \[Pi]) Expand[(u dv - v du)/(u^2 + v^2)], {\[Theta], 0.0, 2.0 \[Pi]}]

    If you do that then it will perform a numerical integration. Otherwise it will try to evaluate the integral symbolically and then simply plug in the limits. However, when it does the symbolic integration I do not understand why it gives 0.
     
  5. Nov 29, 2009 #4
    Oh well it works. Thank you!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Numerical Integration
Loading...