Message Boards Message Boards

0
|
4979 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Integration - symbols make a difference?

Posted 9 years ago

Integrate$[\frac{q1}{(q1^2 + b^2)} Log [(p + q1^2)+m^2] $,${q1,0,Infinity}]$

gives a different answer than

Integrate$[\frac{a}{(a^2 + b^2)} Log [(p + a^2)+m^2] $,${a,0,Infinity}]$

Using Mathematica 10.0

Why?

POSTED BY: Yaj Bhattacharya
8 Replies

I can answer your question abstractly. To paraphrase, you asked:

Can changing the name of a variable affect the outcome of a symbolic calcuation?

Yes it can. And this is a fact of life you have to live with. It's as fundamental a problem to scientific computing as floating point error is.

When you add variables together, they get sorted alphabetically: a+c+b gets turned into a+b+c. These are equivalent algebraically, but not equivalent numerically with floating point numbers. This is one reason to be warry of mixing symbolic transformations with floating point calculations. Why does it sort? Cannonicalization. This helps with many things including comparing expressions.

Mathematica also can't try every possible combination of transformations. So the ordering of terms has some possible effect on which terms are adjacent and which transformations will be tried.

TL;DR When using symbolic computing the names of your variables can matter. They aren't variables in the sense of most programming languages, but are symbols, which means something deeper.

POSTED BY: Sean Clarke
Posted 9 years ago

Following the change-in-variable approach...

sol = Integrate[u/(p^2 (u^2 + c)^2) (2 Log[p] + Log[(u + 1)^2 + d]), {u, 0, Infinity},
   Assumptions -> {c > 0, d > 0}] /. {c -> b^2/p^2, d -> m^2/p^2};
sol = FunctionExpand[sol, Assumptions -> {m > 0, p > 0, b > 0}] //. {Sqrt[(b^2 m^2)/p^4] -> b m/p^2, 
    Sqrt[b^2/p^2] -> b/p, ((b^2 m^2)/p^4)^(3/2) -> b^3 m^3/p^6, 
    Sqrt[(b^10 m^2)/p^12] -> b^5 m/p^6, (b^2/p^2)^(3/2) -> b^3/p^3, (b^2/p^2)^(5/2) -> b^5/p^5};
sol = FullSimplify[sol];
sol = Collect[sol, {\[Pi], Log[b], Log[m], Log[p], Log[1 + m^2/p^2], Log[1 + p^2/m^2]}]

I get the following solution (which certainly could be compacted a bit more):

(p \[Pi])/(2 b ((b + m)^2 + p^2)) + 
(2 m p ArcTan[p/m])/(((b - m)^2 + p^2) ((b + m)^2 + p^2)) + ((b^2 - m^2 + p^2) Log[b])/(((b - m)^2 + p^2) ((b + m)^2 + p^2)) + 
((2 b^4 - 4 b^2 m^2 + 2 m^4 + 4 b^2 p^2 + 4 m^2 p^2 + 2 p^4) Log[m])/(2 b^2 ((b - m)^2 + p^2) ((b + m)^2 + p^2)) +
((-b^4 + b^2 m^2 - b^2 p^2) Log[1 + m^2/p^2])/(2 b^2 ((b - m)^2 + p^2) ((b + m)^2 + p^2)) +
((-2 b^4 + 2 b^2 m^2 - 2 b^2 p^2) Log[p])/(2 b^2 ((b - m)^2 + p^2) ((b + m)^2 + p^2)) +
(((b^2 - m^2)^2 + 2 (b^2 + m^2) p^2 + p^4) Log[1 + p^2/m^2])/(2 b^2 ((b - m)^2 + p^2) ((b + m)^2 + p^2))

As a way to do some checking:

parms = {b -> 2.3, p -> 4.7, m -> 18.2};
sol /. parms
NIntegrate[a/(a^2 + b^2)^2 Log[(a + p)^2 + m^2] /. parms, {a, 0, Infinity}]

which results in 0.567437 for both.

POSTED BY: Jim Baldwin
Posted 9 years ago

For special case with p -> 1

Integrate[a/(a^2 + b)^2 Log[(a + p)^2 + m] /. p -> 1, {a, 0, Infinity}]

one obtains

ConditionalExpression[(1/(2 b))(Log[m] + (Sqrt[b] \[Pi] + b^(3/2) \[Pi] - 2 b Sqrt[m] \[Pi] + 
      Sqrt[b] m \[Pi] + 4 b Sqrt[m] ArcTan[1/Sqrt[m]] + 
      b (1 + b - m) Log[b] + Log[1 + 1/m] + 2 b Log[1 + 1/m] + 
      b^2 Log[1 + 1/m] + 2 m Log[1 + 1/m] - 2 b m Log[1 + 1/m] + 
      m^2 Log[1 + 1/m] - b Log[1 + m] - b^2 Log[1 + m] + 
      b m Log[1 + m])/(b^2 - 2 b (-1 + m) + (1 + m)^2)),
     (-1 < Im[Sqrt[m]] < 1 || Re[Sqrt[m]] > 0) && (Re[Sqrt[-m]] < 1 || 
    Sqrt[-m] \[NotElement] Reals) && Re[Sqrt[b]] > 0 && Re[m] > 0]

So it would seem that you could be successful in getting a general solution with a change in variable with a = p u. (And note that I changed m^2 to m and b^2 to b. Mathematica still gives a solution when p = 1 but it's a bit less messy with the squares removed. But I don't think that really changes anything with respect to getting a general solution.)

POSTED BY: Jim Baldwin
Posted 9 years ago

Thanks. At some point q must have been defined to be zero which is why you see

integration result

This means that when you write

Integrate[a/(a^2 + b^2)^2 Log[(a + q)^2 + m^2], {a, 0, Infinity}]

you are really evaluating this with q = 0 which gives you the definite result that you see.

ConditionalExpression[(b^2 Log[b^2] - m^2 Log[m^2])/(2 b^4 - 2 b^2 m^2), Re[b] != 0]

If you try running all equations with a fresh session, you will find that none will have been evaluated to a closed-form solution. (And I would suggest that avoiding subscripts unless absolutely necessary. Use q1 instead of Subscript[q, 1].)

POSTED BY: Jim Baldwin

Yes, here is a Notebook with 3 Integrals, two of them with just a difference in symbol ("q1" instead of "a"). Also (reply to another post) the Integrals are not all necessarily divergent, all variables are Real and greater than 0.

Attachments:
POSTED BY: Yaj Bhattacharya
Posted 9 years ago

Would you attach a notebook with both equations (or use the Code Sample option) so that the equation is more readable and more immediately accessible for us to try in Mathematica?

POSTED BY: Jim Baldwin

Is there such a drastic difference between Mathematica 10.0 and 10.1? The second integral yields

ConditionalExpression $[(b^2 Log[b^2] - m^2 Log[m^2])/(2 b^4 - 2 b^2 m^2)$, $Re[b] != 0]$

whereas the first one goes unsolved?

POSTED BY: Yaj Bhattacharya

With Mathematica 10.1 both integrals return non convergent, which seems to be correct.

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

Group Abstract Group Abstract