In SHM, the general solution for position is:
Given initial conditions $x_0$ and $v_0$, we can solve for $A$ and $\phi$: