# Slutsky equation with marshallian demand

We have marshallian demands for goods 1 and 2:

$$x_1^* = \frac{I}{2p_1}$$ and $$x_2^* = \frac{I}{2p_2}$$ where $$I$$ is income and $$p_i$$ is price.

We need to solve the slutsky equation for income effect and substitution effect as such:

$$\frac{D (x_i)}{D (p_j)} = \frac{D(H^i(p1, p2, i))}{ D(p_i)} - x_j*\frac{D(x_i^*)}{D(I)}$$

So in balance marshallian demand is the same as the compensated demand.

I solved the left hand side of equation and got a result of $$0$$.

Then I moved on to the income effect and got the following result:

$$-\frac{I}{2p_j}*\frac{1}{2p_i} = -\frac{I}{4p_jp_i}$$

Substituting the results from above in to the slutsky equation gives a positive result for substitution effect. I thought that that the substitution effect is always negative. Can anyone help me out?

The first term on the RHS of the Slutsky equation (as you write it) should be $$\frac{\partial h_i(p_i,p_j,I)}{\partial p_j}$$, not $$\frac{\partial h_i(p_i,p_j,I)}{\partial p_i}$$.
So your subsequent algebra is fine but you're conflating cross-price substitution with the own-price substitution: when you let $$i \neq j$$ in the Slutsky equation, the first term on the RHS $$\left(\text{again, }\frac{\partial h_i(p_i,p_j,I)}{\partial p_j}\right)$$ measures the cross-price substitution effect of an increase in the price of $$j$$ on the (compensated) demand of $$i$$. You found it to be positive, so goods $$i$$ and $$j$$ are net substitutes (the cross-price partials of $$h_i$$ and $$h_j$$ cannot be oppositely signed -- this follows from Shephard's Lemma).
If you let $$i = j$$, however, you will then find that the Slutsky equation implies that the own-price substitution effect is negative for both goods, which you correctly note should be negative:
\begin{align} \frac{\partial h_i(p_i,I)}{\partial p_i} &= \frac{\partial x_i}{\partial p_i} + x_i \frac{\partial x_i}{\partial I} \\ &= -\frac{I}{2p_i^2} + \frac{I}{2p_i} \left(\frac{1}{2p_i}\right) \\ &= -\frac{I}{4p_i^2} < 0. \end{align}