The angular acceleration of the pulley a = (2g - 2a_m) / (M + m) since the a hanging mass m is attached to a string.
(downward force - upward force = mass * acceleration)
The torque (τ) acting on the pulley due to the tension force (T) causes it to rotate with angular acceleration
(a): τ = I * a
Substitute the torque expression for the pulley into the second equation: T * r = (1/2) * Mr² * a
T = mg - ma_m
We then Substitute this expression for T in the pulley equation:
(mg - ma_m) * r = (1/2) * Mr² * a
a = (2g - 2a_m) / (M + m)
The equation above gives the angular acceleration of the pulley (a) in terms of the mass of the mass (m), the mass of the pulley (M), the gravitational acceleration (g), and the acceleration of the mass.