Finding the tangent line that intersects a quartic at two points. I'm trying to find a straightforward calc solution to this question. I found an algebraic solution but I don't think it's the quickest way to do it. Thanks in advance!
Find the linear function $g(x)=mx+b$ whose graph is tangent to the graph of $f(x)=x^4-6x^3+13x^2-10x+7$ at two points.
Here's my algebraic solution: Let $(x_1,f(x_1))$ and $(x_2,f(x_2))$ be the points where $g(x)$ is tangent to $f(x)$. Let's form the function $h(x)=f(x)−g(x)$, so $h(x)=x^4−6x^3+13x^2−(10+m)x+7−b$. The zeros of $h(x)$ are $x=x_1$ and $x=x_2$and we also know that $h(x)≥0$ for all $x$. What's nice is that $h(x)$ can also be written as $h(x)=(x−x_1)^2(x−x_2)^2$. We can expand this to get $h(x)=x^4−2(x_1+x_2)x^3+(x^2_1+4x_1x_2+x^2_2)x^2−2(x^2_1x_2+x_1x^2_2)x+x^2_1x^2_2$. By comparing the two forms of $h(x)$ we can get that $x_1=1$ and $x_2=2$ (or vice versa) and therefore $m=2$ and $b=3$. I want to see a calc solution since this question appeared on a calc test.
 A: Let $h(x)=f(x)-g(x)$ be the distance between the functions. Note that $h(x)$ is a monic quartic polynomial. If the tangent line $g(x)$ intersects the graph of $f(x)$ at $x=c$ and $x=d$, then $h(x)$ must vanish $x=c$ and $x=d$, so the monomials $x-c$ and $x-d$ divide $h(x)$.
Additionally, since the derivatives of $f(x)$ and $g(x)$ match at $x=c$ and $x=d$, the derivative of $h'(x)$ must vanish there as well. This means $h(x)$ must be divisible by at least $(x-c)^2$ and $(x-d)^2$. The only such monic quartic is $h(x)=(x-c)^2(x-d)^2$.
Thus we are seeking $c$ and $d$ such that 
$$(x-c)^2(x-d)^2=x^4-2(c+d)x^3+(c^2+d^2-4cd)x^2-2(cd^2+c^2d)x+c^2d^2\\=x^4-6x^3+13x^2-10x+7-(mx+b)$$
So from the cubic term we have $c+d=3$, and the quadratic term gives $c^2+d^2-4cd=13.$ Substitution yields a quadratic with solutions $c=1,2$. Then $12=m+10$ so $m=2$, and $7-b=4$ so $b=3.$ Thus $g(x) = 2x+3.$
A: One solution is a variation on the familiar concept of completing the square.
You have $f(x)=x^4-6x^3+13x^2-10x+7$ and you are seeking a linear function $g(x)=mx+b$ such that the difference $f(x)-g(x)$ has a pair of doubly degenerate zeroes.  That makes the difference a squared quantity:
$f(x)-g(x)=x^4-6x^3+13x^2-(m+10)x+(7-b)=(x^2+a_1x+a_0)^2$
Now just expand the square and equate terms of like degree, back substituting previously determined quantities in each case.  The solution practically jumps out at you with no resistance:
Degree 4:  $1=1$ of course
Degree 3: $2a_1=-6$, thus $a_1=-3$
Degree 2:  $2a_0+(a_1)^2=13$, thus $a_0=2$
Degree 1:  $2a_0a_1=-(m+10)$, thus $m=2$
Degree 0:  $(a_0)^2=7-b$, thus $b=3$
So $g(x)=mx+b=2x+3$.
In general you expect real values for all the parameters when you put in a real quartic function.  But the points of tangency could have imaginary coordinates.  Here they exist in the real plane because the squared quantity, $(x^2+a_1x+a_0)^2$, has real zeroes.
