I will help you with the first part; then you should be able to get the 2nd part...but if not, let me know!
When two lines are tangent, the value of the lines must be equal and the tangents must be equal.
In this case, the curve must go through (1,7), i.e. 7 =a + b + 2 + 7
and the derivative at this point must be 3 (the slope of the tangent): 3a + 2b + 2 = 3
That gives you an easy pair of simultaneous linear equations in a and b.
For part b, you will need to solve a quadratic using the values of a and b to find the point where the derivative is again = 3.