Ex 2, 3, 4, including numerical integration for qt