Another bug? Weird integration results.

  • Context: Mathematica 
  • Thread starter Thread starter Hepth
  • Start date Start date
  • Tags Tags
    Bug Integration Weird
Click For Summary
SUMMARY

The discussion addresses a discrepancy in integration results when using Mathematica 9 (MM9) for a specific function. Users reported that integrating the function piecewise yields different results compared to integrating the entire function at once. The issue was identified as related to the simplification of the function prior to integration. By applying either Simplify or FullSimplify to the function before integration, users achieved consistent results, demonstrating the importance of function simplification in obtaining accurate integration outcomes.

PREREQUISITES
  • Familiarity with Mathematica 9 syntax and functions
  • Understanding of integration techniques in calculus
  • Knowledge of function simplification methods in Mathematica
  • Basic concepts of complex numbers in mathematical functions
NEXT STEPS
  • Research "Mathematica 9 integration techniques" for best practices
  • Learn about "Simplify vs. FullSimplify in Mathematica" to understand their differences
  • Explore "Debugging integration discrepancies in Mathematica" for troubleshooting
  • Study "Complex number integration in Mathematica" for advanced applications
USEFUL FOR

Mathematics students, researchers using Mathematica for computational tasks, and anyone involved in numerical analysis or symbolic computation who needs to ensure accurate integration results.

Hepth
Science Advisor
Gold Member
Messages
458
Reaction score
40
I can't upload the notebook I guess, that would be a nice feature mods! (.nb extension)

But here is my code , there seems to be a problem with integrating separately and then combining.

Code:
$Assumptions = 0 < r < 1 && 0 < z < 1;
FUNCTION = Expand[-(Pi*(-1 + r)*(-12*z + r^2*z + r*(-12 + 11*z)))/(12*(r*(-1 + z) - z))];
temp1 = Table[Integrate[FUNCTION[[i]], z, Assumptions -> $Assumptions], {i, 1, Length[FUNCTION]}] // Total // Expand
temp2 = Integrate[FUNCTION, z, Assumptions -> $Assumptions] // Expand
temp1 /. {r -> 1/16., z -> 0.1}
temp2 /. {r -> 1/16., z -> 0.1}

So the problem is that if I choose each piece of the function, integrate them individually, its not the same result as if i do the whole integration.

This is on MM9 right now. Can anyone confirm this? My results are

0.297957 -0.620063 I
0.495329 -0.00321276 I
 
Physics news on Phys.org
Wow it really is just something with not fullsimplifying the function first :

Code:
FUNCTION = (-12*z + r^2*z + r*(-12 + 11*z))/(12*(r*(-1 + z) - z));
Integrate[   Simplify[FUNCTION,   0 < r < 1 && 0 < z < 1], z] /. {r -> 1/16, z -> 1/10} // N
Integrate[   FullSimplify[FUNCTION,   0 < r < 1 && 0 < z < 1], z] /. {r -> 1/16, z -> 1/10} // N

0.168179 -0.00109083 I

0.101165
 

Similar threads

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