Message Boards Message Boards

0
|
5295 Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Confused by different results when evaluating supposed equivalent integrals

So I want to calculate a distribution function from a density function. The density function is as follows: $$ f(w,z)=\frac{2w}{z}\text{ if 0<wz<1, 0<w<z} $$ To find the distribution, I tried integrating using the following expression:

Assuming[0 < y && 0 < w < 1 && 0<z, Integrate[(2 y/x) Boole[0< y < x < 1/y], {y, 0, w}, {x, 0, z}]]

A friend of mine with the same assignment told me he was getting a different result, so I tried tweaking the expression. To my surprise, an expression which I think is equivalent gives me a very different result. This is the expression in question:

Assuming[ 0<y && 0 < w < 1 && 0<z, Integrate[(2 y/x) Boole[(0 < xy < 1)&&(0<y<x)], {y, 0, w}, {x, 0, z}]]

As you can see, the only change has been to the contour conditions. What is going on here?

POSTED BY: Jaime Sevilla
6 Replies

Try FullSimplify[...] on both forms. You get almost identical results.

POSTED BY: S M Blinder

That's basic Mathematica syntax. If I write "xy", without space, this is interpreted as one single symbol, not as the implicit product of two distinct symbols "x" and "y". It is a very common pitfall for beginners, and occasionally for expert users too.

POSTED BY: Gianluca Gorni

Great, thank you!

POSTED BY: Jaime Sevilla

If I replace 0 < xy < 1 with 0 < x y < 1 in the second integral I get the same answer.

POSTED BY: Gianluca Gorni

That's an important insight. Does anyone know why Mathematica parses "xy" differently from "x y"?

POSTED BY: Jaime Sevilla

Mathematica is a language implementation and, as such, follows certain rules regarding parsing of symbols (which can be multiletter). If you had prior experience with Wolfram|Alpha, that uses various heuristics to decide when to regard an entity such as 'xy' as a single thing, or as "x times y". That is to say, it's more of a mind reader.

POSTED BY: Daniel Lichtblau
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