Numerical Integration: Solving for (-2,0)

Click For Summary

Discussion Overview

The discussion revolves around numerical integration in the context of a specific mathematical expression involving variables u and v, evaluated at the point (-2,0). Participants explore the challenges faced when attempting to compute the integral using Mathematica, particularly focusing on the need for machine precision in numerical integration.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant presents a mathematical expression and attempts to compute an integral, expecting a result of either 1 or -1.
  • Another participant suggests that using machine precision numbers in the integrand or limits of integration is necessary for numerical integration to work correctly.
  • A later reply indicates that changing the limits of integration to include decimal points allows Mathematica to perform numerical integration instead of symbolic evaluation.
  • One participant expresses satisfaction after resolving the issue, indicating that the integration now works as intended.

Areas of Agreement / Disagreement

Participants generally agree on the importance of using machine precision for numerical integration, but there is no consensus on why the symbolic integration initially yields a result of 0.

Contextual Notes

Limitations include the potential misunderstanding of symbolic versus numerical integration processes in Mathematica, as well as the dependency on the definitions of the variables involved.

Nusc
Messages
752
Reaction score
2
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?
 
Physics news on Phys.org
Even if I use N
 
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.
 
Oh well it works. Thank you!
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K