Position of Cart attached to Wall by Spring/x = x0 at t = 0

Theorem
Consider a cart $C$ of mass $m$ attached to a wall by means of a spring $S$.

Let $C$ be free to move along a straight line with zero friction.

Let the force constant of $S$ be $k$.

Let the displacement of $C$ at time $t$ from the equilibrium position be $\mathbf x$.

Let $C$ be pulled aside to $x = x_0$ and released from stationary at time $t = 0$.

Then the horizontal position of $C$ at time $t$ can be expressed as:
 * $x = x_0 \cos \alpha t$

where $\alpha = \sqrt {\dfrac k m}$.

Proof

 * CartOnSpring.png

From Position of Cart attached to Wall by Spring, the horizontal position of $C$ is given as:
 * $(1): \quad x = C_1 \cos \alpha t + C_2 \sin \alpha t$

where:
 * $C_1$ and $C_2$ depend upon the conditions of $C$ at time $t = 0$
 * $\alpha = \sqrt {\dfrac k m}$

Differentiating $(1)$ $x$ gives:
 * $(2): \quad x' = -C_1 \alpha \sin \alpha t + C_2 \alpha \cos \alpha t$

Setting the initial condition $x = x_0$ when $t = 0$ in $(1)$:

Setting the initial condition $x' = 0$ when $t = 0$ in $(1)$:

Hence:
 * $x = x_0 \cos \alpha t$

where $\alpha = \sqrt {\dfrac k m}$.