As a follow up, let's first compute:
$$\frac{d^4}{dx^4}\left(e^x\sin(x)\right)=e^x\sin(x)+4e^x\cos(x)-6e^x\sin(x)-4e^x\cos(x)+e^x\sin(x)=-4e^x\sin(x)$$
And so our induction hypothesis is:
$$\frac{d^{4(M+1)}}{dx^{4(M+1)}}\left(e^x\sin(x)\right)=(-4)^{M+1}\left(e^x\sin(x)\right)$$
It is easy to see now, that taking the 4th derivative of both sides, we get:
$$\frac{d^{4((M+1)+1)}}{dx^{4((M+1)+1)}}\left(e^x\sin(x)\right)=(-4)^{(M+1)+1}\left(e^x\sin(x)\right)$$
Since we have obtained $P_{M+2}$ from $P_{M+1}$, this completes our proof by induction.