Answer:
![E[X |Y=y] = \int_{-\infty}^{\infty} x f_{X,Y} (x|y) dx](https://tex.z-dn.net/?f=%20E%5BX%20%7CY%3Dy%5D%20%3D%20%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%7D%20x%20f_%7BX%2CY%7D%20%28x%7Cy%29%20dx)
![E[X|Y=y] =\sum_{x} x f_{X,Y} (x|y)](https://tex.z-dn.net/?f=%20E%5BX%7CY%3Dy%5D%20%3D%5Csum_%7Bx%7D%20x%20f_%7BX%2CY%7D%20%28x%7Cy%29)
Step-by-step explanation:
For this case we assume that we have two random variable X and Y continuous, and we define the conditional density of X given Y like this:

Where
is the joint density function. And we can define the conditional probability like this:

In order to find the expected value of X given Y=y we just need to find this:
![E[X | Y=y] = \int_{-\infty}^{\infty} x f_{X,Y} (x|y) dx](https://tex.z-dn.net/?f=%20E%5BX%20%7C%20Y%3Dy%5D%20%3D%20%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%7D%20x%20f_%7BX%2CY%7D%20%28x%7Cy%29%20dx)
And if we assume that the random variable is discrete then the conditional expectation would be given by:
![E[X|Y=y] =\sum_{x} x f_{X,Y} (x|y)](https://tex.z-dn.net/?f=%20E%5BX%7CY%3Dy%5D%20%3D%5Csum_%7Bx%7D%20x%20f_%7BX%2CY%7D%20%28x%7Cy%29)
And as we can se just change the integral by a sum over the values defined for X, and with this we have the general formulas in order to find the conditional expectation of X given Y=y for the possible cases for a random variable.