how to solve investment math problems