Note: I have slightly amended my answer based on what the second answerer said. I did overlook something. As it turns out, the final answer does not change.
After taking the transforms:
s^2*Y - 4 + 9Y = 8/(s^2 + 1) for the first phase
For the first phase
Y = (4s^2 + 12)/[(s^2 + 1)(s^2 + 9)]
= (As+B)/(s^2 + 1) + (Cs + D)/(s^2 + 9)
or (As+B)(s^2 + 9) + (Cs + D)(s^2 + 1) = 4s^2 + 12
To find A,B,C,D, let me show you the easiest way
Let s^2 = -1, ie s = i
(Ai + B)*(9-1) + 0 = 12-4
Ai + B = 1 + 0*i
A = 0, B = 1
Now let s^2 = -9, ie s - 3i
(3C*i + D)*(-9+1) = -4*9 + 12
3C*i + D = 3 + 0*i
D = 3, C = 0
Y = 1/(s^2 + 1) + 3/(s^2 + 9)
y(t) = sin(t) + sin(3t)
For the second phase, we now start with t = π
If you wish, you could make the sub τ = t - π
y" + 9y = 0
y(π) = 0 from the phase 1 solution
y'(π) = -4 from the phase 1 solution
The transform for the second phase becomes:
s^2*Y + 4 + 9Y = 0
Y = -4/(s^2 + 9)
y(τ) = -4/3 * sin(3τ)
y(t) = -4/3 * sin(3t - 3π)
= +4/3 * sin(3t)
Final solution:
for 0 < t < π, y(t) = sin(t) + sin(3t)
for t > π, y(t) = 4/3 * sin(3t)
This solution actually makes sense because the system has a natural frequency of 3, so during the second phase only the sin(3t) appears. During the first phase there is a forcing frequency of 1, so both frequencies appear.