An equation for the simple harmonic motion

I know that this seems to be a pretty easy question but for some reason I can’t find any explanation for the following equation in any high school text book or on the internet.

So according to my answers sheet this equation is valid for the state of equilibrium of an object with the mass $$m$$ hanging on a metal spring.

$$m\cdot g = D \cdot \hat y \implies \dfrac D m = \dfrac {g}{\hat y} \tag{II}$$

The given formula is to be used in order to find the spring constant. With $$mg$$ standing for the gravitational force, $$D$$ for the spring constant and $$\hat y$$ for the maximum displacement. But shouldn’t the displacement be zero at the state of equilibrium? Is this just an assumption or can you mathematically derive this equation?

I would be grateful, if someone could give me a plausible explanation for this simple equation.

• Please do not post images of texts you want to quote, but type it out instead so it is readable for all users and so that it can be indexed by search engines. For formulae, use MathJax instead. – Emilio Pisanty Jan 24 at 11:15
• A way of thinking about this would be to ask yourself what the displacement at equilibrium would be on the Moon? What would it be on a spaceship floating in deep space? Would the values be the same? – tfb Jan 24 at 11:22
• Thank you, Emilio Pisanty for the advice and fixing my formula. This was my first question here. Although I wrote the formula in Latex, it didn‘t work. – regisfiliusmixticius Jan 24 at 11:29

In this cases, you have to consider two situations with two different equilibrium states; the first one is when there's no mass $$m$$ hanging on the metal string. At this situation of course the displacement is zero at the equilibrium state. When you hang the mass $$m$$ on the string you have a new situation where the previous equilibrium state no longer holds; this new situation will make the metal string change to a new equilibrium state by stretching and because of that the displacement is no longer zero.
The same equation can be used for both situations: $$m \cdot g = D \cdot \hat y$$ In the first situation is no mass hanging which means $$m=0$$, therefore $$0 \cdot g = D \cdot 0$$. In the second situation, it's exactly like the equation says. So the bottom line, every time you change mass, the equilibrium state will always change to adjust to the new mass obeying the equation above!