# How do I find two tangent lines intersect at a specific point on the trace of a function?

Let $f(x) = x^4-60x^3+767x^2+1980x-26000$.

1. Find a equation for the tangent line to the graph of $f(x)$ at the point $(a,\,f(a))$. Give you answer as an equation in variables $y$, $x$, and $a$.

2. Show that there are exactly two real-valued points $(a_1,\,f(a_1))$ and $(a_2,\,f(a_2))$ such that the tangent line to $y=f(x)$ at these points passes through the point $(30, 50000)$.

For the first question,

Clear[f]
f[x_] := x^4 - 60*x^3 + 767*x^2 + 1980*x - 26000
a = 1;
Print["The equation of the tangent line to the given curve at a=1 is:"]
y = f'[a]*(x - a) + f[a] // Expand
pl1 =
Plot[{f[x], y}, {x, -20, 50},
PlotStyle -> {Blue, Red}, Epilog -> {PointSize[Large], Point[{a, f[a]}]}]


For the second problem, I had difficulty finding the two points on the trace of $f(x)$ that will make both tangent lines intersect at a specific point $(30, 50000)$.

• Maybe N@Solve[Thread[{x, f[x1] + D[f[x1], x1] (x - x1)} == {30, 50000}], {x, x1}]? – march Feb 22 '18 at 4:49
• This seems to be a homework that can be solved without specific use of MMA. I vote to close it. – José Antonio Díaz Navas Feb 22 '18 at 10:20

I suspect there is an error in the function definition. "Correcting" this:

f[x_] := x^4 - 60 x^3 + 767 x^2 + 1980 x - 26000;
ex[p_, s_] := {p, f[p]} + s {1, D[f[x], x] /. x -> p}
pt = {30, 50000};
sol = Line[{{a, f[a]}, ex[a, b]}] /.
NSolve[ex[a, b] == pt, {a, b}, Reals];
Plot[f[x], {x, 0, 40},
Epilog -> {sol, Red, PointSize[0.02],
Point[{sol[[1, 1, 1]], sol[[2, 1, 1]]}], Green, Point[pt]},
PlotRange -> {-100000, 60000}] 