Mathematica : Integrate and a Log problem?

Click For Summary

Discussion Overview

The discussion revolves around issues encountered while using Mathematica for integration involving logarithmic expressions. Participants explore the effects of variable replacement on integration results, particularly focusing on the behavior of the function under specific assumptions and limits.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes a discrepancy in integration results when replacing a variable with a constant that includes a logarithm, noting that changing the representation from 1/2 to 0.5 affects the outcome.
  • Another participant suggests that the four integration plots appear identical in a newer version of Mathematica (MMA 9), implying a potential version-related issue.
  • A participant mentions experiencing a consistent plot in MMA 9, contrasting with their results in MMA 7, indicating a possible bug or difference in handling between versions.
  • One participant expresses a desire to confirm results across different versions of Mathematica, suggesting that others might assist in comparing outputs to verify the issue.
  • Another participant shares their reluctance to upgrade due to usability concerns with the newer version but acknowledges the necessity of resolving the integration issue for their research.
  • Discussion includes a suggestion for managing multiple versions of Mathematica on the same machine to facilitate comparisons and troubleshooting.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the cause of the discrepancies in integration results. There are multiple competing views regarding the impact of Mathematica versions on the outcomes, and no definitive resolution is presented.

Contextual Notes

Participants note that the behavior of the integration may depend on the specific version of Mathematica used, and there are mentions of potential bugs or differences in handling mathematical expressions across versions. The discussion reflects uncertainty regarding the implications of these differences on the results obtained.

Who May Find This Useful

This discussion may be useful for Mathematica users dealing with integration involving logarithmic expressions, particularly those interested in version-specific behaviors and troubleshooting integration discrepancies.

Hepth
Science Advisor
Gold Member
Messages
458
Reaction score
40
Here is the code, I am using Mathematica 7 with no packages installed at the moment.

Code:
$Assumptions = 0 < u <= 19/80 && I10 \[Element] Reals;
FXN = Sqrt[(u - 15/16)^2 - 2/5 (u + 17/16) + 1/25] (I10 (u^2) - 1/u);
PA = Integrate[FXN /. {I10 ->  1/2 Log[1/2]}, u];
PB = Integrate[FXN, u] /. {I10 -> 1/2 Log[1/2]};
Plot[{Re[PA], Re[PB]}, {u, 0, 0.243}]

PA = Integrate[FXN /. {I10 -> 0.5  Log[1/2]}, u];
PB = Integrate[FXN, u] /. {I10 ->  0.5 Log[1/2]};
Plot[{Re[PA], Re[PB]}, {u, 0, 0.243}]

What I am doing is finding the upper limit of an integral. If I make a replacement of a variable to a constant before or after the integration I get different results. The constant is not complex, and is a real number, though contains a Log[1/2].

I know the Sqrt in FXN is only real for u<0.243 ish, and my limit of integration is right below that.
I have tried limits too, and its the same as just a replacement rule.

NOTICE, if you change the 1/2 to 0.5 in the replacement rule it works.

Is there a way I can get these to be the same no matter what?
 
Physics news on Phys.org
Can you be more specific about what expression you want to find?

If I do this

Code:
$Assumptions = 0 < u <= 19/80 && I10 \[Element] Reals;
FXN = Sqrt[(u - 15/16)^2 - 2/5 (u + 17/16) + 1/25] (I10 (u^2) - 1/u);
PA1 = Integrate[FXN /. {I10 -> 1/2 Log[1/2]}, u];
PB1 = Integrate[FXN, u] /. {I10 -> 1/2 Log[1/2]};
PA2 = Integrate[FXN /. {I10 -> 0.5 Log[1/2]}, u];
PB2 = Integrate[FXN, u] /. {I10 -> 0.5 Log[1/2]};
Plot[{Re[PA1], Re[PB1], Re[PA2], Re[PB2]}, {u, 0, 0.243}]

the four plots look like they lie on top of each other, at least with MMA 9.

Can you write

This expression <> and this expression <> differ at the 4th (or 20th) digit. Why?

Thanks
 
Ok. In MM7 I get this plot :

zjw9s7.jpg


Maybe it was a bug that was fixed in MM8 or 9. Its not off by precision, but by some actual REAL amount. The problem I noted on my MM7 Ubuntu machine at work, and just now I am posting this from my windows 7 netbook at home, that uses a different kernel.

Time to upgrade I guess.
 
Unfortunately I lost a machine and so I don't have versions 5.2, 6, 7 and 8 to try this on. Perhaps you could ask nicely in another place if someone else could compare the results with 7 and 9 and see if they can confirm your results. That might save an upgrade if there is some other reason for this.
 
I actually have the license for up to 9, I just didn't like the autocomplete feature when programming when I had 9 on another machine so I never changed it on my new ones. I guess Ill do this tomorrow, as my research depends on it. Thanks for your help. I'm always glad its not something that I am misunderstanding.
 
How to permanently turn off the predictive interface

http://support.wolfram.com/kb/11466

I'm running with the predictive interface turned off until they fix some problems where this can make it use all available memory and swap space given some seemingly simple problems.

You should check details carefully to make certain you don't lose anything, but it has been possible to have multiple versions happily installed on the same machine. You can't run those at the same time, but I have had great use of being able to switch back to a previous version to check something.

If you can do that then you can use 7 for almost everything and then just check with 9 when there is a question.
 
Thanks. I'll install 9 and turn off predictive. The problem is that this little part is a representation of what I am actually integrating (pages long of algebraic form), and happened to be the piece with a problem. Its unfortunate as I have spent weeks running high precision integrations over a large phase space, only to see this when commenting my code. (The output just didn't look algebraically right, as it was putting that I10 into a logarithm after integration, and its solely multiplicative).
I can avoid this for now by just replacing everything at the start, and maybe check some of my data.

Thanks again for your help.
 

Similar threads

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