Method
1. Take 1/2 of 24 which is 12
2. Square it which is 144
3. Add that to the left of the equation.
x^2 + 24x + 144 = 17 that is an unbalanced equation. You have to do the same thing to the right hand side.
4. Add 144 to the right.
x^2 + 24x + 144 = 17 + 144
(x + 12)^2 = 161
Conclusion
Add 144 to both sides to complete the square.