Taylor series for df

So I understand if I have f(x) under a taylor expansion I can write the terms up to order 2 terms as:

f(x)= f(a) + f'(a)(x-a) + [f''(a)*(x-a)^2]/2! +...

so I would imagine

df(x)/dx = f'(a) + [f''(a)d(x-a)^2/dx]/2! + ...

or rather

df(x) = f'(a)dx + [f''(a)*d(x-a)^2]/2! + ...

Now the notes I am reading state something like this

df(x) = f'(x) dx + [f''(x) (dx)^2]/2! + ...

and I am strugling to see how d(x-a)^2 = (dx)^2 and why they replaced the a 's with x's everywhere seemlingly. Throught my course it sometimes seems that d(x^2) is used somewhat interchangibly with (dx)^2 even thought im pretty sure they arent the same.But yeah even without the problems with the a's i fail to see how d(x^2) becomes something like (dx)^2...

• So yeah long story short: Why is df(x) = f'(x) dx + (1/2) * f''(x) (dx)^2 +(1/3!) f'''(x) (dx)^3 + ... Commented Oct 28, 2015 at 12:15

If you assume that $x + \Delta x = a$ and you look at $x$ and $x+\Delta x$ then the first line reads $$f(x+\Delta x) -f(x) = f'(x) \Delta x + 1/2 f''(x) (\Delta x)^2 + \cdots$$ where we use that $x+\Delta x -x = \Delta x$. For small $\Delta x$ the lhs is $df(x)$.
First, note that Taylor series approximates the function only in neighborhood of the point 'a'. You can represent it as $|{x-a}|<\Delta{x}$. So, the expression you read in your notes can be obtained once you take limits i.e., replace $x-a$ by $\Delta{x}$ and then replace it with $dx$ as $\Delta{x}->0$. Generally speaking, when you are using epsilon-delta definition (as you are doing in your Taylor series approximation), it is best not to mix it with point derivatives. If you wish to obtain the derivative, then do so by taking limits.