Finding a function given a tangent to the curve I have got the following maths problem:

In the curve $y=x^2+ax+b$ where $a$ and $b$ are constant.
The tangent to the curve where $x=1$ is $2x+y=6$. Find the values of $a$ and $b$.

I am just unsure how I would go about answering this.
 A: Hint. One may recall that, an equation of a tangent to the curve of $f$ at $x=1$ is given by
$$
y-f(1)=f'(1)(x-1),
$$ here $f(x)=x^2+ax+b$.
A: Hints:
The tangent is the line $\;y=-2x+6\;$ , so you already know that for $\;f(x)=x^2+ax+b\;$ you have $\;f'(1)=-2\;$ . 
After you've found $\;a\;$ substitute in $\;f(x)\;$, and then: since the tangent line passes through the point $\;(1,4)\;$ , you also know that $\;f(1)=4\;$ , and now find $\;b\;$ .
A: Without derivatives:
The intersection points between the parabola and the straight line are solutions of
$$\begin{cases}y=x^2+ax+b\\2x+y=6.\end{cases}$$ After elimination of $y$,
$$x^2+(a+2)x+b-6.$$
When there is tangency, this equation must have a double root, hence a null discriminant.
$$(a+2)^2-4(b-6)=0.$$
And as the root occurs at $x=1$,
$$1+a+2+b-6=0.$$
Eliminate $b$ and solve for $a$, giving two solutions.
A: Since the involved function is just a quadratic function, you can try not to use any calculus.
The question can be translated as follows:
The equation $x^2+ax+b= 6-2x$ has a double root at $x=1$,
or even  $f(x)=x^2+(a+2)x+(b-6)$ can be factorized as $f(x)=k(x-1)^2$, by factor theorem.

Edit Seems my answer above lead to confusions. Just let me add a few words to elaborate:

The equation $x^2+ax+b= 6-2x$ has a double root at $x=1$.

This line is easy. For a quadratic curves, a tangent line can only intersect the quadratic curve at one and only one point. Thus, after solving $(E)$: $\begin{cases} y=x^2+ax+b \\ 2x+y=6 \end{cases}$, we can obtain one and only one solution. By making $y$ as the subject for the line equation, be obtain $y=6-2x$. Substitute this to another equation, $x^2+ax+b= 6-2x$ has a double (or repeated) real root at $x=1$.

$f(x)=x^2+(a+2)x+(b-6)$ can be factorized as $f(x)=k(x-1)^2$, by factor theorem.

From the first part, we obtain  $x^2+(a+2)x+(b-6)=0$ has only one root of multiplicity 2. Write $f(x)=x^2+(a+2)x+(b-6)$. By factor theorem, we can only write $f$ as multiple of $(x-1)^2$. Then $x^2+(a+2)x+(b-6) \equiv kx^2-2kx+k$.
Then we have $k=1, a=-4, b=7$.

No matter what method we used to find the values of $a$ and $b$, we just need to check that the above pair of value $a$ and $b$ is sufficient for $y=x^2+ax+b$ to have a tangent line $2x+y=6$.
Take $f(x)=x^2-4x+7$, $f'(x)=2x-4 \Longrightarrow f(1)=-2$. Then the slope of tangent line $= -2$. $f(1)=1-4+7=4$ The tangent line also passes through $(1,4)$. Then by point slope form, the equation of tangent line is $(-2)(x-1)=y-4 \iff 2x+y=6$.
