A novel soybean variety, designated 5PGRS40 is provided. Also provided are the seeds of soybean variety 5PGRS40, cells from soybean variety 5PGRS40, plants of soybean 5PGRS40, and plant parts of soybean variety 5PGRS40. Methods provided include producing a soybean plant by crossing soybean variety 5PGRS40 with another soybean plant, methods for introgressing a transgenic trait, a mutant trait, and/or a native trait into soybean variety 5PGRS40, methods for producing other soybean varieties or plant parts derived from soybean variety 5PGRS40, and methods of characterizing soybean variety 5PGRS40. Soybean seed, cells, plants, germplasm, breeding lines, varieties, and plant parts produced by these methods and/or derived from soybean variety 5PGRS40 are further provided.