Are you sure "interpolates" is the right word? Seems like "collocates" might be better.

This could be a tricky problem, but you have been given wounderfully convenient values, 0, 1/2, and 1. Substitute away and you've three equations so solve simultaneously.

P(x) = a + b*cos(pi*x) + c*sin(pi*x)

P(0) = a + b*cos(pi*0) + c*sin(pi*0) = a + b = 2

P(1/2) = a + b*cos(pi*(1/2)) + c*sin(pi*(1/2)) = a + c = 5

P(1) = a + b*cos(pi*1) + c*sin(pi*1) = a - b = 4

Are you letting the complicated appearance frighten you? Don't. Substitute and solve.