The acceleration of the first block in terms of the first block and the gravity g is

How to determine the acceleration of the first block
From the question, we have the following parameters that can be used in our computation:
The figure
Where, we have the frictionless pulley with a negligble mass
The direction of the acceleration is towards the mass m2 i.e. downward
So, we have the following equations


Where
T is the tension in the pulley
By substitution, we have

This gives

Factor out a from the left hand side

So, we have

Hence, the acceleration of the first block is
