Struggling with uncompensated/compensated demand I'm working on a problem set for my intermediate microeconomics course, but I'm having trouble deriving the compensated and uncompensated demand functions. This is the utility function:

$U(x, y, z) = aln(x) + bln(y) + z$, with goods $x$, $y$, $z$ and income $I$. I found the following optimal values:

$x = (P_z/P_x)a$, $y = (P_z/P_y)b$, $z = (I/P_z) - a - b$

Even though I followed the steps, I'm not completely sure this is right. Moreover, I have to find cross price effects and both the compensated and uncompensated demand functions, but I'm having some serious trouble solving this problem.
First, we want to find the optimal good baskets, ie how much to buy of goods $x$,$y$ and $z$ to get the maximum value of U out of it.

Let's write down the $MRS$ for $x$ and $y$ against $z$. For this we need to differentiate the utility function for each of the variables:
$d_xU(x,y,z)=a/x$ , $d_yU(x,y,z)=b/y$,$d_zU(z,y,z)=1$. We hence deduce the rates of substitution to be $-1a/x$ and $-b/y$ respectively.

So we have:
$p_x/p_z=a/x$ and $p_y/p_z=b/y$

The budget constraint is $p_xx+p_yy+p_zz=I$ which we rewrite
$p_x(ap_z/p_x)+p_y(bp_z/p_y)+p_zz=I$, which simplfies in
$ap_z+bp_z+zp_z=I$

$z^*=(I/p_z)-a-b$

$(x^*,y^*,z^*)=(ap_z/p_x, bp_z/p_y,(I/p_z)-a-b)$

Good news, you were right :).

The cross price effect is the rise of demand in good $x$ following a rise in the price of good $z$. Just calculate the difference between $x^*$ for $p_z$ and $x^*$ for $p_z'=p_z+\epsilon$ (using $x^*=ap_z/p_x$).

Finally, the six curves asked are how demand change when price change holding income ($I$) constant, or utility ($U$) constant. Draw same by taking two prices fixed for each situation.