When to and when not to apply centrifugal force? I came across a problem in which a block was connected to a spring and the other end of the spring was fixed. It was released from horizontal position. We had to calculate the acceleration of the block when the spring is vertical. It was given that the spring elongates by 2 metre when in vertical position and the block weighs 1 kg.

I thought as the block was also performing circular motion about the point of suspension of the spring, so a centrifugal force will also be applied. So, I calculated the acceleration as follows:
$$ma= kx-mv^2/r-mg$$
But as per the solution, a centrifugal force isn’t supposed to be applied. But if instead of a spring , if there was a string, a centrifugal force would definitely be applied.
So I really need help with when to and when not to apply pseudo force.
Any help would be greatly appreciated!
 A: If you are working in a rotating reference frame you need to include a centrifugal force term. If you are working in an inertial reference frame then you do not include it.
This is true of any pseudo-force. They do not arise from the motion of the object; they arise from the acceleration of the reference frame.
To address another point, the spring will not maintain a constant length, so the mass will not undergo circular motion. A rotating reference frame is not ideal for analyzing this system, since the mass will not maintain a constant angular velocity relative to the pivot point.
In the case of the string you will have circular motion, but it will not be uniform circular motion. So I would say an inertial reference frame would still be ideal there as well.

As an aside, remember that acceleration is a vector quantity. You cannot just write out the force magnitudes acting on the object and then set their sum equal to $ma$. Newton's second law is a vector equation, so you need to be careful with how you set it up. First specify your coordinate system. Then break the forces into components. Then you can analyze the forces and acceleration for each component.
