The "school identities with derivatives", like $$ (x^2)'=2x $$ are not identities in the normal sense, since they do not admint substitutions. For example if we insert $1$ instead of $x$ into the identity above, the appearing equality will not be true: $$ (1^2)'=2\cdot 1. $$ That is why when explaining this to my students I present the derivative in the left side as a formal operation with strings of symbols (and interpret the identity as the equality of strings of symbols).
This however takes a lot of supplementary discussions and proofs which look very bulky, and I have no feeling that this is a good way to explain the matter. In addition, people's reaction to this my question makes me think that there are no texts to which I could refer when I take this point of view.
I want to ask people who teach mathematics how they bypass this difficulty. Are there tricks for introducing rigor into the "elementary identities with derivatives" (and similarly with integrals)?
EDIT. It seems to me I have to explain in more detail my own understanding of how this can be bypassed. I don't follow this idea accurately, in detail, but my "naive explanations" are the following. I describe Calculus as a first-order language with a list of variables ($x$, $y$,...) and a list of functional symbols ($+$, $-$, $\sin$, $\cos$, ...) and the functions which are not defined everywhere, like $x^y$, are interpreted as relation symbols (of course this requires a lot of preparations and discussions, that is why I usually miss these details, and that is why I don't like this way). After that the derivative is introduced as a formal operation on terms (expressions) of this language, and finally I prove that this operation coincide with the usual derivative on "elementary functions" (i.e. on the functions which are defined by terms of this language).
Derek Elkins suggests a simpler way, namely, to declare $x$ a notation of the function $t\mapsto t$. Are there texts where this is done consistently? (I mean, with examples, exercises, discussions of corollaries...)
@Rebellos, you identity $$ \frac{d}{dx}(x^2)\Big|_{x=1}=2\cdot 1 $$ becomes true either if you understand the derivative as I describe, i.e. as an operation on expressions (i.e. on terms of the first order language), since in this case it becomes a corollary of the equality $$ \frac{d}{dx}(x^2)=2\cdot x, $$ or if by substitution you mean something special, not what people usually mean, i.e. not the result of the replacement of $x$ by $1$ everywhere in the expression (and in this case you should explain this manipulation, because I don't understand it). Anyway, note, that your point is not what Derek Elkins suggests, since for him $x$ means a notation of the function $t\mapsto t$, it can't be substituted by 1).