Finding $c$ such that the average distance from $y(x)=c$ to the origin is $d$ - is there an easier way than mine?

37 Views Asked by At

I would like to find $c$ such that the average distance from points on the graph $y(x)=c$ to the origin is $d$, when $x\in[0,x_f]$, as the figure illustrates:

enter image description here

I think my solution is correct, however I had to use a probability distribution for $x$ (see below), but I suspect this wouldn't be necessary for a geometry problem.

Is there a simpler, more geometrically intuitive way of solving this problem?


My solution:

The average is given as

$$\langle f(x) \rangle=\int_{-\infty}^\infty f(x)p(x)dx$$ and here

\begin{align} f(x)&=\sqrt{x^2+y^2} \\ x_f&=c\tan \gamma_f \\ p(x)&=\cases{\frac{1}{x_f} \quad 0\leq x <x_f \\ 0 \quad \;\; \text{otherwise}} \end{align} Making the substitution $x\rightarrow \gamma'$, where $x=c \tan \gamma'$, the average distance becomes \begin{align} d&=\int_0^{x_f}\frac{\sqrt{x^2+y^2}}{x_f}dx \\ &=\frac{c}{\tan \gamma_f}\int_0^{\gamma_f} \sec^3 \gamma' d\gamma' \end{align}

Dropping the $f$ in $\gamma_f$, this evaluates to

\begin{align} d&=\frac{c}{2}\left(\sec \gamma +\cot \gamma \ln \left(1+\frac{2}{\cot \gamma/2 -1} \right) \right) \Rightarrow \\ c&=\frac{2d}{\sec \gamma +\cot \gamma \ln \left(1+\frac{2}{\cot \gamma/2 -1} \right)} \end{align}

Here it is plotted:

enter image description here