Calculate the z position of the particle as a function of time.

1. A particle of mass m is suspended from the ceiling by a spring with constant K and relaxed length initial lo, whose mass is negligible. The particle is released at rest with the spring relaxed. Taking the Oz axis directed vertically downward, with the origin on the roof, calculate the z position of the particle as a function of time.

2. Relevant equations
x=[Acos(wt+phi)

3. I know that the net force is given by F(net)=-kx+P where F(net) it will be d^2x/dt^2, so the expression takes the form. m*d^2x/dt^2=-kx+mg.

How we know that d^2x/dt^2=-w^2x, So m(-w^2x)=-kL(o)+mg, So -w^2*x=-kL(o)/m+mg/m

1. A particle of mass m is suspended from the ceiling by a spring with constant K and relaxed length initial lo, whose mass is negligible. The particle is released at rest with the spring relaxed. Taking the Oz axis directed vertically downward, with the origin on the roof, calculate the z position of the particle as a function of time.

2. Relevant equations
x=[Acos(wt+phi)

3. I know that the net force is given by F(net)=-kx+P where F(net) it will be d^2x/dt^2, so the expression takes the form. m*d^2x/dt^2=-kx+mg.

How we know that d^2x/dt^2=-w^2x, So m(-w^2x)=-kL(o)+mg, So -w^2*x=-kL(o)/m+mg/m

x=[Acos(wt+phi)

-w^2[Acos(wt+phi)= -9kL(o)/m+mg/m) We know that w=sqrt(k/m)

-w^2[Acos(sqrt(k/m)*t+phi)= -(kL(o)/m+mg/m)

So help me to know if Am I right or not about the equation.

The problem wants the z position of the particle as function of time. The z axis is oriented vertically downward. So write the differential equation in therms of z.
The differential equation contains a constant term mg, in addition of the Hook force, so the z(t) function is not a simple cosine function. Solve the equation and fit it to the initial conditions.