Google Maps will help you calculate the cost of public transit vs. driving. After you map out your commute. Just click on the public transit button. About half way down it will show you a public transit vs. driving comparison.
My commute by car is 37.9 miles each way to my job in San Francisco. According to Google Maps, it costs me $22.18 to drive into San Francisco each way, not counting the Bay Bridge toll at 4.00, plus parking at 10-20 dollars a day.
This adds up $68.36 round trip to drive to my job in San Francisco per day.
BART takes 20 minutes longer and costs me 10 dollars per round trip. Which one do you think I take?