Speedometer Pinion Gear

The difference between 40 and 30 = 10. 10 is 1/4 of 40. 1/4 of 29 is 7.2. 29 + 7.2 = 36.2. Maybe you're not reading your GPS accurately. Use mile markers.
The math above is not correct. You have to work in percentages. 30÷40=0.75 or 75%. 29÷0.75=38.7 .
You can also go the other way, 40÷30=1.333 or 133%. 29x1.333=38.7 .