# Homework Help: Problem with last step of SHM derivation

1. Oct 2, 2011

### funcosed

1. The problem statement, all variables and given/known data
A masss m ossilates on a spring, find the position as a function of time.

2. Relevant equations
F=ma
F=-ky

3. The attempt at a solution

Well known problem, set
m(dx/dt) = -kx
get roots of characteristic equation and sub into general solution,
x = Aexp(iwt) +Bexp(-iwt)
or
x = Asin(wt) + Bcos(wt)
I'm ok down as far as here however I know this can be written as Ccos(wt-) but I cant see how?

2. Oct 2, 2011

### EkaterinaAvd

(1) probably just typo, not mx'=-kx but mx''=-kx

(2) if you want to go from x = Asin(wt) + Bcos(wt) to x=Ccos(wt+phi), you would have to rewrite the first expression as

x = sqrt(AA+BB) (Asin(wt)/sqrt(AA+BB) + Bcos(wt)/sqrt(AA+BB))

( sqrt(a) is squared root from a)

as soon as (A/sqrt(AA+BB))^2+(B/sqrt(AA+BB))^2 = 1, you can say that there is some angle phi for which cos(phi)= B/sqrt(AA+BB), sin(phi)=A/sqrt(AA+BB). Then use formula for cos of difference.

3. Oct 2, 2011

thanks