This very simple question was asked of me recently and I was unable to give a convincing answer.
For example, if you were simply told to 'integrate $2x$'.
Then we would normally write $$\int 2x\,\mathrm{d}x=x^2 + C$$
But where did the $\mathrm{d}x$ come from?
In other words should it be 'integrate $2x\,\mathrm{d}x$'?
When we integrate $2x$, is the integration variable $\mathrm{d}x$ already specified and is part of the integration operation? Or, do we need to specify it before we carry out the integration?
Alternatively, if I wrote instead 'integrate $2x$ with respect to $x$'. Does this guarantee the integration variable $\mathrm{d}x$ is included?
I ask this question because there are times in physics and math when we in fact do specify the integration variable before hand. Using differential equations as an example if asked to solve $$x\frac{\mathrm{d}y}{\mathrm{d}x}=1$$ then in this simple case we would treat the $\frac{\mathrm{d}y}{\mathrm{d}x}$ as though it is a fraction and separate the variables such that $$\mathrm{d}y=\frac{1}{x}\mathrm{d}x\tag{1}$$ and then put integral signs in front $$\int\mathrm{d}y=\int\frac{1}{x}\mathrm{d}x\tag{2}$$ $$\implies y=\ln x + k$$ So for $(1)$, placing the integral signs out in front didn't introduce the integration variables like this: $$\int\mathrm{d}y\,\mathrm{d}y=\int\frac{1}{x}\mathrm{d}x\,\mathrm{d}x\ne (2)$$
I have shown both ways that there is room for confusion. So to summarize; Is it mandatory to specify the integration variables first (before taking the integral) or not?
The question "integrate $2x$" is a shorthand way of asking the following concrete question:
Or more precisely
So in effect you need to find a function with some specific properties. The variable $x$ does not come into picture. It is used only as a means to specify the function via a formula. The notation $\int f(x) \, dx$ is just a notation for the anti-derivative operation. The $\int$ and $dx$ are used together and the variable $x$ in $dx$ is used to match the variable $x$ which is used to specify the function $f$.
But the notation using $dx$ has its own advantages (in particular it helps us to remember the technique of substitution and formula for integration by parts) and hence used commonly. For derivatives we are lucky to have a notation $f'(x) $ as an alternative to $\dfrac{d} {dx} f(x) $ but we don't have corresponding notation for integral which avoids the $dx$.
Later when you study definite integrals and their theories you will find the $dx$ and $x$ being dropped and instead we use the simpler notation $\int_{a} ^{b} f$.