Nonnegative sums of cosine, ultraspherical and Jacobi polynomials☆