Look at the Wikipedia article on dynamic programming. They are very much related. My impression is that the deep part of the math of dynamic programming, the decomposition into interrelated subproblems, is trivial in the CS text book examples. Then all that's left are implementation aspects.