Final answer:
To find the values of a and b, we can use the remainder theorem. Substituting the given values into P(x), we can set up two equations and solve them simultaneously to find the values of a and b. The values of a and b are 1 and 2, respectively.
Step-by-step explanation:
To find the values of a and b, we need to use the remainder theorem. The remainder theorem states that if a polynomial P(x) is divided by (x - a), then the remainder is equal to P(a).
From the given information, we know that P(x) gives a remainder of 5 when divided by (x - 1) and a remainder of 7 when divided by (x - 2). Substituting x = 1 and x = 2 into P(x), we get two equations:
- P(1) = 5: Substitute x = 1 into P(x) to get 1^3 + a(1^2) + b(1) + 1 = 5.
- P(2) = 7: Substitute x = 2 into P(x) to get 2^3 + a(2^2) + b(2) + 1 = 7.
Simplifying both equations, we get a + b = 3 and 4a + 2b = 3. Solving these two equations simultaneously, we find that a = 1 and b = 2.