To solve the problem, we will use the work-energy principle, which states that the work done on an object is equal to the change in its kinetic energy. In this case, we will consider the work done by the spring force and the work done by friction.
### Step-by-Step Solution:
1. **Identify the Given Values:**
- Mass of the block, \( m = 2 \, \text{kg} \)
- Initial speed of the block, \( v = 4 \, \text{m/s} \)
- Kinetic friction force, \( F_f = 15 \, \text{N} \)
- Spring constant, \( k = 10000 \, \text{N/m} \)
2. **Calculate the Initial Kinetic Energy:**
The initial kinetic energy (\( KE_i \)) of the block can be calculated using the formula:
\[
KE_i = \frac{1}{2} mv^2
\]
Substituting the values:
\[
KE_i = \frac{1}{2} \times 2 \, \text{kg} \times (4 \, \text{m/s})^2 = \frac{1}{2} \times 2 \times 16 = 16 \, \text{J}
\]
3. **Set Up the Work-Energy Equation:**
The work done by the friction force and the spring force will equal the change in kinetic energy. Since the block comes to rest, the final kinetic energy (\( KE_f \)) is 0. Thus, we have:
\[
W_f + W_s = KE_f - KE_i
\]
Where:
- \( W_f \) is the work done by friction, which is negative because it opposes the motion: \( W_f = -F_f \cdot x = -15 \cdot x \)
- \( W_s \) is the work done by the spring, which is also negative: \( W_s = -\frac{1}{2} k x^2 = -\frac{1}{2} \cdot 10000 \cdot x^2 \)
Therefore, the equation becomes:
\[
-15x - \frac{1}{2} \cdot 10000 \cdot x^2 = 0 - 16
\]
Simplifying gives:
\[
-15x - 5000x^2 = -16
\]
Rearranging the equation:
\[
5000x^2 + 15x - 16 = 0
\]
4. **Solve the Quadratic Equation:**
We can use the quadratic formula \( x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \) where \( a = 5000, b = 15, c = -16 \).
\[
x = \frac{-15 \pm \sqrt{15^2 - 4 \cdot 5000 \cdot (-16)}}{2 \cdot 5000}
\]
Calculate the discriminant:
\[
15^2 = 225
\]
\[
4 \cdot 5000 \cdot 16 = 320000
\]
\[
b^2 - 4ac = 225 + 320000 = 320225
\]
Now substituting back into the formula:
\[
x = \frac{-15 \pm \sqrt{320225}}{10000}
\]
Calculate \( \sqrt{320225} \):
\[
\sqrt{320225} \approx 565.8
\]
Therefore:
\[
x = \frac{-15 \pm 565.8}{10000}
\]
5. **Calculate the Positive Root:**
Taking the positive root:
\[
x = \frac{-15 + 565.8}{10000} = \frac{550.8}{10000} = 0.05508 \, \text{m}
\]
Convert to centimeters:
\[
x = 0.05508 \times 100 = 5.508 \, \text{cm} \approx 5.5 \, \text{cm}
\]
### Final Answer:
The spring is compressed by approximately **5.5 cm**.