Why is $d(x^2)= 2xdx$? This seems a bit obvious, but I'm not clear on one part. My teacher had told us $d(x^2) =2xdx$.
However on asking why, we were told $d(x^2)= (x+dx)^2-x^2= 2xdx+(dx)^2$. We were told that we can ignore the $(dx)^2$ because its small.
For obvious reason I feel this step is wrong, why can we ignore $(dx)^2$, is their any other way of getting the result?
 A: When treating the differential operator like a fraction, you might see this:  $$\frac d {\color{blue}{dx}}(x^2)=2x\implies d(x^2)=2x\,\color{blue}{dx}.$$
A: We have $\Delta(x^2) = 2x \Delta x + (\Delta x)^2$. Note that $x^2 = y$ so, we have $\Delta(x^2) = \Delta y$. Thus, we have $\Delta y = 2x\Delta x +(\Delta x)^2$. Divide both sides by $\Delta x$ and we get $\frac{\Delta y}{\Delta x} = 2x + \Delta x$. Now, we take the limit as $\Delta x$ approaches $0$, giving us $dy/dx = 2x$. Note that $dy/dx$ is the limit as $\Delta x$ goes to $0$ of $\Delta y/\Delta x$ by definition.
A: If you think about it in terms of differentials, let $y = x^2$:
$$ dy = \frac{dy}{dx} dx $$
$$ d\left(x^2\right) = \left(\frac{d}{dx}x^2\right) dx $$
$$ d(x^2) = 2xdx $$
A: by definition:
$$\frac{df(x)}{dx}=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}\tag{1}$$ if we let $f(x)=x^2$ then we get:
$$\frac{d(x^2)}{dx}=\lim_{h\to0}(2x+h)=2x$$
now remember that whilst $dx$ represents a small change, it is non-zero and with the chain rule we can say:
$$df=\frac{df}{dx}dx\tag{2}$$
which for us means:
$$d(x^2)=2xdx$$

I think where you are getting confused with "ignoring" this $(dx)^2$ term is in finding the limit to define the derivative. There are some other interesting cases that we can derive where we end up with terms like:
$$\sin(dx)$$
where we say that this is equal to $dx$ but this is not the same situation. Hope this helps

One interesting way of visualising the derivative is using equal sided shapes (i.e. squares, cubes etc.) and looking at what the change in area/volume/hyper-volume is as we make incremental changes to the lengths of sides. For example, lets take a normal square of side length $x$. The area of this square will be $x^2$. Now lets increase the length of all sides by a small amount $\delta x$. The new length of the sides will be $x+\delta x$, which makes the new area $(x+\delta x)^2$. Now if we expand this out we get:
$$A(x)=x^2$$
$$A(x+\delta x)=(x+\delta x)^2+x^2+2x\delta x+(\delta x)^2$$
The change in the area, which we will denote $\delta A$ will be as follows:
$$\delta A=2x\delta x+(\delta x)^2$$
teachers often use this to define the derivative by saying "the differential of the area is equal to the change in area divided by the change in side length" and whilst this is true we get given the following expression:
$$\frac{\delta A}{\delta x}=2x+\delta x$$
Which can confuse many people as we clearly have this additional $\delta x$ term which does not agree with the limit definition of the derivative at first appearance. However, if you look at the limit we took we did in fact have a term of $h$ left over but since $h\to 0$ it does not change our value of $\frac{df}{dx}$. The same is true when we talk of it in this form, whilst $\delta x$ has a value which is not close to zero we cannot negate it from our equations, but for small enough values the difference in the order of magnitudes between $x$ and $\delta x$ means that as $\delta x$ gets smaller it has an unnoticeable impact on our expression
A: By definition, $df$ is the linear part of $\Delta f$ when you give an increment $dx$ to $x$. You first compute $\Delta x^2$ as you did. Then you only keep the linear part in $dx$: $dx^2=2xdx$.
