Solution for problem 8.
Solution for problem 11.