Mathematica : Integrate and a Log problem?

In summary, the code I am using, Mathematica 7, has no packages installed, and I am trying to find the upper limit of an integral. If I replace a variable to a constant before or after the integration I get different results. The constant is not complex, and is a real number. I have tried limits too, and its the same as just a replacement rule.
  • #1
Hepth
Gold Member
464
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
  • #2
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
 
  • #3
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.
 
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 
  • #7
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.
 

FAQ: Mathematica : Integrate and a Log problem?

What is Mathematica?

Mathematica is a computational software program used for scientific, mathematical, and engineering calculations. It allows for advanced calculations, visualization, and programming capabilities.

What is the "Integrate" function in Mathematica?

The "Integrate" function in Mathematica is used for calculating definite and indefinite integrals. It can handle a wide range of mathematical functions and has various options for different integration methods.

How do I use the "Integrate" function in Mathematica?

To use the "Integrate" function, you need to input the function or expression to be integrated, along with any necessary variables or limits of integration. For example, to integrate the function x^2, you would enter "Integrate[x^2,x]" into the Mathematica input field.

What is a logarithm and how do I use it in Mathematica?

A logarithm is a mathematical function that represents the power to which a base number must be raised to produce a given number. In Mathematica, the logarithm function is denoted as "Log[x]", where x is the number or expression to be evaluated.

How can I solve a logarithm problem using Mathematica?

To solve a logarithm problem in Mathematica, you can use the "Solve" function and specify the logarithmic equation to be solved. You can also use the "FindRoot" function to find the numerical root of a logarithmic equation.

Similar threads

Replies
1
Views
2K
Replies
1
Views
1K
Replies
13
Views
2K
Replies
9
Views
3K
Replies
4
Views
2K
Replies
1
Views
924
Replies
14
Views
3K
Replies
10
Views
1K
Replies
4
Views
4K
Back
Top