dP/dt = -1_____0 <= t <=2

x-3____2<= t <= 4

1____4 <= t <= 5

start from integrating the function in the first interval:

P = -t+C_____0<=t<=2

now we know that P(0) = 30 thus C = 30 ----> P = -t+30_____0<=t<=2

no because the derivative is continues we can use P(2) = 28 as the initial condition for the function in the next interval

P = (t^2)/6 - 3t + C____2<= t <=4, P(2) = 28----> P(t) = (t^2)/6 - 3t +100/3

continue in the same way and solve for the last interval...