Computing Expect Value of Two Random Variables Problem:
Suppose that we are given a random variables $x$ that is
uniformly distributed on the interval $[-1,1]$. We are also given
$y$ that is uniformly distributed on $[-1,3]$. Find the expected
value of $E(\frac{x}{y})$ assuming that $x$ and $y$ are independent.
Answer:
The distribution functions for $x$ and $y$ is:
\begin{eqnarray*}
f_x(x) &=& \frac{1}{2} \\
f_y(y) &=& \frac{1}{4} \\
\end{eqnarray*}
Now for the expected value.
\begin{eqnarray*}
E(\frac{x}{y}) &=& \int_{-1}^{1} \int_{-1}^{3} { \frac{x}{8y} } dy dx
    = \int_{-1}^{1}  \frac{x}{8} \ln{|y|} \Big|_{y = -1}^{ y = 3} dx \\
E(\frac{x}{y}) &=& \int_{-1}^{1} \frac{(\ln3)x}{8} dx \\
E(\frac{x}{y}) &=& 0 \\
\end{eqnarray*}
Is my solution correct? I am concerned that I have a problem because the function I am integrating is dividing by $0$ when $y = 0$.
Bob
 A: Your distribution functions are incorrect. Using your function, if we plug in $0$ to $f_x(x)$ we get $0$. This would imply that the probability of $x$ being less than $0$ is $0$, but with a uniform distribution on $[-1,1]$, it should be $1$, since "half" the values possible are below $0$.
You should instead get functions constant over the intervals where the random variables can hold values. See if you can figure them out. If not, comment and I will add something.
Also, I realize I didn't read the other parts of your answer very carefully. As Did points out you do not have a well-defined expected value. Unfortunately the manner in which you calculate the integral uses Fubini's theorem which does not apply, as he says, when the integral of the absolute value of each of the positive and negative parts of your function are infinite (which in this case, they are).
A: $f_X(x)= \tfrac 1 2~\mathbf 1_{-1\leq x\leq 1}$
$f_Y(y)= \tfrac 1 4~\mathbf 1_{-1\leq x\leq 3}$
$\mathsf E(X)=\int_{-1}^1\int_{-1}^3 \frac{x}{8y}\operatorname d y\operatorname dx$
But otherwise okay.
However, as your suspected, that one point does cause problems.   As Did points out, the existence of any $\mathsf E(Z)$ requires $\mathsf E(\lvert{Z}\rvert)$ to be finite.   So even though the above integral is zero, it is not the actual solution.
