# Simple question about the definition of the conditional expectation

My book gives the following definitions for conditional expectation:

$E(g(X,Y)|Y=y) = \int_{-\infty}^{\infty} g(x,y)f_{X|Y}(x|y) \, dx$

And similarly for the discrete case. But then the exercise questions ask about things like

$E(X|X+Y=z)$

I feel like this hasn't been defined. I only have the definition for the conditional expectation given that $\{{Y=y}\}$, I don't know the definition for the conditional expectation given an arbitrary event (although I can guess what it should be, do I just replace $f_{X|Y}(x|y)$ with the density function of $X$ given the event $\{{X+Y=z}\}$?)

You can introduce a new random variable $Z = X + Y$. Now your problem is to evaluate $\mathbb{E}[X|Z = z]$, which should have been defined.