Searching sum of constants in a polynomial Consider the polynomial $f(x)=x^3+ax+b$, where $a$ and $b$ are constants. If $f(x+1004)$ leaves a remainder of $36$ upon division by $x+1005$, and $f(x+1005)$ leaves a remainder of $42$ upon division by $x+1004$, what is the value of $a+b$?

The general knowledge to be used is that if 
$$P(x)=(x-a)Q(x)+R$$
where $P$ and $Q$ are polynomials and $R$ a constant. Then, evaluating on $x=a$ we get $P(a)=R$. This is called the Polynomial remainder theorem.
You are looking for $f(1)-1=a+b$.
We  have that $f(x+1005)$ gives remainder $42$ after division by $x+1004=x-(-1004)$. This means that $f(-1004+1005)=f(1)=1+a+b=42$. 
From this we get that $a+b=41$.
