1617 Cuticular hydrocarbons (CHCs) form the boundary between insects and their 18 environments and often act as essential cues for species, mate and kin recognition. This 19 complex polygenic trait can be highly variable both among and within species, but the 20 causes of this variation, especially the genetic basis, are largely unknown. In this study, 21we investigated phenotypic and genetic variation of CHCs in the seaweed fly, C. frigida, 22 and found that composition was affected by both genetic (sex and population) and 23 environmental (larval diet) factors. We subsequently conducted behavioral trials that 24 2 show CHCs are likely used as a sexual signal. We identified general shifts in CHC 25 chemistry as well as individual compounds and found that the methylated compounds, 26 mean chain length, proportion of alkenes, and normalized total CHCs differed between 27 sexes and populations. We combined this data with whole genome re-sequencing data to 28 examine the genetic underpinnings of these differences. We identified 11 genes related to 29 CHC synthesis and found population level outlier SNPs in 5 that are concordant with 30 phenotypic differences. Together these results reveal that the CHC composition of C. 31 frigida is dynamic, strongly affected by the larval environment, and likely under natural 32 and sexual selection. 33 34 Keywords: cuticular hydrocarbons, Coelopa frigida, sexual signal, population 35 differentiation, diet. 36 37 2010). However, in many solitary and social insects, cuticular hydrocarbons are also used 41 as one of the primary cues to recognize, and possibly discriminate between species, 42 sexes, and among kin (Bagneres et al. 1996; Ferveur 2005; Blomquist and Bagnères 43 2010; Van Oystaeyen et al. 2014). The multifarious use of CHCs in adaptation and 44 communication means that the composition is frequently under both natural (Howard and