Let $X=(X_1,X_2)$ be an absolute continues random vector with the density function
$f_X(x_1,x_2) = \left\{ \begin{array}{ll} \frac{2}{3}x_1+\frac{4}{3}x_1 x_2+\frac{2}{3}x_2, & \mbox{for } (x_1,x_2)\in[0,1]^2 \\ 0, & \mbox{otherwise } \end{array} \right.$
Check if $X_1$ and $X_2$ are independent.
So Two random variables X and Y are independent if and only if the elements of the π-system generated by them are independent. But how do I get $f_{X_1}$ and $f_{X_2}$ to test this with $f_{X_1,X_2}(x_1,x_2)=f_{X_1}(x_1)f_{X_2}(x_2).$
The marginal distributions of $X_1$ and $X_2$ can be obtained by "integrating out" the other variable. For instance, $$ f_{X_1}(x_1)=\int f_X(x_1,x_2)\;dx_2=\int_0^1\Big(\frac{2}{3}x_1+\frac{4}{3}x_1x_2+\frac{2}{3}x_2\Big)\;dx_2=\frac{4}{3}x_1+\frac{1}{3} $$ if $0\leq x_1\leq 1$.
The same argument shows that $f_{X_2}(x_2)=\frac{4}{3}x_2+\frac{1}{3}$ for $0\leq x_2\leq 1$, which then allows you to check whether $f_X(x_1,x_2)$ is equal to $f_{X_1}(x_1)f_{X_2}(x_2)$.