Why we taking $ a = A \sin \phi$ and $b = A \cos\phi$ in place of constants in the Linear Harmonic Oscillator eq.? The General Physical Solution of motion of the linear harmonic oscillator,  $d^2x/dt^2 + \omega^2 x(t)= 0 $ is $$ x = a \cos \omega t + b \sin \omega t$$ where $a, b$ are two arbitrary real constants. Now putting $ a = A \sin \phi ,$ $b = A \cos\phi$, so we get alternative form of the previous equation $$ x = A\sin(\omega t+ \phi)$$
My questions are

*

*Why Do We Put $ a = A \sin \phi$ and  $b = A \cos\phi$ ?

*$a , b $ are two different constants but we are taking same constant $A$ and angle $\phi$ in both cases $( a = A \sin \phi ,$ $b = A \cos\phi)$. Why?

 A: Both of your questions are related to each other. As we know, both $a$ and $b$ are two arbitrary real constants. Here, we want to put two constants such that that general solution can be rewritten as one single trigonometric function (which is sine in this case) with a phase change $\phi$. Here we use the equation for sine of the sum of two angles:
\begin{align}
\sin(p+q) = \sin{p}\cos{q} + \cos{p}\sin{q}
\end{align}
To achieve that purpose, we choose two specific values of $a = A \sin{\phi}$ and $b = A \cos{\phi}$, where both are constants. If we substitute those values into the general solution $x = a \cos{\omega t} + b \sin{\omega t}$, we get
\begin{align}
x &= A \sin{\phi} \cos{\omega t} + A \cos{\phi} \sin{\omega t}\\
&= A(\sin{\phi} \cos{\omega t} + \cos{\phi} \sin{\omega t})\\
\end{align}
That part in bracket is similar to the trigonometry equation above, with $p = \phi$ and $q = \omega t$. Thus, we can rewrite that last line in the equation above as $A \sin(\omega t + \phi)$.
A: These are two equivalent representations, and the transformation can be done either way:
$$
A\sin(\omega t +\phi)=A\left[\sin\phi\cos(\omega t)+\cos\phi\sin(\omega t)\right]=a\cos(\omega t)+b\sin(\omega t),
$$
where we defined
$$
a=A\sin\phi, b=A\cos\phi
$$
OR
$$
a\cos(\omega t)+b\sin(\omega t)=\sqrt{a^2+b^2}\left[\frac{a}{\sqrt{a^2+b^2}}\cos(\omega t)+\frac{b}{\sqrt{a^2+b^2}}\sin(\omega t)\right]
=A\left[\sin\phi\cos(\omega t)+\cos\phi\sin(\omega t)\right]=A\sin(\omega t +\phi)
$$
where we defined
$$
A=\sqrt{a^2+b^2},\sin\phi=\frac{a}{\sqrt{a^2+b^2}}, \cos\phi=\frac{b}{\sqrt{a^2+b^2}}\Rightarrow \phi=\arctan\left(\frac{a}{b}\right)
$$
A: It is just two ways of writing a general solution to the differential equation with two constants $a$ and $b$ or $A$ and $\phi$ which can be determined by knowing the initial conditions.
Here are the two ways of presenting the solution with $a=2,\,b=3,\,A=\sqrt{2^2+3^2} $ and $\phi = \arctan(3/2)$ both giving the same variation of $x$ with $t$.

