As x ranges over all real values, what is the minimum value of f(x)=|x-123|+|x-456| + |x-789| ?

To find the minimum value of the function f(x) = |x-123| + |x-456| + |x-789| as x ranges over all real values, we can start by analyzing the intervals in which x lies and separately consider the absolute value expressions in each interval.

1. For x < 123:
In this range, all three absolute value expressions will be negative since the values inside the absolute value signs will always be less than the values outside. Therefore, the expression f(x) will be the sum of the negations of the values in the absolute value signs. Thus, f(x) = -(x-123) - (x-456) - (x-789).

2. For 123 <= x < 456:
In this range, the absolute value expression |x-123| will be positive, while the other two will be negative. Therefore, f(x) = (x-123) - (x-456) - (x-789).

3. For 456 <= x < 789:
In this range, the absolute value expression |x-456| will be positive, while the other two will be negative. Therefore, f(x) = (x-123) + (x-456) - (x-789).

4. For x >= 789:
In this range, all three absolute value expressions will be positive since the values inside the absolute value signs will always be greater than the values outside. Therefore, the expression f(x) will be the sum of the values in the absolute value signs. Thus, f(x) = (x-123) + (x-456) + (x-789).

Now, we can calculate the minimum value of f(x) by finding the minimum values within each of the four intervals and comparing them.

1. For x < 123:
To minimize f(x), we want to choose the largest negative value for each absolute value expression. Therefore, f(x) = -(x-123) - (x-456) - (x-789) = -3x + 1368.

2. For 123 <= x < 456:
Taking the derivative of f(x) = (x-123) - (x-456) - (x-789) with respect to x, we can find that f'(x) = 1 - 1 - 1 = -1. Since the derivative is constant and negative, the function is decreasing in this range. We can see that the minimum value occurs at the endpoint x = 123.

3. For 456 <= x < 789:
Taking the derivative of f(x) = (x-123) + (x-456) - (x-789) with respect to x, we can find that f'(x) = 1 + 1 - 1 = 1. Since the derivative is constant and positive, the function is increasing in this range. We can see that the minimum value occurs at the endpoint x = 789.

4. For x >= 789:
Since all three absolute value expressions are positive, the minimum value occurs when the values inside the absolute value signs are all 0. Therefore, f(x) = 0 + 0 + 0 = 0.

Comparing the minimum values within each interval, we find that f(x) has a minimum value of 0 when x >= 789.

Therefore, the minimum value of f(x) = |x-123| + |x-456| + |x-789| as x ranges over all real values is 0.