Checking if random variables $X_1$ and $X_2$ are independent with $\frac{2}{3}x_1 + \frac{4}{3}x_1 x_2 + \frac{2}{3}x_2 $ Let $X=(X_1,X_2)$ be an absolutely continuous random vector with the following density:
$$ f(x_1,x_2)=\begin{cases}
\frac{2}{3}x_1 + \frac{4}{3} x_1x_2 + \frac{2}{3}x_2 & \text{for} (x_1,x_2) \in [0,1]^2 \\
0 & \text{else}
\end{cases} $$
How can one find out if the random variables $X_1$ and $X_2$ are independent?
Intuitively, two random variables are independent if knowing the value of one of them does not change the probabilities of the other one
As far as I know, they are independent here iff
$$f(x_1,x_2) = f_{x_1}(x_1)f_{x_2}(x_2) , \forall (x_1,x_2) \in \mathbb{R^2}$$
I found an example on the internet. (See exercise 3)
Can I apply the same analogy here? Does that mean that I have to calculate this integral?
$$\int_{0}^{1} f(x_1,x_2)$$
 A: First remember that:

Suppose that $X_{1}$ and $X_{2}$ are  jointly continuous random variables such that $$f(x_{1},x_{2})=f_{1}(x_{1})\cdot f_{2}(x_{2}), \quad \forall (x_{1},x_{2})\in \mathbb{R}^{2},$$where $f_{1}$ and $f_{2}$ are density functions to $X_{1}$ and $X_{2}$ respectively and $f$ is the joint density function to $(X_{1},X_{2})$ and $$\forall i\in \{1,2\}:  \quad f_{i}(x)\geqslant 0$$and $$\int_{-\infty}^{+\infty}f_{i}(x){\rm d}x=1.$$
Hence, $X_{1}$ and $X_{2}$ are independent random variables.

Now, you know that $$f(x_1,x_2)=\begin{cases}
\frac{2}{3}x_1 + \frac{4}{3} x_1x_2 + \frac{2}{3}x_2, &  0\leqslant x_{1}\leqslant 1, 0\leqslant x_{2}\leqslant 1 \\
0, & \text{else}
\end{cases}$$
and
$$f_{1}(x_{1})=\begin{cases} \displaystyle \int_{-\infty}^{+\infty}f(x_{1},x_{2}){\rm d}x_{2}=\int_{0}^{1}f(x_{1},x_{2}){\rm d}x_{2}, &\quad 0\leqslant x_{1}\leqslant 1\\ \displaystyle  \int_{-\infty}^{+\infty}f(x_{1},x_{2}){\rm d}x_{2}=\int_{-\infty}^{+\infty}0{\rm d}x_{2}=0, &\quad \text{else}\end{cases}.$$
Similarly, $$f_{2}(x_{2})=\begin{cases} \displaystyle \int_{-\infty}^{+\infty}f(x_{1},x_{2}){\rm d}x_{1}=\int_{0}^{1}f(x_{1},x_{2}){\rm d}x_{1}, &\quad 0\leqslant x_{2}\leqslant 1\\ \displaystyle  \int_{-\infty}^{+\infty}f(x_{1},x_{2}){\rm d}x_{1}=\int_{-\infty}^{+\infty}0{\rm d}x_{1}=0, &\quad \text{else}\end{cases}.$$
I think that you can continue from here.
