Find the values of the constants in the following identity $2x^3+3x^2-14x-5=(ax+b)(x+3)(x+1)+C$ I'm working through identities but I can't figure out how to get further than multiplying out the above to get :
$$2x^3+3x^2-14x-5=2ax^3+3ax^2+3ax+bx^2+3bx+bx+3b+C$$
can someone give me a hint on what to do next?
 A: Good luck in finding such constants! Let $x=-1$. The right-hand side is $0$, and the left-hand side isn't.  
Presumably there is a typo. Once it is fixed, we can go on. 
Edit: The above was a response to the question before there was a $C$ on the right. Below is a solution of the corrected problem.  
Put $x=-1$. Then the right-hand side is $C$, and the left-hand side is $10$, so $C=10$. 
Put $x=0$. The right-hand side is $3b+10$, the left is $-5$. So $3b+10=-5$, and now we know $b$.
For $a$, the coefficient of $x^3$ on the left is $2$, and on the right it is $a$.
Now we need to verify that with the $a$, $b$, and $C$ we have found, the identity actually holds. This is necessary, for all we have shown is that if there are $a$, $b$, and $c$ that satisfy the equation, then $a$, $b$, $C$ must be as calculated. But perhaps there are no $a$, $b$, $C$ with the desired property. 
Remark: Multiplying out and setting up a system of equations will get you there too, but it is somewhat tedious, and the probability of error increases. 
A: The now deleted answer by amWhy used polynomial long division. Since $(x+3)(x+1)= x^2+4x+3$, if we perform the following polynomial long division 

we get rightaway the quotient $2x-5=ax+b$, thus $a=2,b=-5$, and the remainder $10=C$.

have you any tips on spotting when to use this ?

Given two polynomials $A(x)$ and $B(x)$, with degree of $B(x)$ greater than $0$, we can find two other polynomials $Q(x)$ and $R(x)$ such that $$A(x)=B(x)Q(x)+R(x),$$ and the degree of $R(x)$ is lower than the degree of $B(x)$.
In your case $A(x)=2x^3+3x^2-14x-5$, $B(x)=x^2+4x+3$, $Q(x)=2x-5$ and $R(x)=10$.
A: By expanding and grouping like terms together, we obtain:
$$ \begin{align*}
2x^3+3x^2-14x-5&=(ax+b)(x+3)(x+1) +C\\
2x^3+3x^2-14x-5&=(ax+b)(x^2+4x+3) +C\\
2x^3+3x^2-14x-5&=(ax)(x^2+4x+3)+b(x^2+4x+3) +C\\
2x^3+3x^2-14x-5&=(ax^3+4ax^2+3ax)+(bx^2+4bx+3b) +C\\
2x^3+3x^2-14x-5&=(a)x^3+(4a+b)x^2+(3a+4b)x+(3b+C)
\end{align*} $$
Now let's compare coefficients. In particular, focus on the coefficients of $x^3$, $x^2$, and $x^0$ (the constant term). From this, we obtain:
$$ \begin{align*}
x^3 &: \boxed{2=a} \\
x^2 &: 3 = 4a+b \implies b = 3-4a=3-4(2) \implies \boxed{b=-5} \\
x^0 &: -5=3b+C \implies C=-5-3b=-5-3(-5) \implies \boxed{C=10}
\end{align*} $$
A: Hint: look at the coefficients at $1$ and $x^3$.
