Let $n$ be a given positive integer. Find the solution set of the equation $\sum_{k=1}^{2n} \sqrt{x^2 -2kx + k^2} =|2nx - n - 2n^2|$



We are given the equation:

\[
\sum_{k=1}^{2n} \sqrt{x^2 - 2kx + k^2} = |2nx - n - 2n^2|
\]

We will analyze this equation by considering different cases for \( x \).

### Case 1: \( x \geq 2n \)

1. For \( x \geq 2n \), we have \( x - k \geq 0 \) for all \( k \) from 1 to \( 2n \).
2. Therefore, \( \sqrt{x^2 - 2kx + k^2} = x - k \).
3. The left-hand side (LHS) of the equation becomes:
   \[
   \sum_{k=1}^{2n} (x - k) = 2nx - \sum_{k=1}^{2n} k = 2nx - \frac{2n(2n + 1)}{2} = 2nx - n(2n + 1)
   \]
4. The right-hand side (RHS) of the equation is:
   \[
   |2nx - n - 2n^2| = 2nx - n - 2n^2 \quad \text{(since \( x \geq 2n \))}
   \]
5. Equating LHS and RHS:
   \[
   2nx - n(2n + 1) = 2nx - n - 2n^2
   \]
   Simplifying both sides, we see that the equation holds true for all \( x \geq 2n \).

### Case 2: \( \frac{2n + 1}{2} \leq x < 2n \)

1. Suppose \( i \leq x < i + 1 \) for some integer \( i \).
2. For \( k \leq i \), \( x - k \geq 0 \) and for \( k > i \), \( x - k < 0 \).
3. The LHS becomes:
   \[
   \sum_{k=1}^{i} (x - k) + \sum_{k=i+1}^{2n} (k - x)
   \]
4. Simplifying the sums:
   \[
   \sum_{k=1}^{i} (x - k) = ix - \frac{i(i+1)}{2}
   \]
   \[
   \sum_{k=i+1}^{2n} (k - x) = \sum_{k=i+1}^{2n} k - (2n - i)x = \frac{(2n+i+1)(2n-i)}{2} - (2n - i)x
   \]
5. Combining these, the LHS becomes:
   \[
   ix - \frac{i(i+1)}{2} + \frac{(2n+i+1)(2n-i)}{2} - (2n - i)x
   \]
6. The RHS is:
   \[
   |2nx - n - 2n^2| = 2nx - n - 2n^2 \quad \text{(since \( x \geq \frac{2n+1}{2} \))}
   \]
7. Equating LHS and RHS:
   \[
   ix - \frac{i(i+1)}{2} + \frac{(2n+i+1)(2n-i)}{2} - (2n - i)x = 2nx - n - 2n^2
   \]
   Simplifying, we get:
   \[
   x = \frac{i + 2n + 1}{2}
   \]

### Case 3: \( x < \frac{2n + 1}{2} \)

1. For \( x < \frac{2n + 1}{2} \), we have \( x - k < 0 \) for all \( k \) from 1 to \( 2n \).
2. Therefore, \( \sqrt{x^2 - 2kx + k^2} = k - x \).
3. The LHS becomes:
   \[
   \sum_{k=1}^{2n} (k - x) = \sum_{k=1}^{2n} k - 2nx = \frac{2n(2n + 1)}{2} - 2nx = n(2n + 1) - 2nx
   \]
4. The RHS is:
   \[
   |2nx - n - 2n^2| = n(2n + 1) - 2nx \quad \text{(since \( x < \frac{2n+1}{2} \))}
   \]
5. Equating LHS and RHS:
   \[
   n(2n + 1) - 2nx = n(2n + 1) - 2nx
   \]
   This holds true for all \( x < \frac{2n + 1}{2} \).

Thus, the complete solution set for \( x \) is:

\[
x \geq 2n \quad \text{or} \quad x = \frac{i + 2n + 1}{2} \quad \text{or} \quad x < \frac{2n + 1}{2}
\]

The final answer is \( \boxed{ x \geq 2n } \) or \( x = \frac{i + 2n + 1}{2} \) or \( x < \frac{2n + 1}{2} \).