You can figure the remaining percentage in 2050 and calculate using that, or you can figure the amount of population that will be lost and subtract that from the 2006 value.
First method: The remaining population will be 100% - 5.8% = 94.2% of that in 2006. 0.942×40.2 million ≈ 37.9 million
Second method: 5.8% of 40.2 million is about 2.3 million, so the remaining population will be 40.2 - 2.3 = 37.9 million