Hanging Particle Connected by a Pulley to a Particle on a Table

I will find the acceleration and tension in terms of

Resolving vertically for (1)

Apply F=ma to both particles - for (2)

Substituting (1) into (2) gives (3)

Applyingto (4)

(3)+(4) gives

Substitute this into (3) to give