Forming equations for damped Simple Harmonic Motion

I have a question that says

"A Particle $$P$$ of mass $$m$$ kg is attached to one end of a spring. When the displacement of $$P$$ from its equilibrium poisition is $$x$$ metres, the magnitude of tension in the spring is $$4nx N$$ and the resistance force on P is $$5c\frac{dx}{dt}$$ Write a differential equation which models the motion of the particle.

My answer: $$m\frac{d^2x}{dt^2}=4nx-5c\frac{dx}{dt}$$ $$m\frac{d^2x}{dt^2}+5c\frac{dx}{dt}-4nx$$

The textbook answer: $$m\frac{d^2x}{dt^2}+5c\frac{dx}{dt}+4nx$$

I don't get why $$4nx$$ is positive? Wouldn't that require the resistant force to act in the same direction as the tension?

• The force is opposite to displacement. So in the first equation you should have the first term negative – Andrei May 21 at 21:12
• Oh. In that case, should my resistance be positive, as it is acting towards the equilibrium position? – Gab N. May 21 at 21:17
• no, the resistance oppose the direction of motion, not displacement. – user10354138 May 21 at 21:19

You need to get the signs correct. The elastic force is always in the opposite direction to displacement. The resistance is always opposite to the velocity. Let's suppose that the equilibrium is at $$x=0$$. When the object is at $$x=1$$, the elastic force is in the negative direction. But the object might be moving towards either right or left. If it's moving in the positive direction, the resistive force is in the negative direction. If the object is moving towards the origin, the resistive force is towards the positive direction
If we consider positive displacement, we want the tension to act in the negative direction, if we consider negative displacement we want tension to act in the positive direction. Hence $$-4nc$$
If we consider positive velocity, we want the resistance forces to be negative, and if we consider negative velocity we want the tension to act in the positive direction. Hence $$-5c\frac{dx}{dt}$$
Therefore $$m\frac{d^2x}{dt^2} = -4nx -5c\frac{dx}{dt}$$
The key is that even though there are negative signs in the equations if the values taken by $$x$$ or $$\frac{dx}{dt}$$ are negative then they are in fact positive.