finished problem 2 in homework8.tex