This set us is called Atwood Machine. You will find it solution in all standard textbooks. Solving this problem requires applying Newton's second law.
Step 1 : Illustrating the situation with a Free-Body Diagram
First draw a free body diagram illustrating the situation. Draw and label all the forces acting on the two masses and indicate the direction of the acceleration.
Step 2 : Applying Newton's Second Law.
Since the two masses are connected by means of a rigid string that moves through the pulley without slipping, the magnitude of their accelerations must be the same (
Since the masses are accelerating this a mechanical system that is not in equilibrium and so we must apply Newton's second law to calculate the acceleration.
Newton's Second Law :
Sign Convention : Since the motion of the two masses are only along the vertical direction we have a one-dimensional system. So the vectors have only one component and the direction is indicated by the sign of that component. Let us define the reference axis as pointing upward. So vectors pointing upward are positive and those that point downward are negative.
Mass 1 : Applying Newton's second law to the first mass,
Mass 1 : Applying Newton's second law to the second mass,
Step 3 : Solving The Equations.
There are two equations and two unknowns (