To solve the problem, we need to find the values of \( k_1 \) and \( k_2 \) for the cubic equation \( x^3 + 3x^2 + k = 0 \) such that it has all integer roots.
### Step-by-step Solution:
1. **Understanding the Roots**:
The cubic equation can be expressed in terms of its roots \( \alpha, \beta, \gamma \). According to Vieta's formulas:
- The sum of the roots \( \alpha + \beta + \gamma = -3 \) (coefficient of \( x^2 \) with a negative sign).
- The product of the roots \( \alpha \beta \gamma = -k \) (the constant term with a negative sign).
2. **Finding Integer Roots**:
Since we are looking for integer roots, we can explore combinations of integers that satisfy the equations derived from Vieta's formulas.
3. **Using the Sum of Roots**:
From \( \alpha + \beta + \gamma = -3 \), we can express one root in terms of the others. For example, let \( \gamma = -3 - \alpha - \beta \).
4. **Finding Possible Combinations**:
We need to find combinations of \( \alpha, \beta, \gamma \) such that their sum is -3 and their product is \( -k \). We will check various combinations of integers that add up to -3.
- **Case 1**: \( \alpha = 3, \beta = 0, \gamma = 0 \)
- Product: \( 3 \cdot 0 \cdot 0 = 0 \) (not valid since \( k \) cannot be zero)
- **Case 2**: \( \alpha = -3, \beta = 0, \gamma = 0 \)
- Product: \( -3 \cdot 0 \cdot 0 = 0 \) (not valid since \( k \) cannot be zero)
- **Case 3**: \( \alpha = 2, \beta = 2, \gamma = -1 \)
- Sum: \( 2 + 2 - 1 = 3 \) (not valid since we need -3)
- **Case 4**: \( \alpha = -2, \beta = -2, \gamma = 1 \)
- Sum: \( -2 - 2 + 1 = -3 \)
- Product: \( -2 \cdot -2 \cdot 1 = 4 \) (thus \( k = -4 \))
- **Case 5**: \( \alpha = 1, \beta = 1, \gamma = -5 \)
- Sum: \( 1 + 1 - 5 = -3 \)
- Product: \( 1 \cdot 1 \cdot -5 = -5 \) (thus \( k = 5 \))
5. **Identifying Non-Zero Integral Values of k**:
From the valid cases, we find:
- \( k_1 = 4 \) from the roots \( (-2, -2, 1) \)
- \( k_2 = -4 \) from the roots \( (2, 2, -1) \)
6. **Calculating \( k_1 - k_2 \)**:
Since \( k_1 > k_2 \):
\[
k_1 - k_2 = 4 - (-4) = 4 + 4 = 8
\]
### Final Answer:
The value of \( k_1 - k_2 \) is \( \boxed{8} \).