The joint probability density function for random variables $X$, $Y$ is given by $$f(x, y)=\begin{cases} 2xy & \text{if } 0\leq x\leq 2y\leq 2 \\ 0 & \text{otherwise} & \end{cases}.$$ When the conditional expectation of $X$ is $E(Y | X=aY)=\frac{3}{10}$, what is the real number $a(>1/2)$?
My first solution is $$f(y \mid x=ay)=\frac{f(ay, y)}{f_{x}(ay)}=\frac{2ay^2}{\int_{0}^{\frac{1}{a}}2ay^2 dy}=3a^3y^2$$ $$\frac{3}{10}=E(Y\mid X=aY)=\int_{0}^{\frac{1}{a}} 3a^3y^3 dy=\frac{3}{4a} \Rightarrow a=\frac{5}{2}\,.$$
My second solution is
Let $Z=\frac{X}{Y}, \; W=Y$. Then, $X=YZ, \: \: Y=W, \;$, the Jacobian is $W$ and $g(z,w)=f(wz, w)w=2zw^3 \; (\frac{1}{2}\leq z\leq \frac{1}{w}, \; 0\leq w\leq 2)$ $$g(w \mid z=a)=\frac{g(a, w)}{g_{Z}(a)}=\frac{2aw^3}{\int_{0}^{\frac{1}{a}}2aw^3 dw}=4a^4w^3$$ $$\frac{3}{10}=E(W\mid Z=a)=\int_{0}^{\frac{1}{a}} 4a^4w^4 dw=\frac{4}{5a} \Rightarrow a=\frac{8}{3}\,.$$
Why do I get two different values of $a$?