1
$\begingroup$

I have a integral and I use two different symbols in an interchangeable way, but I do not get same expressions when I swap them. Can some one explain why?

Integrate[1/Sqrt[(x - t) (y - t)], {t, 0, y}, Assumptions -> 0 < y < x]
Log[(x + y + 2 Sqrt[x y])/(x - y)]
Integrate[1/Sqrt[(x - t) (y - t)], {t, 0, x}, Assumptions -> 0 < x < y]
2 ArcTanh[Sqrt[x/y]]
$\endgroup$
  • 1
    $\begingroup$ Please post code, not images $\endgroup$ – Dr. belisarius Sep 24 '15 at 14:02
  • $\begingroup$ Actually the two results differ by the constant I π and integration results can always differ by a constant. $\endgroup$ – m_goldberg Sep 24 '15 at 17:01
  • 1
    $\begingroup$ @m-goldberg, how can integration results always differ by a constant if you specify the range of integration? $\endgroup$ – xjtan Sep 24 '15 at 17:19
2
$\begingroup$

I assume it has something to do with how the Groebner basis is applied for the reduction (i.e. simplification) of the expressions. We can see that the observed behavior holds for other variables with the same alphabetical order of their symbols names.

In[150]:= Integrate[1/Sqrt[(a - t)*(y - t)], {t, 0, y}, 
 Assumptions -> 0 < y < a]

Out[150]= Log[(a + y + 2*Sqrt[a*y])/(a - y)]

In[149]:= Integrate[1/Sqrt[(a - t)*(b - t)], {t, 0, a}, 
 Assumptions -> 0 < a < b]

Out[149]= 2*ArcTanh[Sqrt[a/b]]

In[148]:= Integrate[1/Sqrt[(c - t)*(b - t)], {t, 0, c}, 
 Assumptions -> 0 < c < b]

Out[148]= Log[(b + c + 2*Sqrt[b*c])/(b - c)]
$\endgroup$
  • 2
    $\begingroup$ I'd be surprised if GroebnerBasis is used in any way in these simplifications. There are no equations in sight, just inequalities. $\endgroup$ – Daniel Lichtblau Sep 24 '15 at 19:26
  • $\begingroup$ I assumed that Groebner basis usage might explain the lexicographical dependency of the results... $\endgroup$ – Anton Antonov Sep 24 '15 at 21:57
1
$\begingroup$

The two evaluate to the same values.

f = 1/Sqrt[(x - t)*(y - t)];
v1 = Integrate[f, {t, 0, y}, Assumptions -> {0 < y < x}]

(* Log[(x + y + 2 Sqrt[x y])/(x - y)] *)

v2 = Integrate[f, {t, 0, x}, Assumptions -> {0 < x < y}]

(* 2 ArcTanh[Sqrt[x/y]] *)

v3 = v2 /. {y -> x, x -> y}
g = v1/v3;
Table[g /. {x -> 10}, {y, 1, 9, 1}] // N

(* {1., 1., 1., 1., 1., 1., 1., 1., 1.} *)
$\endgroup$
  • 1
    $\begingroup$ This is probably better demonstrated with the code: FullSimplify[(Log[(x + y + 2*Sqrt[x*y])/(x - y)] /. {y -> x, x -> y}) - 2*ArcTanh[Sqrt[x/y]], Assumptions -> 0 < x < y] $\endgroup$ – Anton Antonov Sep 24 '15 at 14:29
  • $\begingroup$ I feel like the question is more to do with why the different results for expressions which are all but lexicographically equivalent. $\endgroup$ – IPoiler Sep 24 '15 at 14:40
  • $\begingroup$ Actually the two results differ by the constant I π $\endgroup$ – m_goldberg Sep 24 '15 at 15:12
  • $\begingroup$ @m_goldberg, I noticed that too but realized it was only for x=y=0 which is outside the range of assumptions. Were you noticing that somewhere else within the assumption constraints? $\endgroup$ – IPoiler Sep 24 '15 at 16:41
  • $\begingroup$ @It'sPronouncedOiler. Oops! Posted in wrong place. Should have posted my observation as a comment to the main question. Thanks for the tip. $\endgroup$ – m_goldberg Sep 24 '15 at 17:04
1
$\begingroup$

This is a partial answer.

One gets a different answer depending upon the alphabetical order of the symbols used.

All that is done below is to swap one symbol for another.

Starting with the first expression.

Integrate[1/Sqrt[(x - t) (y - t)], {t, 0, y}, Assumptions -> 0 < y < x]

Log[(x + y + 2 Sqrt[x y])/(x - y)]

Swap a for x

Integrate[1/Sqrt[(a - t) (y - t)], {t, 0, y},  Assumptions -> 0 < y < a]

Log[(a + y + 2 Sqrt[a y])/(a - y)]

Swap b for y

Integrate[1/Sqrt[(a - t) (b - t)], {t, 0, b}, Assumptions -> 0 < b < a]

Log[(a + b + 2 Sqrt[a b])/(a - b)]

Now swap y for a

Integrate[1/Sqrt[(y - t) (b - t)], {t, 0, b}, Assumptions -> 0 < b < y]

2 ArcTanh[Sqrt[b/y]]

This appears to be a different answer.

Test the two expressions

Based upon Asim's result let's check if the two answers are equivalent.

FullSimplify[Log[(x + y + 2 Sqrt[x y])/(x - y)] - 2 ArcTanh[Sqrt[y/x]], 
 Assumptions -> x > y > 0]

The answer is 0 indicating that they are indeed equivalent with the given assumptions.

We are left with the interesting question as to why we get two different, but equivalent, expressions when we merely swap the symbols.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.