Let the two waves be represented by the equations:
$y_1 = A_1 \sin(\omega t)$
$y_2 = A_2 \sin(\omega t + \phi)$
where $A_1$ and $A_2$ are the amplitudes,$\omega$ is the angular frequency,$t$ is time,and $\phi$ is the initial phase difference.
According to the principle of superposition,the resultant displacement $y$ is the vector sum of the individual displacements:
$y = y_1 + y_2 = A_1 \sin(\omega t) + A_2 \sin(\omega t + \phi)$
Using the trigonometric identity $\sin(a + b) = \sin a \cos b + \cos a \sin b$:
$y = A_1 \sin(\omega t) + A_2 (\sin(\omega t) \cos \phi + \cos(\omega t) \sin \phi)$
$y = (A_1 + A_2 \cos \phi) \sin(\omega t) + (A_2 \sin \phi) \cos(\omega t)$
Let $A_1 + A_2 \cos \phi = R \cos \theta$ and $A_2 \sin \phi = R \sin \theta$,where $R$ is the resultant amplitude and $\theta$ is the phase constant.
Then,$y = R \cos \theta \sin(\omega t) + R \sin \theta \cos(\omega t) = R \sin(\omega t + \theta)$
where $R = \sqrt{A_1^2 + A_2^2 + 2A_1 A_2 \cos \phi}$ and $\tan \theta = \frac{A_2 \sin \phi}{A_1 + A_2 \cos \phi}$.