What's wrong with this conditional probability working?

A past exam paper for my course (BSc Mathematics, second-year module in statistical inference and modelling, unpublished) has a question,

Let $$(X,Y)^T$$ be a bivariate random variable with joint probability density function $$f_{X,Y}(x,y) = \begin{cases} \frac{1}{5}(x+2y) && \text{if }x\in[0,1],\;y\in[0,2], \\ 0 && \text{otherwise}. \end{cases}$$ Find $$\mathbb{E}(Y|X=x)$$ for $$x\in[0,1]$$.

So far I have the following working. \begin{align} & \begin{aligned} f_X(x) & = \int_{-\infty}^\infty f_{X,Y}(x,y) \; \text{d}y && (1) \\ & = \int_0^2 \frac{1}{5}(x+2y) \; \text{d}y && (2) \\ & = \left[\frac{1}{5}(xy+y^2)\right]_{y=0}^2 && (3) \\ & = \frac{1}{5}(2x+4) && (4) \end{aligned} \\ \therefore \; & \begin{aligned}[t] f_{Y|X=x}(y) & = \frac{f_{X,Y}(x,y)}{f_X(x)} && (5) \\ & = \frac{\frac{1}{5}(x+2y)}{\frac{1}{5}(2x+4)} && (6) \\ & = \frac{x+2y}{2x+4} && (7) \end{aligned} \end{align} which is not a function of only $$y$$. Could someone point out what I'm doing wrong?

• You calculated the conditional distribution of $Y$ given $X=x$ - it should depend on $x$ May 4, 2022 at 18:33
• @J.Delaney My course notes define conditional probability (in a bivariate context) as a function of a single variable, namely the one appearing before the "given" bar. Any idea why that might be?
– mjc
May 4, 2022 at 18:38
• You misunderstood something. Think about what "given $x$" means May 4, 2022 at 18:47
• @J.Delaney I understand it to mean "Fix an $x$, so that $x$ is no longer a variable".
– mjc
May 4, 2022 at 18:50
• Indeed if you will fix $x$ to some value (e.g. $x$=1) then your result will no longer depend on $x$ May 4, 2022 at 18:57