I'm looking for a generalization of the following statement
$\sup \limits_{\theta} (a \sin \theta + b \cos \theta) = \sqrt{a^2 + b^2}$
In particular, I want to find
$\sup \limits_{\theta} (a \sin \theta + b \sin (\theta + \varphi))$
for each $\varphi \in [0, 2 \pi)$.
And, as a further generalization,
$\sup \limits_{\theta} \sum_{k=1}^n (c_k \sin (\theta + \varphi_k))$
with $c_k \in \mathbb{R}$ and $\varphi_k \in [0,2 \pi)$.
Does anyone know a closed form in terms of the phases $\varphi$?
For the first statement, I have found that $\varphi = 0 \Rightarrow \max = |a|+|b|$ and $\varphi = \pi \Rightarrow \max = ||a| - |b||$. I don't know how to tackle the problem for these non-special angles.