Find coefficients of polynomial, knowing its roots are consecutive integers

The brute force method that doesn't require any formulas or theorems would be like so:

You know that there are $3$ consecutive zeroes $(n-1)$, $n$, $(n+1)$. It's important to pick them like so as opposed to $n$, $(n+1)$, $(n+2)$ because this will save you a lot of algebra.

$0=(n-1)^3-15(n-1)^2+a(n-1)+b $

$0=n^3-15n^2+an+b $

$0=(n+1)^3-15(n+1)^2+a(n+1)+b $

$\color{red}{\text {This is how to start it. Below is the answer, so if you just wanted a hint you can stop here.}}$

Get rid of the $b$ first because it's easy. To do this, subtract the middle equation from the other two, producing two equations with $a$ and $n$ as unknowns:

$$0-0=[(n-1)^3-15(n-1)^2+a(n-1)+b ]- (n^3-15n^2+an+b )$$

Which simplifies to

$$0=-a-3n^2+33n-16 $$

And

$$0-0 = [(n+1)^3-15(n+1)^2+a(n+1)+b ] - (n^3-15n^2+an+b )$$

Which simplifies to

$$0=a+3n^2-27n-14 $$

So we have the system

$$0=-a-3n^2+33n-16 $$

$$0=a+3n^2-27n-14 $$

Now add these $2$ equations together, and get

$$0=6n-30$$

Therefore

$$n=5$$

Now that you have $n$, you know that the other solutions are of the form $n \pm 1$, so the $3$ roots are $4, 5, 6$.

Now plug just two of these into your cubic (maybe the two smallest ones) and you will have two equations with $a$ and $b$ as unknowns.

$$0=4^3-15\cdot4^2+4a+b$$

$$0=5^3-15\cdot5^2+5a+b$$

Simplifying,

$$0=4a+b-176$$

$$0=5a+b-250$$

Solving this system, we get

$$a=74, \ b=-120$$

EDIT:

As noticed by mathguy in the comments below, we can cut down on the work required. Once we find $n$, we can use the equation

$$0=a+3n^2-27n-14 $$

to find $a$:

$$0=a+3 \cdot(5)^2-27 \cdot (5) -14$$

$\implies$ $a=74$

Now we can use one of the original $3$ equations (the one with $n-1$ for the easiest computation?) to find $b$:

$$0=(5-1)^3-15(5-1)^2+74(5-1)+b $$

$\implies$ $b = -120$

$$a=74, \ b=-120$$


OK, so let's assume you never heard of Vieta's formulas.

Points where the graph crosses the $x$ axis are roots of the polynomial, and if you know the roots of the polynomial, call them $A, B, C$, then the polynomial can be written as $f(x) = (x-A)(x-B)(x-C)$. Are you supposed to know this much? If not, I would suggest the problem is unfair. So let's say you are allowed to assume this much.

Then $f(x) = x^3 - (A+B+C) x^2 + \cdots$ (or $-\cdots$). So this means $A+B+C = 15$. This is the Vieta formula for the sum of roots, even if you never heard of it (and to solve the problem, you don't need to know it even has a name).

Now $A,B,C$ are consecutive integers, so the middle one must be 5, and the others are 4 and 6. Plug back into $f(x)=(x-4)(x-5)(x-6)$ and find $a, b$ by brute force (multiply out the RHS).


Crossing the $x$ axis means you have a root. There is a neat formula, called Vieta's Formula (being alluded to in the comments) that for a monic polynomial of the form $$ x^n+a_{n-1}x^{n-1}+....+a_0=0 $$ The roots of this polynomial sum to $-a_{n-1}$.

So in your case you have an equation in one variable since you know the roots are consecutive. Let $r_1,r_1+1,r_1+2$ be your roots and use Vieta's.