Numerical Integration: Solving for (-2,0)

• Nusc
In summary, when trying to do a numerical integration in Mathematica, it is important to use machine precision numbers in either the integrand or the limits of integration. Otherwise, the result may be incorrect or give an unexpected answer.
Nusc
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?

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!

1. What is numerical integration?

Numerical integration is a method used to approximate the definite integral of a function by dividing the area under the curve into smaller rectangles and summing their areas.

2. Why is numerical integration important?

Numerical integration is important because it allows us to calculate the value of integrals that cannot be solved analytically. It is also used in many real-life applications such as calculating areas, volumes, and probabilities.

3. How is numerical integration performed?

Numerical integration is performed by dividing the interval of integration into smaller subintervals and using a numerical method, such as the trapezoidal rule or Simpson's rule, to approximate the integral over each subinterval. The results from each subinterval are then summed to get an overall approximation of the integral.

4. What is the difference between numerical integration and analytical integration?

Numerical integration involves approximating the value of an integral using a numerical method, while analytical integration involves finding the exact value of an integral using mathematical techniques such as integration by parts or substitution.

5. How can numerical integration be improved?

Numerical integration can be improved by using more subintervals, which will result in a more accurate approximation. Other methods, such as adaptive integration, can also be used to improve the accuracy of numerical integration. Additionally, using more advanced numerical methods, such as Gaussian quadrature, can also lead to better approximations.

• MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
• MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
• MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
420
• MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
597
• MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
• MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
415
• Calculus and Beyond Homework Help
Replies
19
Views
1K
• Calculus and Beyond Homework Help
Replies
1
Views
686
• Calculus and Beyond Homework Help
Replies
5
Views
913
• Calculus
Replies
2
Views
846