find the extreme values of the function on the interval and where they occur.

f(x) = |x-1|-|x-5|, -2<=x<=7

To find the extreme values of the function f(x) = |x-1| - |x-5| on the interval -2 ≤ x ≤ 7 and where they occur, we need to follow these steps:

1. Determine the critical points within the given interval.
2. Evaluate the function at the critical points and at the endpoints of the interval.
3. Compare the function values to identify the maximum and minimum values.

Step 1: Determine the critical points
To find the critical points, set each absolute value expression equal to zero and solve for x.

For the first absolute value expression:
x - 1 = 0
x = 1

For the second absolute value expression:
x - 5 = 0
x = 5

So, the critical points within the interval -2 ≤ x ≤ 7 are x = 1 and x = 5.

Step 2: Evaluate the function
Evaluate f(x) at the critical points and endpoints of the interval.

For x = -2:
f(-2) = |-2 - 1| - |-2 - 5| = 3 - 7 = -4

For x = 1:
f(1) = |1 - 1| - |1 - 5| = 0 - 4 = -4

For x = 5:
f(5) = |5 - 1| - |5 - 5| = 4 - 0 = 4

For x = 7:
f(7) = |7 - 1| - |7 - 5| = 6 - 2 = 4

Step 3: Identify the maximum and minimum values
From the evaluations above, we can see that both x = 1 and x = 5 result in a value of -4, which is the minimum value of the function on the given interval (-2 ≤ x ≤ 7). On the other hand, the maximum value of the function is 4, which occurs both at x = 5 and x = 7.

Therefore, the extreme values of the function f(x) = |x-1| - |x-5| on the interval -2 ≤ x ≤ 7 are a minimum of -4 (occurs at x = 1 and x = 5) and a maximum of 4 (occurs at x = 5 and x = 7).