Relationship Between Coefficients and Root For Roots of a Quadratic in a Given Ratio

Suppose the roots of the quadratic  
\[x^2+ax+b\]
  are in the ratio 2:1.
What is the relationship between  
\[a\]
  and  
\[b\]
?
Let the roots of the quadratic be  
\[x_1, \: x_2\]
, then we can write the quadratic as  
\[(x-x_1)(x-x_2)\]
.
Using the ratio condition, let  
\[x_1=2x_2\]
  so the last expression becomes  
\[(x-2x_2)(x-x_2)=x^2-2x_2-x_1+2x^2_2\]
  and put this equal to the quadratic in question.
\[x^2-2x_2-x_1+2x^2_2=x^2-3x_2+2x^2_2=x^2+ax+b\]

Then  
\[a=3x_2, \: b=2x_2^2\]
.