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?
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.