Homework Help:
Proof of w=(k/m)^(1/2)

So I am attempting to prove the simple harmonic motion equations with calculus so as to develop a better understanding of shm problems and have more flexibility when it comes to solving them. I am having a bit of trouble understanding the proof of w=(k/m)^(1/2)

Here is how I am doing it. I am taking the x(t)=A*cos(wt+θ) equation and then the second derivative of it to find acceleration

a(t)=-A*w^2*cos(wt+θ)
F=ma=-kx
a=-kx/m
-A*w^2*cos(wt+θ)=-kx/m
so I am guessing that I can make a few assumptions to solve for the final equation. If I assume that the time t=0, thus we x=A, I can solve
-x*w^2*cos(w(0)+0)=-kx/m
x's cancel out
w^2*cos(0)=k/m
w=(k/m)^(1/2)

Is this a valid way to prove the equation? Also, I am assuming that the original x(t) equation is correct, I do not know how to prove it. Is there a way to prove the original x(T) equation? Finally, I am preparing for the AP Physics C: Mechanics exam, so if I were to solve a problem using Calculus, for those of you familiar with the exam, would the graders allow me to start off a proof of an answer with x(t)=A*cos(wt+θ) as a given?