# Double Integral application

1. Apr 9, 2006

### Stevecgz

Question:
At airports, departure gates are often lined up in a terminal like points along a line. If you arrive at one gate and proceed to another gate for a connecting flight, what proportion of the length of the terminal will you have to walk, on average?

One way to model this situation is to randomly choose two numbers, 0 <= x <= 1 and 0 <= y <= 1; and calculate the average value of |x - y|. Use a double integral to find the average distance you have to walk.

What I've done:
I approached this by trying finding the average value of |x - y| using a double integral with f(x,y) = |x - y|, D = {(x,y)|0 <= x <= 1, 0 <= y <= 1}. When I solve this integral I get a value of zero. This intuitively makes sense since the average distance in the positive direction will equal the average distance in the negative direction, but it doesn't help me answer the question. I think my problem is that I am not treating the absolute value correctly. So my question is how do I treat the absolute value signs when solving this (or any other) integral?

Thanks,
Steve

2. Apr 9, 2006

### Physics Monkey

Hi Steve,

You are right to suspect that you aren't treating the absolute value right. The expression $$|x-y|$$ is always positive, so when you integrate it you can't get zero. Try breaking the integration up into two regions where x-y is either positive or negative. This will enable you to treat the absolute value in a simple way.

3. Apr 9, 2006

### Stevecgz

Thanks for the reply Physics Monkey,

Since |x - y| is negative above the line y = x, I set up the following integral:

$$\int_{0}^{1}\int_{x}^{1} -(x - y) dydx + \int_{0}^{1}\int_{0}^{x} (x - y) dydx$$

When I evaluate the integral I get a value of 1/6, which seems reasonable for the question. Am I going about this correctly? Thanks.

4. Apr 10, 2006

### Stevecgz

Evaluating the integral again I see the value is actually 1/3, not 1/6.