# Estimate gas cost

To estimate gas cost, we will derive a simple formula. To improve accuracy and practicality, the formula and the calculator below will include city miles and highway miles. Usually, you will see MPG rating as 20 CITY / 30 HWY

This means that your vehicle will give you 20 miles per gallon driving in the city and 30 miles per gallon driving on the highway.

To derive our formula, the strategy we will use is to see how much money you spend on gas per miles.

This situation ca be expressed as dollar per miles.

Say the cost of gas is 3 dollars per gallon.

And the effeciency of your vehicle is 20 CITY / 30 HWY

Let us just work with the efficiency on the highway for now

Look at the following ratio. It is a ratio of the cost of gas to the fuel efficiency of your specific vehicle.

3 dollars per gallon / 30 miles per gallon

3 dollars / 30 miles

Since gallon is on top and at the bottom, it will cancel in the ratio.

Now the ratio gives you the money spent per 30 miles.

To calculate money spent on gas for driving 90 miles, just multiply the ratio immediately above by 90

3 dollars / 30 miles
× 90      equation 1

We get
3 dollars × 90 / 30 miles

We get
270 / 30 miles
= 9 dollars

Let us make a generalization of equation 1 above.

Suppose gas price is x and the efficiency of your vehicle is c CITY / h HWY

Notice that in c CITY / h HWY,  c is city efficiency and h is highway efficiency.

In our example above c = 20 miles and h = 30 miles

D is the distance you drive your car on the highway

The cost of gas on the highway is
x / h
× D

If d is the distance you drive in the city,

The cost of gas in the city is
x / c
× d

 Total cost of gas =   x / h × D   + x / c × d
 Total cost of gas =   x / h × D   + x / c × d

Example:
Estimate gas cost if gas price is 3 dollars, your vehicle efficiency is 20 CITY / 30 HWY, and you drive 30 miles on the highway and 10 miles in the city.

Just plug in the numbers in the formula

 Total cost of gas =   3 / 30 × 30   + 3 / 20 × 10

 Total cost of gas =   90 / 30   + 30 / 20

Total cost of gas = 3 + 1.5 = 4.5 dollars

Example:
Estimate gas cost if gas price is 3 dollars, your vehicle efficiency is 20 CITY / 30 HWY, and you drive 30 miles on the highway and 10 miles in the city.

Just plug in the numbers in the formula

 Total cost of gas =   3 / 30 × 30   + 3 / 20 × 10

 Total cost of gas =   90 / 30   + 30 / 20

Total cost of gas = 3 + 1.5 = 4.5 dollars

### Estimate gas cost calculator

The following calculator will estimate the cost of gas for any trip. You can use it as a trip planner.

## Recent Articles 1. ### Basic Math Review Game - Math adventure!

May 19, 19 09:20 AM

Basic math review game - The one and only math adventure game online. Embark on a quest to solve math problems!

New math lessons

Your email is safe with us. We will only use it to inform you about new math lessons. Tough Algebra Word Problems.

If you can solve these problems with no help, you must be a genius!

## Recent Articles 1. ### Basic Math Review Game - Math adventure!

May 19, 19 09:20 AM

Basic math review game - The one and only math adventure game online. Embark on a quest to solve math problems! 