I was reading Introduction to Probability, 2nd Edition, and the following question appears as exercise $18$ in the 8th chapter:
Swallowed Buffon's needle. A doctor is treating a patient who has accidentally swallowed a needle. The key factor in whether to operate on the patient is the length $\Theta$ of the needle, which is unknown, but is assumed to be uniformly distributed between 0 and $l > 0$.
We wish to form an estimate of $\Theta$ based on $X$, its projected length in an X-ray. We introduce a two-dimensional coordinate system and write: $$X = \Theta cosW$$ Where $W$ is the acute angle formed by the needle and one of the axes. We assume that $W$ is uniformaly distributed in the interval $[0, \pi/2]$, and is independent from $\Theta$.
(a) Find the LMS estimator $E[\Theta|X]$. in particular, derive $F_{X|\Theta}(x|\theta), f_{X|\Theta}(x|\theta), f_X(x), f_{\Theta|X}(\theta|X)$, and then compute $E[\Theta|X=x]$.
My solution goes as follows:
$$F_{X|\Theta}(x|\theta) = P(X \le x | \Theta=\theta)$$ $$ \qquad \qquad = P(\Theta cosW \le x | \Theta=\theta)$$ $$ \qquad \qquad = P(\theta cosW \le x)$$ $$ \qquad \qquad = P(cosW \le x/{\theta})$$ Since $W$ is uniformly in the range $[0, \pi/2]$, then $cosW$ is uniformly in the range $[0, 1]$, so: $$F_{X|\Theta}(x|\theta) = x/{\theta}$$ We differentiate with respect to$x$ to find that: $$f_{X|\Theta}(x|\theta) = 1/{\theta}$$
And: $$f_X(x) = \int_x^l d\theta/{\theta} = ln(l/x)$$
Using Bayes' rule we can find that: $$f_{\Theta|X}(\theta|x) = \frac1{\theta} ln^{-1}(l/x)$$
And: $$E[\Theta|X=x] = \int_x^l \theta f_{\Theta|X}(\theta|x) d\theta$$ $$\qquad \qquad = \int_x^l \theta ln^{-1}(l/x) d\theta$$ $$\qquad \qquad = \frac12(l^2-x^2) ln^{-1}(l/x)$$
But the answer of the solution manual of the book is: $$\frac{\sqrt{l^2-x^2}}{log\left( \frac{l+ \sqrt{l^2-x^2}}{x} \right)}$$
Which is quite messy, but in the end they mention that:
It is worth noting that $\lim_{x\rightarrow 0}E[\Theta|X=x] =0$ and that $\lim_{x\rightarrow l}E[\Theta|X=x] = l$, as one would expect.
My solution satifies this limits, but is it correct?