Question about infinitesimals In physics for example in electrostatics we consider infinitesimal quantities like $dq$ which means a very small charge which we integrate over the entire body. Now the meaning of $dy$ or $dx$ means a small change in $y$ and the corresponding change in $x$. When we consider quantities like $d$q I do not understand what they are for example in an equation we can multiply $dq$ on any side and integrate it using appropropriate limits. What do these quantities means?
 A: Notice that when we talk about a differential charge, $dq$, we also are refering this charge to a continuous distribution, i.e. a linear, superficial or volumetric charge distribution. These three types are characterized by charge densities $\lambda, \sigma$ or $\rho$ respectively. You can define these quantities as the charge per length, surface or volume. Normally, in electrostatics when we use the term $dq$ it is immediately changed by
$$\begin{cases}
dq=\lambda dl\\
dq=\sigma dS \\
dq=\rho dV
\end{cases}$$
depending on the situation you're in. Then, the "spatial" differentials are referred to the coordinate system you're using and then you recover the $dx,dy$ and other possible quantities. With this reasoning, you can think of $dq$ as the charge contained in a differential length in a linear distribution, or the charge contained in a differential surface on a surface distribution, or the same for volume.
A: 
in physics for example when calculating the electric field due to a
ring the term dq is not used as a change in a function rather it is
used as a very small charge. I dont understand how are these things
the same

(emphasis mine)
I don't quite understand what your doubt is. Consider a charged rod extending from $x=0$ to $x=L$ with linear charge density $\lambda(x)$.
The charge $q$ contained in the segment of the rod from $x=0$ to $x\le L$ is a function of $x$ and given by
$$q(x) = \int_0^x\mathrm{d}x'\lambda(x')$$
thus
$$\frac{dq(x)}{dx}=\lambda(x)\Rightarrow dq(x) = \lambda(x)dx$$
and the total charge $Q$ on the rod is
$$Q = q(L) = \int_0^L\mathrm{d}x'\lambda(x')$$
A: The differentials are the artifacts that remain from the way we define derivatives and integrals. See e.g. the definition of a derivative:
$$f'(x)\equiv \frac{\mathrm{d}f(x)}{\mathrm{d}x}=\lim\limits_{\Delta x\to0}\frac{\Delta f(x)}{\Delta x},\tag1$$
where we denote
$$\Delta f(x)=f(x+\Delta x)-f(x).\tag2$$
Notice how the symbol $\mathrm d$ appears as the "result" of the limiting process from the symbol $\Delta$. It encapsulates both the difference and the limit.
Now, we do something similar for integrals. Namely, we can define a definite integral as the limit of Riemann sums:
$$\int\limits_a^b f(x)\,\mathrm{d}x = \lim\limits_{\Delta x\to0} \sum\limits_i f(x_i)\Delta x_i,\tag3$$
where $\Delta x$ is the largest of $\Delta x_i$ for all $i$. In a special case, where $\Delta x_i=\Delta x$ for all $i$, we get a simpler form of $(3)$:
$$\int\limits_a^b f(x)\,\mathrm{d}x = \lim\limits_{\Delta x\to0} \sum\limits_i f(x_i)\Delta x.\tag4$$
Now, in physics it's usual to see a non-rigorous manipulation of these $\mathrm{d}\square$ objects. When doing this, we pretend that, instead of taking the limit $(1)$ or $(3)$, we simply work with very small quantities $\Delta x$ and $\Delta f(x)$, completely ignoring the limiting process. For small enough deltas the results will be approximately$^\dagger$ equal to the values of the derivatives or integrals that we are computing.
With this approximate treatment in mind, we can often intuitively work with the differentials, getting the ideas like "multiply by $\mathrm{d}x$ and sum up" to get the primitive function (which actually means "multiply by $\Delta x$", strictly speaking), the idea of the chain rule of differentiation
$$\frac{\mathrm{d}f}{\mathrm{d}x}=\frac{\mathrm{d}f}{\mathrm{d}y}\frac{\mathrm{d}y}{\mathrm{d}x},$$
the Newton-Leibniz theorem, change of variables in integration and others. These theorems can indeed be proved rigorously, but to motivate them it's often useful to consider the intuitive manipulation of infinitesimals.
See also: What does $dx$ mean without $dy$? at Math.StackExchange.

$^\dagger$ This can be rigorously formulated as the $\varepsilon$-$\delta$ definition of limit
A: One way to look at it is to consider $dx$, $dy$, $dq$, and the like, as mere symbols that are useful in manipulating equations. To do that they don’t actually need to carry any physical meaning. Only at the end of these manipulation you must arrive at expression like $\frac{dx}{dt}$ which have a meaning, in this case the derivative.
Of course, the rules used for the manipulations must be allowed based on mathematical theorems. As far as I know, this was strictly speaking not the case at the time Newton and Leibniz invented Calculus. Only later pragmatic usage was replaced by sound mathematical justifications.
