The question states:

A 5.2 kg box is on a frictionless 36 degree slope and is connected via a massless string over a massless, frictionless pulley to a hanging 2.1 kg weight. What is the tension in the string if the 5.2 kg box is held in place, so that it cannot move?

I summed the forces in the x direction for the 5.2 kg block:

F(net)= T - Mg sin(36)=0

and the forces in the y for the 2.1 block

F(net) = T - mg = 0

solving for T in the 1st equation gives me T=29 while solving for T in the other gives me 20.5 which is the answer. Why didn't the both give me the same T?

The reason you obtained different tensions for the two calculations is because you made an assumption that resulted in an incorrect solution when applying Newton's laws.

In your first calculation where you considered the forces in the x-direction for the 5.2 kg block, you correctly identified the forces acting on the block as the tension (T) and the component of gravity (Mg) parallel to the slope (Mg sin(36)). You then set the net force equal to zero and solved for T. However, there is a mistake in your assumption.

The assumption you made is that the block is held in place and thus there is no motion in the x-direction. Therefore, you concluded that the net force in the x-direction is zero. However, this is not correct. If the block is held in place, there is still the force of tension acting on it, which is causing it to be held in place.

To correctly analyze the forces in the x-direction for the 5.2 kg block, you should consider that there is a non-zero net force acting on it. The correct equation should be:

F(net) = T - Mg sin(36) = ma

Since the block is not moving (i.e., a = 0), the net force should also be zero. Therefore:

T - Mg sin(36) = 0

Solving this equation, you will find the correct tension for the held block, which should be equal to T = Mg sin(36).

On the other hand, for the 2.1 kg hanging weight, your calculation appears to be correct:

F(net) = T - mg = 0

Solving this equation, you rightly obtained T = mg, which equals 20.5 N.

Thus, the correct tension in the string when the 5.2 kg box is held in place is 20.5 N.