To solve the problem, we need to analyze the function \( f(x) = x + 2|x + 1| + x - |x - 1| \) and determine the value of \( k \) such that the equation \( f(x) = k \) has exactly one real solution.
### Step 1: Break down the function based on the absolute values
The function \( f(x) \) contains two absolute values, which means we need to consider different cases based on the values of \( x \).
1. **Case 1:** \( x < -1 \)
- Here, \( |x + 1| = -(x + 1) \) and \( |x - 1| = -(x - 1) \).
- Thus, \( f(x) = x + 2(-x - 1) + x - (-x + 1) = x - 2x - 2 + x + x - 1 = -2 + 2x \).
2. **Case 2:** \( -1 \leq x < 1 \)
- Here, \( |x + 1| = x + 1 \) and \( |x - 1| = -(x - 1) \).
- Thus, \( f(x) = x + 2(x + 1) + x - (-x + 1) = x + 2x + 2 + x + x - 1 = 4x + 1 \).
3. **Case 3:** \( x \geq 1 \)
- Here, \( |x + 1| = x + 1 \) and \( |x - 1| = x - 1 \).
- Thus, \( f(x) = x + 2(x + 1) + x - (x - 1) = x + 2x + 2 + x + 1 = 4x + 3 \).
### Step 2: Analyze the function in each case
Now we have three expressions for \( f(x) \):
- For \( x < -1 \): \( f(x) = -2 + 2x \)
- For \( -1 \leq x < 1 \): \( f(x) = 4x + 1 \)
- For \( x \geq 1 \): \( f(x) = 4x + 3 \)
### Step 3: Find critical points
Next, we find the values of \( f(x) \) at the boundaries of these cases:
- At \( x = -1 \):
\[
f(-1) = 4(-1) + 1 = -4 + 1 = -3
\]
- At \( x = 1 \):
\[
f(1) = 4(1) + 3 = 4 + 3 = 7
\]
### Step 4: Determine the behavior of \( f(x) \)
- For \( x < -1 \), \( f(x) \) is a linear function with a positive slope, starting from \( -3 \) at \( x = -1 \).
- For \( -1 \leq x < 1 \), \( f(x) \) is also linear and increasing, starting from \( -3 \) at \( x = -1 \) and reaching \( 3 \) at \( x = 1 \).
- For \( x \geq 1 \), \( f(x) \) continues to increase.
### Step 5: Find the value of \( k \)
To have exactly one real solution for \( f(x) = k \), \( k \) must be equal to the minimum value of \( f(x) \) over its entire domain. The minimum value occurs at \( x = -1 \), where \( f(-1) = -3 \).
However, since we are looking for the values given in the options (3, 0, 1, 2), we need to check the values of \( f(x) \) at critical points:
- The minimum value of \( f(x) \) is \( -3 \) at \( x = -1 \).
- The function reaches \( 1 \) at \( x = 0 \) and \( 3 \) at \( x = 1 \).
Thus, for \( k = 1 \), the equation \( f(x) = k \) will intersect the graph of \( f(x) \) at exactly one point (the vertex of the linear piece), confirming that the value of \( k \) that yields exactly one real solution is:
### Final Answer:
**k = 1**