TITLE: Find a and b of $x^3+ax^2+bx−26=0$
QUESTION [5 upvotes]: I am doing practise papers and one of the questions is:

The cubic equation $x^3+ax^2+bx−26=0$ has $3$ positive, distinct,
  integer roots.
Find the values of $a$ and $b$

The mark scheme says:

$3$ roots are $1, 2, 13$. Equation is $x^3-16x^2+41x-26=0$

I'm guessing this has something to do with the factor theorem thing where $x-a$ is a factor if $f(a)=0$ but with 3 unknowns I don't get how you find any of these.
I tried just putting $x$ as $1$:
$$
1^3+a+b-26=0
$$
$$
a+b=25
$$
then doing the same with $2$:
$$
2^3+4a+2b-26=0
$$
$$
4a+2b=18
$$
and after subsituting the two equations I got the answer of a $a=-16$ and $b=41$. However, I realised this was just by chance that these numbers were factors (it didn't work with $x=3$ for example).
What is the proper way to solve this?

REPLY [2 votes]: Using Gauss Lemma (also called Rational Root Theorem), the integer solutions can only be factors of $26$, in this case positive factors. This leaves us with  $1$, $2$, $13$ or $26$. Also, since the roots are distinct and by Viete's formula, their product must be $26$, the roots are thus $1$, $2$ and $13$. Thus, again by Viete's formula, $a=-16$ and $b=41$.