Answer:
T - M g - Ff = M a describes the acceleration of the object
T = M g + Ff if the object moves at constant speed (a = zero)
Ff = μ M g = .3 * 40 * 9.8 = 118 N the force of friction
Ff will be in a direction opposite to the motion
M g = 40 kg * 9.8 m/s = 392 N
a) T = M g + Ff for an object moving upwards
T = 392 + 118 = 510 N
b) T = M g - Ff for an object moving downwards
T = 392 - 118 = 274 N