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.
We have $$\sum_{k} c_k\sin(\theta+\phi_k) = \sum_k\left(c_k\cos(\phi_k)\sin(\theta)+c_k\sin(\phi_k)\cos(\theta)\right) = a\sin(\theta) + b\cos(\theta)$$ where $a=\sum_k c_k\cos(\phi_k)$ and $b=\sum_k c_k\sin(\phi_k)$. The maximum of $a\sin(\theta) + b\cos(\theta)$ is $\sqrt{a^2+b^2}$. Hence, the maximum value is $$\sqrt{\left(\sum_k c_k\cos(\phi_k)\right)^2 + \left(\sum_k c_k\sin(\phi_k)\right)^2} = \sqrt{\sum_{k}c_k^2 + \sum_{i \neq j}c_ic_j \cos(\phi_i-\phi_j)}$$