Will the motion in both systems be same?

In my book, the discussion in SHM is mainly about a mass hanging vertically from a spring. But there are some exercises which contain questions which involves a mass attached to a spring and the whole system is horizontal.

So one system is vertical and another is horizontal. So won't $$g$$ affect them differently? Will their motion be same (like they will be in SHM but their $$\omega$$ will change)? Will equations like $$v=\omega \sqrt{A^2-x^2}$$ be valid for both of them?

The interesting thing is that the period of the motion will be the same in both cases but the horizontal spring must also obey Hooke's law in compression.
For the vertical spring let the unit vector in the down direction be $$\hat d$$.

Using Newton's second law for the static equilibrium position $$mg\, \hat d-kx_0 \,\hat d = 0\, \hat d \Rightarrow mg = kx_0$$.

Now consider the spring stretch an extra amount $$x$$ from its equilibrium position.

$$mg\, \hat d -k(x_0+x) \,\hat d = ma \,\hat d \Rightarrow -kx = ma$$ which is exactly the same equation of motion you would get for a horizontal spring with $$x$$ as the actual extension of the spring as for a horizontal spring the equilibrium position would be with the spring unextended.

Update in response to a question from the OP.

If the spring is horizontal and extended from its unstretched state in the $$\hat x$$ direction by an amount $$x$$ then applying Newton’s second law gives $$-kx \,\hat x = ma\,\hat x\Rightarrow -kx = ma$$.

If the spring-mass system is on a slope you will get the same equation of motion but a changed static equilibrium extension $$x_0$$.
Is is as though the gravitational field strength $$g$$ had been reduced.

• Can you please derive the equation of horizontal spring please? Why would it be the same? Will it be same regardless of the angle it makes with the base? – Theoretical Jan 14 at 13:32

Just read your post on Physics Meta. I think you should upvote the answers you like and search the site thoroughly before posting.

As for the question, you can prove this on your own. In the vertical spring case, first solve for the equilibrium case, then solve for the force after it is stretched by a small amount $$x$$. Equate the resultant force to $$ma$$ and you should get a an SHM equation which will be the same as what you would have gotten if you were solving it in the horizontal case.

The force of gravity does not affect the time period of the block because it is not a restoring force. It does not change it's magnitude with the position of the block.