Hi
I have a basic doubt regarding the derivation of the equation of a spring mass damper system.
Suppose a mass m is connected to a spring mass damper system
O is the equlibrium position of the body which is connected to a spring and damper on the left

L ------ O ----- R

x is positive towards R.

If the body is pulled by from O and released it oscillates. At the instant it is (between O and R) x away from O and moving towards R, the FBD gives
spring force = -kx towards L
damper force = -c v where v = dx/dt
inertia force = - m a

Using DAlembert's principle we get -kx -cv - ma = 0
Therefore ma + cv + kx = 0 --- (1)

----------------------------
NOW the doubt :
Suppose the FBD is drawn at the instant it is (between O and R) x away from O and moving TOWARDS L
spring force = -kx towards L
damper force = c v where v = - dx/dt
inertia force = m a

Using DAlembert's principle we get -kx + cv + ma = 0
Therefore ma + cv - kx = 0 --- (2)

But equation (2) is not equal to eqn (1)

I am unable to find out what is wrong here.

PLEASE HELP

TIA