Let $ X\in\mathcal U[1,2]$. Find the density of a random variable $Y=\ln X,X>0$.
Attempt:
Uniform distribution, $f(x)=\frac{1}{b-a},x\in [a,b]\Rightarrow$
$$ f(x) = \begin{cases} 1, & x\in [1,2] \\ 0, & \text{else} \end{cases}$$
How to evaluate $F_X(x)$?
I have the following solution:
$$F_X(x) = \begin{cases} 0, & x<1 \\ x-1, & 1\le x\le 2 \\ 1,& x>2 \end{cases}$$
We have, $$F_Y(t)=P\{\ln X\le t\}=P\{X\le e^t\}=F_X(e^t)$$
How to decide cases for $t$? I have the following solution,
$1.$ $e^t<1,t<0\Rightarrow F_Y(t)=0$
$2.$ $1\le e^t\le 2, 0\le t\le \ln 2\Rightarrow F_Y(t)=e^t-1$
$3.$ $e^t>2, t>\ln 2\Rightarrow F_Y(t)=1$
$$F_Y(t)=\begin{cases} 0, & t<0 \\ e^t-1, & 0\le t\le \ln 2 \\ 1,& t>\ln 2 \end{cases}\Rightarrow f_Y(t)=\begin{cases} e^t, & t\in [0,\ln 2] \\ 0, & \text{else} \end{cases}$$
Could someone explain this in details (detailed procedure)?
It is just a matter of following the pieces of the function you have been given.
You have been given that $f_X(x)=\begin{cases} 1&:& x\in [1;2]\\0 &:& x\in(-\infty;1)\cup(2;\infty)\end{cases}$
By definition the CDF is $F_X(x) =\int_{-\infty}^x f_X(s)\operatorname d s$
Then clearly the pieces of interest are when $x$ is below, within, or above $[1;2]$.
$$\begin{align}F_X(x) ~&=~ {\begin{cases}\int_{-\infty}^x 0\operatorname d s&:& x\in(-\infty;1)\\ \int_{-\infty}^1 0\operatorname d s+{\int^x_1} 1\operatorname d s &:& x\in[1;2]\\ \int_{-\infty}^1 0\operatorname d s+{\int_1^2} 1\operatorname d s+\int_2^x 0\operatorname d s &:& x\in(2;\infty)\end{cases}} \\[2ex] &=~{\begin{cases}0&:& x\in(-\infty;1)\\ (x-1) &:& x\in[1;2]\\ 1 &:& x\in(2;\infty)\end{cases}}\end{align}$$
Note: as it is the Cumulative Distribution Function, you accumulate the distribution from earlier pieces.
Now you have $F_Y(t)=F_X(e^t)$ and the above CDF. Then by replacement: $$\begin{align}F_Y(t) ~&=~{\begin{cases}0&:& e^t\in(-\infty;1)\\ (e^t-1) &:& e^t\in[1;2]\\ 1 &:& e^t\in(2;\infty)\end{cases}}\\[1ex]&=~{\begin{cases}0&:& t\in(-\infty;0)\\ (e^t-1) &:& t\in[0;\ln 2]\\ 1 &:& t\in(\ln 2;\infty)\end{cases}}\end{align}$$
Finally by differentiation $$\begin{align}f_Y(t) ~&=~ \begin{cases} \dfrac{\mathrm d 0}{\mathrm d t} &:& t\in(-\infty;0)\\ \dfrac{\mathrm d e^t}{\mathrm d t} &:& t\in[0;\ln 2]\\ \dfrac{\mathrm d 1}{\mathrm d t} &:& t\in(\ln 2;\infty)\end{cases}\\[1ex]&=~ \begin{cases} e^t &:& t\in[0;\ln 2]\\ 0 &:& t\in(-\infty;0)\cup(\ln 2;\infty)\end{cases}\end{align}$$
Addendum: Later you shall learn the Jacobian Transform: $f_Y(y)= \begin{Vmatrix}\dfrac{\partial e^t}{\partial t}\end{Vmatrix}f_X(e^t)$, which allows you to reach the above result in many fewer and easier steps.