Given real numbers $x\_1$, $\dots$, $x\_n$ and $r\_1$, $\dots$, $r\_n$ (with reasonable restrictions), is there a trigonometric series $T(x)=\sum\_k a\_k \cos(kx)$ with $a\_k\ge 0$ such that
$$
|T(x\_i)-r\_i|<\epsilon
$$
for all $i$?



trigonometric series with nonnegative coefficients and prescribed values
**[EDITED]** $\def\conv{\mathop{\rm conv}\nolimits}$The answer is **yes** if $x\_1,\dots,x\_n\in(0,\pi]$ are pairwise distinct (are these `reasonable restrictions'?). 


Consider a set $C=\{x(t)=(\cos tx\_1,\dots,\cos tx\_n)\colon t\in\mathbb Z\}\subset \mathbb R^n$. Let $D$ be the closure of the convex hull of $C$.


I claim that $0$ is the interior point of $D$. This yields that for every sufficiently small $r\_1,\dots,r\_n$ there are required coefficients $a\_j\geq 0$ (at most $n+1$ of them nonzero) summing up to $1$. An appropriate scaling then completes the proof 


Firstly, notice that 
$$
 \frac1N\sum\_{t=1}^N x(t)\to 0, \quad N\to+\infty,
$$
so $0\in D$. The only case to exclude is that $0$ is a boundary point of $D$, or --- that there esists a supporting hyperplane of $D$ passing through $0$, or --- that there exist some nontrivial coefficients $\alpha\_i$ such that
$$
 f(t)=\sum\_{j=1}^n\alpha\_j\cos tx\_j\geq 0
$$
for all $t\in\mathbb Z$. 


So we need to show that it is impossible. Assume first that $f$ is not identically zero. Then there exists some $n$ such that $\delta=\sum\_{t=1}^n f(t)>0$. This yields that $\sum\_{t=1}^N f(t)\geq \delta$ for all $N\geq n$. This is false, since 
$$
 \sum\_{t=1}^N f(t)
 =\sum\_j\alpha\_j\sum\_{t=1}^N\cos tx\_j
 =\sum\_j\alpha\_j\frac{\sin(N+1/2)x\_j-\sin x\_j/2}{\sin x\_j/2},
$$
and all fractions can simultaneously be made very small by Kronecker's theorem.


We are left to show that $f$ is not identically zero. Indeed, it is a nontrivial linear combination of the sequences $(\exp(\pm itx\_j))$ which are independent by Vandermonde.


