[Math] Find average distance from line to disk

calculusintegration

I need to solve the following problem, given in my book.

Calculus A complete course 9th – Robert A Adams

14.4 25.

"Find the average distance from points in the quarter disk
$ x^2 + y^2 \leq a^2 \ , \, x \geq 0 \ , \ y \geq 0, \,$ to the line $x + y = 0$.

I tried drawing an image as shown below

y = -x

My friend says that the solution can be found by solving

$$ \large \int_0^a \int_0^\sqrt{a^2-x^2} \frac{x+y}{\sqrt{2}} \,\mathrm{d}x \, \mathrm{d}y $$

But I can not really see why this double integral works, it looks like we are always integrating the distance from $0$ to $a$. But in my eyes the distance changes.

I guess I need to find a line perpendicular to $y = -x$ and find the distance, but could anyone help me out? I've been sitting a few hours with this problem now =(

Best Answer

Let $D(x,y)$ be the distance from the point $(x,y)$ to our line. Call the quarter-disk $Q$. We calculate $$\iint_Q D(x,y) \,dA$$ and divide the result by the area of $Q$. Because of the symmetry, it seems best to use polar coordinates. But it would be worthwhile to compute using rectangular coordinates, and compare.

Suppose that point $P$ in our quarter-disk has polar coordinates $(r,\theta)$. Join the origin to $P$, and drop a perpendicular from $P$ to our line. The picture shows that the distance from $P$ to our line is $r\sin(\theta+\pi/4)$. So we want $$\iint_Q r^2 \sin(\theta+\pi/4)\,dr\,d\theta.$$

Remark: Add to your picture the point $P$, join it to the origin, and drop a perpendicular as suggested above. You will see from basic trigonometry that the distance from $P$ to the line $x+y=0$ is $r\sin(\theta+\pi/4)$. Then by the Addition Law for the sine function, $$r\sin(\theta+\pi/4)=r\sin(\pi/4)\cos\theta+r\cos(\pi/4)\sin \theta= \frac{1}{\sqrt{2}} \left(r\cos\theta+r\sin\theta\right)=\frac{1}{\sqrt{2}}(x+y).$$ This gives an explanation different from the Linear Algebra formula for the fact that the distance from $(x,y)$ to the line is $\frac{x+y}{\sqrt{2}}$.