# Simple harmonic oscillator in a rocket which accelerates upward [closed]

I'm working my way through a textbook that deals with differential equations. Here's a problem that I need some help to solve:

Suppose a spring with a constant 4.5 kg/sec² is attached to a body with the mass m = 0.5 kg. This system is sitting in a rocket which accelerates upward at a rate of 29.4 m/sec². The bottom of the body is attached to one end of the spring. The other end of the spring is attached to the rocket. So the system does not hang downwards, it is standing upwards inside the rocket.
Solve the problem if at t = 0 (liftoff), y(0) = y'(0) = 0.

Here are some constants that are used in the problem:
gravity g = 9.8 m/sec²
spring constant k = 4.5 kg/sec²
mass of the body m = 0.5kg
acceleration of the roket ar = 29.4 m/sec²

What I did was the following:
I assumed that the positive y-axis is pointing up. First, I calculated the equilibrium position of the body: $$h=-\frac{m\cdot g}{k}-\frac{m\cdot a_{r}}{k}$$ Then I tried to set up the differential equation using h: $$m\cdot\frac{d^{2}y(t)}{dt^{2}}=-k\cdot\left(y(t)+ h\right)-m\cdot g-m\cdot a_{r}$$ $$m\cdot\frac{d^{2}y(t)}{dt^{2}}=-k\cdot\left(y(t)-\frac{m\cdot g}{k}-\frac{m\cdot a_{r}}{k}\right)-m\cdot g-m\cdot a_{r}$$ This can be simplified to: $$m\cdot\frac{d^{2}y(t)}{dt^{2}}+k\cdot y(t)=0$$ And this is the differential equation of a simple harmonic oscillator which is easy to solve. But the solution of this equation isn't the right solution for the problem. I am missing the influence of the rocket in my equation. So how should I change the equation to include the rocket?

You've taken the rocket into consideration when you used $$a_r$$ as an upward acceleration. Notice that it even behaves like some "extra gravity" when $$h = -\frac{m g*}{k}$$ and $$g* = g + a_r$$. So to an observer inside the rocket, there is no difference between accelerating upwards and adding some extra gravity downwards. That's the equivalence principle!
You've also shown that the equilibrium position doesn't really matter. You can always change coordinates about a new equilibrium position (you did, assuming $$y = u - h$$ and replacing for $$u$$, note the derivatives are the same), or take both weight and "inertial force" (so to speak) as constant forcing terms. These terms will only displace the central position (there's no damping, if it had, it would be the final rest position). Instead of $$y + h$$ on the RHS, replace only $$y$$ and see what changes (it will be only the equilibrium position - remember to adapt the boundary conditions, also).