<s>[INST] Distribution of $X+\frac{2}{X}$ when $X\sim\mathcal U(1,2)$ I have the following question:
If $X$ is a continuous random variable that is uniformly distributed on the interval $(1,2)$ what is the distribution function of $Y=X+\frac{2}{X}?$\
I have tried to calculate the inverse of the function $f(x)=x+\frac{2}{x}$ but didn't manage to complete the calculation. Any ideas?
 [/INST] The function $x\mapsto x + \frac 2 x$ has a minimum point at $x=\sqrt 2,$ which is within the interval $(1,2),$ so it doesn't have an inverse on that interval. That makes things a bit more complicated. One thing that will make things simpler is that when $x={}$either $1$ or $2$ then $x+ \frac 2 x=3,$ i.e. it's the same at both endpoints.
Let $y = x+ \frac 2 x.$ Then $xy = x^2 + 2,$ or $x^2 - yx + 2 = 0,$ and that is a quadratic equation that can be solved for $x{:}$
$$
x = \frac {y \pm \sqrt{y^2 - 8}} 2.
$$
Since $x\mapsto x+ \frac 2 x$ is a curve that opens upward, you have $y\le{}$some specified number if $x$ is between two numbers.
Thus $Y\le y$ precisely if $\dfrac {y - \sqrt{y^2-8}} 2\le X\le\dfrac{y+\sqrt{y^2-8}} 2.$
The probability assoicated with that interval is the difference -- the larger one minus the smaller one. Thus the probability is $\sqrt{y^2-8}.$
This works for $2\sqrt 2 \le y\le 3,$ since those are the smallest and biggest values of $y$ when $1<x<2.$
</s>