We have two waves
$\psi_1(x) = a_1\mathrm{cos}(kx-\omega t + \phi_1)$
$\psi_2(x) = a_2\mathrm{cos}(kx-\omega t + \phi_2)$
We know that the superimposed wave can be written as
$\psi(x) = \psi_1(x) + \psi_2(x)$
How can I derive from this that the amplitude of the superimposed wave $\psi(x)$ is $ \sqrt{a_1^2 + a_2^2 + 2a_1a_2 \mathrm{cos}(\phi_1-\phi_2 )} $
I'm pretty sure it has something to do with the relation that when you have
$\psi(x,t)=A\mathrm{cos}(kx+ ωt + \phi) = B\mathrm{cos}(kx+ ωt) - C\mathrm{sin}(kx+ ωt)$
you can derive that
${A}^{2} = {B}^{2} + {C}^{2}$;
and
$\mathrm{cos}(\phi) = \frac{B}{A}, \mathrm{sin}(\phi) = \frac{C}{A}$
But I can't figure out how to do it...