For the topsoil, it is 40 lbs/1.9 gallons assume US gallon. I US gallon = 3785ml. 1 kg=2.2 lbs so 1 lb = 1/2.2= 0.454 kg or 454 grams. 1.9 gallons = 3785 x 1.9 = 7192ml. 40 lbs=18160graams. So 18160/7192= 2.52 g/cc for the topsoil density.
For the peat, the volume of the bag of the peat is 14x20x30 inches or 35.6x50.8x76.2cm (1 inch = 2/54 cm)= 137806 cc. So for the 40 lb again = 18160 grams/137806= 0.13 g/cc. So the peat is much lighter than the topsoil.
As for the number of bags of peat needed to fill the given volume of 10ftx20ftx20 inches, the latter volume is 120"x240"x20"= 576,000 cubic inches and the volume of one bag is 14x20x30 inches= 8400 cubic inches so 576,000/8400= 68.6 bags of peat to fill it.