Solutions for chapter 2