Obesity is highly heritable, yet only a small fraction of its heritability has been attributed to specific genetic variants. Missing heritability is particularly pronounced for childhood obesity. Here we studied 226 children for whom we typed almost one million single-nucleotide polymorphisms (SNPs), and collected weight and length or height at eight time points between birth and the age of three years. Leveraging longitudinal weight gain trajectory information and novel functional data analysis (FDA) techniques, we constructed a polygenic risk score (PRS) comprised of 24 SNPs. This PRS explains 56% of the variability in weight gain trajectories among the studied children. Moreover, it is significantly higher in children with (vs. without) rapid infant weight gain—a predictor of obesity later in life. We validated the constructed PRS in populations of adolescents and adults—suggesting that some genetic variants predispose to obesity at both childhood and later life stages. In contrast, PRSs from genome-wide association studies (GWAS) of adult obesity were not predictive of weight gain in our cohort of children, and did not share SNPs with our PRS. Our research provides a strong example of a successful application of FDA to a GWAS. We demonstrate that a sophisticated characterization of a longitudinal phenotype can provide increased statistical power to studies with smaller sample sizes. This has the potential of shifting the existing paradigm in GWAS.