Solutions for problems 6 and 7.
Solution for problem 8.