How to show that $E(X\mid X>y) = \frac{\int_y^\infty x g(x) dx}{1 - F(y)} $ for the truncated expectation of a random variable? I would like to show that if $X$ has pdf $f(x)$ and cdf $F(x)$, then the expectation of $X$ conditional on $X$ being greater than some value $y$ is given on wikipedia as:
$$
E(X\mid X>y) = \frac{\int_y^\infty x g(x) \, dx}{1 - F(y)} 
$$
I am wondering how to derive this directly. I have the following:
$$
E(X\mid X>y) = \int_{-\infty}^{-\infty} x f(x\mid X>y) \, dy
$$
However, I am not sure how to take care of the $x>y$ part in $f(x\mid X>y)$. It should be:
$$
f(x\mid X>y) = \frac{f(x,X>y)}{f(x>y)}
$$
But this doesn't make sense as a probability statement. Am I supposed to use indicators here?
 A: Let the CDF of $X$ conditioned on $X > y$ be $F(X\mid X > y)$. We have for any $x > y$ that
$$
F(X < x \mid X > y) = \frac{F(y < X < x)}{F(X > y)} = \frac{F(x) - F(y)}{1 - F(y)}
$$
Then
$$
f(X\mid X > y) = F'(X < x \mid X > y) = (\frac{F(x) - F(y)}{1 - F(y)})' = \frac{f(x)}{1 - F(y)}
$$
for $x > y$.
A: 
However, I am not sure how to take care of the $x>y$ part in $f(x|x>y)$. It should be:  $$f(x|x>y) = \frac{f(x,x>y)}{f(x>y)}$$

Capitalisation is not optional.   The meaning attached to these letters is case sensitive.   $X$ is a random variable, and $x$ and $y$ are values it may realise.
So, applying Bayes' Rule to mixed probability density and mass functions:
$$\begin{align}f_X(x\mid X>y) ~&=~ \frac{f_X(x)\,\mathsf P(X>y\mid X=x)}{\mathsf P(X>y)} \\[1ex] &=~ \frac{f_X(x)~\mathbf 1_{x>y}}{1-F_X(y)}\end{align}$$

Additionally if $g(\;)$ is the given probability density function of $X$ we  should not be suddenly using $f(\;)$ for that ... unless $g$ was a typo.   So, anyway, using the original letters:
$$g(x\mid X>y) ~=~ \dfrac {g(x)~\mathbf 1_{x>y}}{1-F(y)}$$
A: First we have
$$
\operatorname{E}(X\mid X>y) = \int_{-\infty}^\infty x f_{X>y}(x)\,dx.
$$
After that it is enough to show that
$$
f_{X>y}(x) = \begin{cases} \dfrac{f_X(x)}{\Pr(X>y)} & \text{if } x>y, \\[8pt] 0 & \text{otherwise}. \end{cases}
$$
To show that, it is enought to show that for every measurable set $A$ of real numbers we have
$$
\Pr(X\in A\mid X>y) = \int_{\large A \,\cap\, (y,\infty)} \frac{f_X(x)}{\Pr(X>y)} \, dx. \tag a
$$
We know that
$$
\underbrace{ \Pr(X\in A\mid X>y) = \frac{\Pr(X\in A\cap (y,\infty)) }{\Pr(X>y)} }_\text{definition of conditional probability}\  \underbrace{ = \frac{ \displaystyle \int_{\large A \,\cap\, (y,\infty)} f_X(x)\,dx }{\Pr(X>y)} }_\text{definition of density}
$$
and that last fraction is clearly equal to $(\textbf{a}).$
