We roll a fair die until a $5$ appears. What is the expected value of the minimum value rolled? 
Question: Given a fair dice, we roll until we get a $5.$ What is the expected value of the minimum value rolled?

Answer is $\frac{137}{60}.$
There is a similar question asked in MSE but I do not understand the method used by Henry. 
In particular, if we let $X$ be the minimum value rolled up to and including $5$, then 
$$E(X) = \sum_{x=1}^5 xP(X=x) = 1 \times \frac12 + 2 \times \frac16 + 3 \times \frac1{12}+4 \times \frac{1}{20}+5 \times \frac15 = \frac{137}{60}.$$
It seems that we are using the fact that 
$$P(X=x) = \frac{1}{x(x+1)}.$$

I do not understand how to obtain the equation above.


First, $X$ is not the minimum value rolled before obtaining a $5$, it is the minimum value rolled up to and including the first roll that comes up $5$, so that $X=5$ is possible.
The event $X=5$ means that $5$ comes up before any of $1$, $2$, $3$, or $4$ (we don't care about $6$). Since each of the five numbers is equally likely to come up first,
$$P(X=5)=\frac15.$$
Now suppose $1\le x\le4$. Now the event $X=x$ means that, among the $x+1$ numbers $1,\dots,x,5$, the number $x$ comes up first, and $5$ second. Thus we have
$$P(X=x)=\frac{(x-1)!}{(x+1)!}=\frac1{(x+1)x}\text{ for }1\le x\le4.$$
