Finding conditional expectation: $\mathrm{E}(aX + b | cX + d < eY + g)$ I'm trying to obtain a formula for the following object, without imposing any distributional assumptions:
$$
E(aX + b | cX + d < eY + g)
$$
Obviously by linearity of $E$, $\ aE(X| \frac{eY + g - b}{a}) + b$, given c > 0.
I've derived this, is it correct?:
$$
= a\int^\infty_{-\infty} \int^\infty_\frac{eY + g - b}{a} X \frac{f_{x,y}}{f_y}dx dy + b
$$
If so, why have I found the following similar formula elsewhere - is this when the two variables $X, Y$ are independent?
$$
a\frac{1}{P(cX + d < eY + g)} \int^\infty_\frac{eY + g - b}{a} X f(x) dx + b
$$
 A: Provided $e^2+c^2\ne 0,$ the event $cX + d \lt eY + g$ defines a half plane.  (When $e^2+c^2=0,$ this event is either empty or universal, giving trivial answers.)
This suggests we can simplify the problem with a change of coordinates.  To this end, define a new random variable
$$U = cX + (-e)Y + (d-g)$$
so that the conditioning event is $U \lt 0.$
The expectation is a linear function of $X,$ which now needs to be expressed in terms of $U$ and another variable.  A nice choice (among many) would be a variable orthogonal to $U,$ such as
$$V = eX + cY.$$
We may solve for $aX+b$ in terms of $U$ and $V,$ giving
$$aX + b = \frac{a}{c^2+e^2}\left(c(U + g-d) + eV\right)+b = \alpha U + \beta V + \gamma$$
where
$$\alpha = \frac{ac}{c^2+e^2},\quad \beta = \frac{ae}{c^2+e^2},\quad \gamma = \frac{a(g-d)}{c^2+e^2}+b.$$
As a result, the conditional expectation has been re-expressed as

$$\eqalign{ E(aX + b\mid cX + d \lt eY + g) &= E(\alpha U + \beta V +
\gamma \mid U \lt 0) \\ &= \alpha E(U\mid U \lt 0) + \beta E(V \mid U\lt 0) + \gamma }$$

This is as far as one can go towards simplification in general, but the following remarks may be of some use.


*

*To find these expectations you might need to find the joint distribution of $(U,V).$  When $(X,Y)$ has a density $f_{X,Y},$ $(U,V)$ will also have a density and can be expressed in terms  of $f_{X,Y}$ and the Jacobian of the transformation, equal to $c^2+e^2.$

*The only bivariate calculation is the second term, $E(V\mid U \lt 0).$  In terms of $f_{U,V}$ that's a relatively simple integral conceptually (assuming $\Pr(U\lt 0)\ne 0$), given by $$E(V\mid U \lt 0) = \frac{1}{\Pr(U \lt 0)}\int_{-\infty}^0\left(\int_{-\infty}^{\infty} v\,f_{U,V}(u,v)\,\mathrm{d}v\right)\mathrm{d}u.$$  This is recognizable as an integration of conditional expectations over all negative $u$--and that can be convenient, because often regression methods provide explicit formulas for conditional expectations.  (E.g., in the bivariate Normal case the conditional expectation is a linear function of $u.$)
A: Use $E(Z|A)=\frac{E(Z1_A)}{P(A)}$
#Conditional_expectation_with_respect_to_an_event
So without any assumption about distribution of $(X,Y)$,By defining $A=\{ cX + d < eY + g\}$  we have
$$E(aX + b | cX + d < eY + g)=E(aX + b | A)=a E(X  | A)+b=a\frac{E(X 1_A)}{P(A)} +b=a\frac{E(X 1_A)}{P(cX + d < eY + g)} +b$$
$$a\frac{\int_{\{\omega \in \Omega\mid cX(\omega) + d < eY(\omega) + g \}}X \, dP}{P(cX + d < eY + g)} +b$$
