Word Problem of the Day!

Very easy question for anyone who isn’t me:

I live about half-way on a line between JobA and JobB. Let’s say it’s 12 miles to JobA and 8 miles to JobB.

I go to JobA 5 days a week. I go to JobB an average of 3 days a week.

If my goal is to drive the fewest possible miles, would it be better to move closer to JobA, or to stay put? Or should I move to be right at JobA? Is there a point somewhere in between that is optimal?

Live at JobA every mile closer to job A saves you 10 miles a week and only costs you 6 miles a week

ie if you live at Job a thats total mileage of 5 * 0 * 2 (cos it’s each way) + 3 * 20 * 2 = 120
0 120

now move a mile away from job A total = 512 + 3192 = 124
10 114

every mile closer to B will increase total mileage by 4

Call the distance from your house to A: a
Call the distance from your house to B: b

Your total driving will be 10a + 6b. We also know that a + b = 20. This means your total driving can be put in one variable.
10a + 6 (20 - a)
10a + 120 - 6a
4a + 120
The question is how to minimize that expression. A quadratic would probably give you something in the middle but in this case, given the domain and range needing to be non-negative (because distance is always non-negative), the minimum is when a=0.

So to minimize your driving, you need to live in your cubicle at Job A.

Stop working 8 days a week.