implicit differentiation: what happened to $dx^2$? I have been watching a few videos(3b1b youtube) on the essence of calculus. the first few videos helped me understand that the idea of a derivative is to check what happens to the ratio $dy/dx$ when the changes to the value of $dx$ approaches zero.
For example, in the case $y=x^2$ when I make a small change ($dx$) to the value of $x$, the change in y ($dy$) would be: $dy= 2xdx + dx^2$, since the value of y actually represents the area of a square with edges with the length $x$. When you add $dx$ to the value of $x$ you are adding some slivers of area which are represented by the formula $dy= 2xdx + dx^2$ (in the video this is illustrated in a visual fashion).
From this follows: $dy/dx= 2x + dx$, and when $dx$ gets smaller and smaller the ratio $dy/dx$ approaches the value $2x$. From this we can infer that the slope of the line tangent to the graph is 2x. That is the value we are approaching in which $dx=dy=0$. So far so good.
But then when I got to implicit differentiation things started getting weird...
the example was a unit circle and the question was what is the slope of a line which is tangent to a certain point$(a,b)$ on the circle. the way to solve the problem was to set up an equation which ensures we stay on the circle when we increase the value of $x$, namely: $x^2 + y^2 = r^2$. we add $dx$ to $x$ and $dy$ to $y$ but only in a way which leaves this equation valid. then we differentiate with respect to $x$ and $y$, meaning that we are going to see what happens when $dx$ and $dy$ approach $0$. from this we will be able to find the ratio $dy/dx$. ok, but this is only if we can get this ratio from the equation. fine, so how do we differentiate?-like this: $2xdx +2ydy = 0$. and here comes my question: what happened to $dx^2$ and $dy^2$? in the simple case in the first paragraph we divided the whole equation by $dx$ so that we can find the ratio $dy/dx$ and then we could say that $dx$ approaches $0$ and we can ignore it. from this we infer that the ratio approaches $2x$. is this what's happening here too? meaning:
$2xdx + dx^2 + 2ydy + dy^2 = 0$(no change in $r^2$)
--> $2ydy =-2xdx - dx^2 - dy^2$
--> $dy/dx = -2x/2y -dx^2/dx2y -dy^2/dx2y$
then maybe we can say that as $dx$ and $dy$ approach $0$ so do the two terms on the right.
Is this right or did i get something basic very wrong?
 A: Intuition
To get a feel for the intuition, it makes some sense to write
$$
2x\mathrm{d}x+\left(\mathrm{d}x\right)^{2}+2y\mathrm{d}y+\left(\mathrm{d}y\right)^{2}=0
$$
$$
\text{so }2y\mathrm{d}y=-2x\mathrm{d}x-\left(\mathrm{d}x\right)^{2}-\left(\mathrm{d}y\right)^{2}\text{.}
$$
The next line was a little off algebraically, but we can certainly
do more algebra to understand things better. Divide both sides by
$2y\mathrm{d}x$ to get:
$$
\dfrac{\mathrm{d}y}{\mathrm{d}x}=-\dfrac{x}{y}-\dfrac{\mathrm{d}x}{2y}-\dfrac{\left(\mathrm{d}y\right)^{2}}{2y\mathrm{d}x}\text{.}
$$
Then we can factor out a $\mathrm{d}x$ from the last two terms like
this:
$$
\dfrac{\mathrm{d}y}{\mathrm{d}x}=-\dfrac{x}{y}-\mathrm{d}x\left(\dfrac{1}{2y}-\dfrac{\left(\mathrm{d}y\right)^{2}}{2y\left(\mathrm{d}x\right)^{2}}\right)$$
$$=-\dfrac{x}{y}-\mathrm{d}x\left(\dfrac{1}{2y}\left(1-\left(\dfrac{\mathrm{d}y}{\mathrm{d}x}\right)^{2}\right)\right)\text{.}\tag{1}
$$
Assuming $y$ isn't $0$, we can note that as $\mathrm{d}x$ approaches
$0$, that part on the right does too, since $y$ and $\dfrac{\mathrm{d}y}{\mathrm{d}x}$
are just numbers. That's where we get $\dfrac{\mathrm{d}y}{\mathrm{d}x}=-\dfrac{x}{y}$.
Careful Manipulation
A problem with the above calculation is that sometimes $\dfrac{\mathrm{d}y}{\mathrm{d}x}$
was intended as a limit as a change in $x$ approaches $0$, and other
times $\mathrm{d}x$ was a particular change in $x$ that we would
have approach $0$ later. We can be more careful to make this clear.
When we do implicit differentiation, we assume that in some region
(e.g. maybe $x$ is in the open interval $\left(-r,r\right)$) that
$y$ can be written as a differentiable function of $x$. Let's call
that function $f$, so that $y$ is usually shorthand for $f\left(x\right)$.
$x^{2}+y^{2}=r^{2}$ means that for any value of $x$ under discussion,
$x^{2}+\left(f(x)\right)^{2}=r^{2}$.
Let's say $a$ is a particular value of $x$ we are interested in,
and $\Delta x$ is some small number (positive or negative). Then
$a^{2}+\left(f(a)\right)^{2}=r^{2}$ and $\left(a+\Delta x\right)^{2}+\left(f\left(a+\Delta x\right)\right)^{2}=r^{2}$.
We can subtract one equation from the other to get:
$$
\left(a+\Delta x\right)^{2}-a^{2}+\left(f\left(a+\Delta x\right)\right)^{2}-\left(f(a)\right)^{2}=0
$$
$$
\text{so }2a\Delta x+\left(\Delta x\right)^{2}+\left(f\left(a+\Delta x\right)\right)^{2}-\left(f(a)\right)^{2}=0\text{.}\tag{2}
$$
To do more with this, we need to understand the difference in the
squares of the values of $f$ in terms of the derivative. The derivative
at $a$ (sometimes denoted $\left.\dfrac{\mathrm{d}y}{\mathrm{d}x}\right|_{x=a}$)
is $f'(a)={\displaystyle \lim_{h\to0}}\dfrac{f\left(a+h\right)-f(a)}{h}$.
And since $\Delta x$ is small, we have $f'(a)\approx\dfrac{f\left(a+\Delta x\right)-f(a)}{\Delta x}$
with the approximation getting better (arbitrarily good) as $\Delta x$ gets smaller.
Rewriting, we have $f\left(a+\Delta x\right)\approx f'(a)\Delta x+f(a)$.
If we substitute this into the equation (2) above, we get the following
sequence of approximations, each of which gets better as
$\Delta x$ approaches $0$:
$$
2a\Delta x+\left(\Delta x\right)^{2}+\left(f'(a)\Delta x+f(a)\right)^{2}-\left(f(a)\right)^{2}\approx0
$$
$$
\text{so }2a\Delta x+\left(\Delta x\right)^{2}+\left(f'(a)\Delta x\right)^{2}+2f(a)f'(a)\Delta x\approx0
$$
$$
\text{so }f'(a)\approx\dfrac{-2a\Delta x-\left(\Delta x\right)^{2}-\left(f'(a)\Delta x\right)^{2}}{2f(a)\Delta x}
$$
$$
\text{so }f'(a)\approx-\dfrac{a}{f(a)}-\Delta x\left(\dfrac{1}{2f(a)}-\dfrac{\left(f'(a)\right)^{2}}{2f(a)}\right)$$
$$=-\dfrac{a}{f(a)}-\Delta x\left(\dfrac{1}{2f(a)}\left(1-\left(f'(a)\right)^{2}\right)\right)\text{.}\tag{3}
$$
Since this approximation gets arbitrarily good as $\Delta x$ gets smaller,
we have $f'(a)=-\dfrac{a}{f(a)}$, which you could write as $\dfrac{\mathrm{d}y}{\mathrm{d}x}=-\dfrac{x}{y}$ if using $x$ instead of $a$.
Finally, note the similarity between line (3) above and line (1) from the Intuition section. The main algebra was essentially the same, but this careful calculation helped to justify the work in the intuition section.
A: We begin with the set $C_r=\{(x,y)|x^2+y^2=r^2\}$ for some $r>0$.
Suppose for a given $(x,y)\in C_r$, that $(x+\Delta x,y+\Delta y)\in C_r$ also.  Then, we have
$$\begin{align}
(x+\Delta x)^2+(y+\Delta y)^2&=r^2\tag1
\end{align}$$

Expanding $(1)$ and using $x^2+y^2=r^2$ reveals
$$\begin{align}
2y\Delta y=-2x\Delta x-(\Delta x)^2-(\Delta y)^2\tag2
\end{align}$$

Dividing $(2)$ by $2y\Delta x$, we find that for $y\Delta x\ne 0$
$$\frac{\Delta y}{\Delta x}=-\frac{x}{y}-\frac1{2y}\color{blue}{(\Delta x)}-\frac1{2y}\color{red}{(\Delta x)}\color{green}{\left(\frac{\Delta y}{\Delta x}\right)^2}$$

Letting $\Delta x\to 0$ in $(3)$ yields
$$\frac{dy}{dx}=-\frac{x}{y}-\frac1{2y}\times\color{blue}{ (0)}-\frac1{2y} \times \color{red}{(0)}\times \color{green}{\left(\frac{dy}{dx}\right)^2}\tag4$$
whence simplifying $(4)$ results in the coveted relationship
$$\frac{dy}{dx}=-\frac xy$$
A: If $y=f(x)$, when we write $\color{blue}{dy=f^\prime(x)dx}$ we really mean $f^\prime(x)=\lim_{\delta x\to0}\frac{\delta y}{\delta x}$ where $\delta y:=f(x+\delta x)-f(x)$. Another way to write this is $\delta y\in f^\prime(x)\delta x+o(\delta x)$ (although you'll often see people use $=$ instead of $\in$). The exact formula for $\delta y$ will include $\delta x^2$ etc. terms, but the blue equation can be considered exact if we introduce an algebra of "infinitesimals" satisfying the axiom $dx^2=0$. (Yes, I realise that makes expressions like $ds^2=dx^2+dy^2$ very confusing; any "algebra of infinitesimals" to deal with that needs to be a bit different, but that's a story for another time.)
A: $dy=2xdx+dx^2, $ so far not so good. After differentiating it should not be continuing there anymore.
$$dy=d(x^2)=2xdx $$
