We show that if p−≥2, then a sufficient condition for the density of smooth functions with compact support, in the variable exponent Sobolev space W1,p(⋅)(Rn), is that the Riesz potentials of compactly supported functions of Lp(⋅)(Rn), are also elements of Lp(⋅)(Rn). Using this result we then prove that the above density holds if (i) p−≥n or if (ii) 2≤p−<n and p+<np−n−p−. Moreover our result allows us to give an alternative proof, for the case p−≥2, that the local boundedness of the maximal operator and hence local log-Hölder continuity imply the density of smooth functions with compact support, in the variable exponent Sobolev space W1,p(⋅)(Rn).