Numerical Integration

  • Thread starter Nusc
  • Start date
  • #1
753
2

Main Question or Discussion Point

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?
 

Answers and Replies

  • #2
753
2
Even if I use N
 
  • #3
29,727
6,065
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.
 
  • #4
753
2
Oh well it works. Thank you!
 

Related Threads on Numerical Integration

  • Last Post
Replies
1
Views
675
Replies
8
Views
2K
  • Last Post
Replies
3
Views
26K
  • Last Post
Replies
4
Views
807
Replies
16
Views
628
Replies
27
Views
1K
  • Last Post
Replies
3
Views
847
Replies
1
Views
6K
Replies
4
Views
61K
  • Last Post
Replies
2
Views
2K
Top