Group Abstract Group Abstract

Message Boards Message Boards

1
|
4.1K Views
|
8 Replies
|
9 Total Likes
View groups...
Share
Share this post:

Integrate function yielding two different answers

Posted 2 years ago

I am really hoping someone can help with this. I am getting two different results when using Integrate in Mathematica using the exact same integrand. When there is a new Kernel, the integral evaluates to one values, and after that, successive running of the Kernal yields a different result running the exact same integrand. Except, after the Kernel has been run more than once, the result doesnt change. The problem is that when you compare the two results, they are not equal.

Why would Mathematica evaluate the exact same integrand to two different results just because of successive running of the Kernel? And more concerning, why are the two results not equal.

Outline of Evaluations below:

In[1]:= Integrate[  (m0 v^3)/(c^2 (1 - v^2/c^2)^(3/2)) + (m0 v)/Sqrt[
  1 - v^2/c^2] + (m0 v^3)/(
  c0^2 Sqrt[1 - v^2/c^2] (-1 + v^2/c0^2)^(3/2)) - (m0 v^3)/(
  c^2 (1 - v^2/c^2)^(3/2) Sqrt[-1 + v^2/c0^2]) - (m0 v)/(
  Sqrt[1 - v^2/c^2] Sqrt[-1 + v^2/c0^2]), v  ]

Out[1]= (m0 (-2 v^2 + 2 c^2 Sqrt[-1 + v^2/c0^2] - 
   Sqrt[c^2 - v^2] Sqrt[-c0^2 + v^2]
     ArcTan[(c^2 + c0^2 - 2 v^2)/(
     2 Sqrt[c^2 - v^2] Sqrt[-c0^2 + v^2])]))/(2 Sqrt[
 1 - v^2/c^2] Sqrt[-1 + v^2/c0^2])

In[2]:= Integrate[  (m0 v^3)/(c^2 (1 - v^2/c^2)^(3/2)) + (m0 v)/Sqrt[
  1 - v^2/c^2] + (m0 v^3)/(
  c0^2 Sqrt[1 - v^2/c^2] (-1 + v^2/c0^2)^(3/2)) - (m0 v^3)/(
  c^2 (1 - v^2/c^2)^(3/2) Sqrt[-1 + v^2/c0^2]) - (m0 v)/(
  Sqrt[1 - v^2/c^2] Sqrt[-1 + v^2/c0^2]), v  ]

Out[2]= (m0 (-v^2 + c^2 Sqrt[-1 + v^2/c0^2] + 
   Sqrt[c^2 - v^2] Sqrt[-c0^2 + v^2]
     ArcTan[Sqrt[-c0^2 + v^2]/Sqrt[c^2 - v^2]]))/(Sqrt[
 1 - v^2/c^2] Sqrt[-1 + v^2/c0^2])

In[3]:= (
 m0 (-2 v^2 + 2 c^2 Sqrt[-1 + v^2/c0^2] - 
    Sqrt[c^2 - v^2] Sqrt[-c0^2 + v^2]
      ArcTan[(c^2 + c0^2 - 2 v^2)/(
      2 Sqrt[c^2 - v^2] Sqrt[-c0^2 + v^2])]))/(
 2 Sqrt[1 - v^2/c^2] Sqrt[-1 + v^2/c0^2]) === (
 m0 (-v^2 + c^2 Sqrt[-1 + v^2/c0^2] + 
    Sqrt[c^2 - v^2] Sqrt[-c0^2 + v^2]
      ArcTan[Sqrt[-c0^2 + v^2]/Sqrt[c^2 - v^2]]))/(
 Sqrt[1 - v^2/c^2] Sqrt[-1 + v^2/c0^2])

Out[3]= False
Attachments:
POSTED BY: Tim Kirkpatrick
8 Replies

Thank you, all, for your replies in input. This has all been extremely helpful. Seeing the comments about internal cahce states actually sounds familiar, and would explain why futher reduction might be possible after running the initial cache, but not subsequent runs.

Again, thank you, all.

POSTED BY: Tim Kirkpatrick

What Henrik Schachner and Gianluca Gorni wrote sums it up.

(1) An antiderivative is correct if its derivative recovers the integrand.

(2) Different antiderivatives can result from differences in the internal cache states or timing differences in various places that might use time-constrained attempts.

POSTED BY: Daniel Lichtblau

I think I heard that Integrate caches some intermediate results when it is run. Next time you run it, Integrate is in a different internal state, and this may be the reason it gives a different answer, but still valid. Someone from Wolfram may comment on this.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard
Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use