First, see if they factorise easily and have any common factors. That's the easiest route.
If they don't have easily identified common factors, you're looking at long division.
With your example, divide the highest-order term of the quadratic (x^2) into the cubic first. Just look at the first term in each expression for now. You will deal with the other terms in later steps.
It goes x times.
So work out x times the quadratic (= x^3 + x^2 + 4x) and subtract that from the original cubic (= -3x+2). That is the remainder on division by the quadratic.
It means that x^3 + x^2 + x + 2 = x(x^2 + x + 4) - 3x + 2
Normally you would continue, dividing the highest-order term in the quadratic into the highest-order term in the remainder. But you can't because the remainder has no x^2 term. So that's as far as your example can go.
I hope this helps. I would have tried to write out the long division in full, but the text spacing on this site wouldn't support it.
Answers & Comments
Verified answer
I'm doing this with one that works. You set it up like this (ignore the dots, it's just for formatting)
...................--------------------------
x^2 + x + 4 /x^3 + 2x^2 + x - 12
You divide x^3 by x^2 = x. You multiply x by the entire term. x*(x^2+x+4), then subtract.
.....................x
...................--------------------------
x^2 + x + 4 /x^3 - 2x^2 + x - 12
.....................x^3+ x^2 +4x
....................--------------------
............................ -3x^2 - 3x - 12
Now you do the same with the first terms.
.......................x - 3
.....................--------------------------
x^2 + x + 4 /x^3 - 2x^2 + x - 12
.....................x^3+ x^2 +4x
....................--------------------
............................ -3x^2 - 3x - 12
............................ -3x^2 - 3x - 12
............................ --------------------
First, see if they factorise easily and have any common factors. That's the easiest route.
If they don't have easily identified common factors, you're looking at long division.
With your example, divide the highest-order term of the quadratic (x^2) into the cubic first. Just look at the first term in each expression for now. You will deal with the other terms in later steps.
It goes x times.
So work out x times the quadratic (= x^3 + x^2 + 4x) and subtract that from the original cubic (= -3x+2). That is the remainder on division by the quadratic.
It means that x^3 + x^2 + x + 2 = x(x^2 + x + 4) - 3x + 2
Normally you would continue, dividing the highest-order term in the quadratic into the highest-order term in the remainder. But you can't because the remainder has no x^2 term. So that's as far as your example can go.
I hope this helps. I would have tried to write out the long division in full, but the text spacing on this site wouldn't support it.