Let R be a unitary commutative R-algebra and K ⊆ X (R) = Hom(R, R), closed with respect to the product topology. We consider R endowed with the topology T (K), induced by the family of seminorms ρ α (a) := |α(a)|, for α ∈ K and a ∈ R. In case K is compact, we also consider the topology induced by a K := sup α∈K |α(a)| for a ∈ R. If K is Zariski dense, then those topologies are Hausdorff. In this paper we prove that the closure of the cone of sums of 2d-powers, R 2d , with respect to those two topologies is equal to Psd(K) := {a ∈ R: α(a) 0, for all α ∈ K}. In particular, any continuous linear functional L on the polynomial ring R = R[X] = R[X 1 , . . . , X n ] with L(h 2d ) 0 for each h ∈ R[X] is integration with respect to a positive Borel measure supported on K. Finally we give necessary and sufficient conditions to ensure the continuity of a linear functional with respect to those two topologies.