Hamilton-Jacobi-Bellman Equation from the Dynamic Programming Principle