I'm having some difficulty understanding the formulas to find the slope of a tangent line. As per my textbook, the first formula we received is presented below:
The tangent line to the curve $y = f(x)$ at the point $P(a, f(a))$ is the line through P with slope
$$m = \lim_{x\to a}\frac{f(x)-f(a)}{x-a}$$
provided that the limit exists.
Immediately after we received the above formula, we are given an alternate one in the form of a difference quotient:
$$m = \lim_{h\to 0}\frac{f(a+h)-f(a)}{h}$$
The part where I'm experiencing difficulty is differentiating the two formulas. When I watched this video on Khan Academy, I walked away with the impression that the second formula was simply an alternate form of the first one. In my textbook, however, the author provides a diagram (see attached image) and states that if $h = x - a$, then $x = h + a$ and therefore we can use the second formula to find the slope of the tangent line.
Are we always able to use the second formula instead of the first one, or might there be a situation where we are unable to use the second one and must rely on the first? If the latter is true, what might an example situation be?
The two formulas are entirely equivalent and merely reflect different ways to think: the first one focuses on the fact that you have two separate points $a$ and $x$ close to one another, while the second one focuses on the fact that you have a base point $a$, and a secondary point close to it (a distance of $h$ away).