Imagine you write the euclidean division :

There exists a polynomial Q such that :

Now let

This gives

Same thing for the division by (x+2) : we get

Now what if we consider the division by ?

There exists polynomials R and S (S is the remainder) such that :

Now once again, if you let , you get :

so we have

Similarly, if you let , you get :

So the remainder of P when divided by (x-2)(x+3) will be a polynomial S such that and

But the degree of S cannot exceed 2, since (x-2)(x+3) has a degree 2. (if S has a degree equal or superior to 2, then it still can be divided by (x-2)(x+3))

Hence we're looking for a and b in :

Now the previous working gives you the following system :

Which is very basic algebra