How to find the equation of the tangent line to $y=x^2+2x-4$ at $x=2$?

Here's an algebraic approach that avoids the explicit use of derivatives.

We are given a quadratic function $f(x) = x^2 + 2x -4$, and we want to find the equation of the tangent to the parabola $y = f(x)$ at the point $(2, 4)$. (Note that $f(2) = 2^2 + 2 \cdot 2 - 4 = 4$.) Assume that it is given by the equation $$ y = m(x-2) + 4, \tag{$\ast$} $$ where $m$ is its slope.

Let's consider the intersection of the parabola with the tangent; this is given by the system of equations $$ \begin{cases} y &=& x^2 + 2x - 4, \\ y &=& m(x-2)+4. \end{cases} $$ In other words, to find the intersection, we should solve the quadratic equation $ x^2 + 2x - 4 = m(x-2)+4$, or $$ x^2 + (2-m)x+(2m-8) = 0. \tag{$\ast\ast$} $$ using the quadratic formula like so $$ \frac{-(2-m)\pm\sqrt{(2-m)^2-4.1.(2m-8)}}{2.1} $$ Pictorially it is clear that the tangent meets the parabola meets in exactly one point, so we want $(\ast \ast)$ to have a unique solution. This implies that the discriminant of $(\ast \ast)$ vanishes: $$ \begin{array}{crcl} &(2-m)^2 - 4 \cdot (2m-8) &=& 0 \\ \implies \qquad & m^2 - 12m + 36 &=& 0. \end{array} $$ Conveniently (although this is not a numerical coincidence), this equation has a unique solution $m=6$: this is the solution we are after. Plugging $m=6$ in $(\ast)$, we get the equation of the tangent at $(2, 4)$ to be $y = 6x-8$.


Another method that can be used which is traditionally taught before derivatives is the limit (they're very similar but this is more intuitive):

Let $f(x) = x^2 + 2x - 4$ and $f'(x)$ be the tangent line at any point $a$ on the curve $f(x)$

Difference quotient:

$$f'(x) =\lim_{h \rightarrow 0}\frac{f(a + h) - f(a)}{h}$$

What this essentially means is that we we take the slope between two points $a$ and $a+h$ as $h$ gets very small or as $h\rightarrow0$ the point $a+h$ gets closer to $a$ until there mathematically the slope is tangent to the point $a$.

$$f'(x) =\lim_{h \rightarrow 0} \frac{[(a+h)^2+ 2(a+h) - 4] - [(a)^2 - 2(a) - 4]}{h} $$ $$=\lim_{h \rightarrow 0} \frac{[(h^2 + 2ah + a^2) + (2a + 2h) - 4] - [a^2 - 2a - 4]}{h}$$ $$=\lim_{h \rightarrow 0} \frac{h^2 + 2ah + 2h}{h}$$ $$=\lim_{h \rightarrow 0} h + 2a + 2$$ $$= 2a + 2$$

There's your formula for the slope at any value $a$ along the curve $f(x)$

Sorry, I misread your post now I see that you want the equation!

We'll right the formula out in the form $y = mx + b$

Well we can begin with finding the slope of the line at $a = 2$

$$m = 2a + 2$$ $$= 2(2) + 2$$ $$= 6$$

The point at $x = 2$ is $(2,4)$ since if we plug $x = 2$ into $f(x)$ we end up with $y = 4$

So,

$$y = mx+b$$ $$4 = 6(2) + b$$ $$4 - 12 = b$$ $$-8 = b$$

Therefore your equation is:

$$y = 6x - 8$$


General formulas

$y=f(x)=x^2+2x-4$
$m=f'(x)=2x+2$ Slope equation

Point-Slope equation of a line

$(y-y_0)=m_0\cdot(x-x_0)$

Compute actual values

$x_0 = 2$
$y_0=f(x_0)=f(2)=(2)^2+2(2)-4=4+4-4=4$
$m_0=f'(x_0)=f'(2)=2(2)+2=4+2=6$

Substitute values into the line equation

$y-4=6\cdot(x-2)$
$y=6\cdot(x-2)+4$
$y=6x-8$

General Formula for a tangent line to a Parabola @ point $x_0$ on the Parabola

$y=f'(x_0)\cdot(x-x_0)+f(x_0)$


Consider the point $(x_1,y_1)=(x_1,f(x_1))$ for the general curve $y=f(x)$ where tangent equation is desired.

Elementary differentiation familiarity is assumed. The tangent has general equation

$$ \dfrac{y-y_1}{x-x_1}= \dfrac {dy}{dx} \big{|}_{x=x_1.} $$

For the particular parabola given, plug in coordinate values

$$ \dfrac{y-4}{x-2}= 6 $$

Or,

$$ y=6x-8. $$