TITLE: Is differentiating on both sides of an equation allowed?
QUESTION [34 upvotes]: Let's say we have $x^2=25$
So we have two real roots ie $+5$ and $-5$.
But if we were to differentiate on both sides with respect to $x$ we'll have the equation $2x=0$ which gives us the only root as $x=0$.
So does differentiating on both sides of an equation alter it? If it does, then how do we conveniently do it in Integration by substitutions?
If not then what exactly is going on here ?

REPLY [6 votes]: It depends on what you intend to mean when you write
$$
x^2 = 25.
$$
If $x$ is a real number, then the assertion "$x^2 = 25$" simply means what most people understand: equality between two real numbers. It is implied that $x$ is a real number too. The notion of differentiating a real number (with respect to ... nothing?) is not commonly defined and should be considered invalid.
If you use "$x^2$" as a shorthand for the function $x \mapsto x^2$, and $25$ as a shorthand for the function $x \mapsto 25$, then the assertion "$x^2 = 25$" would mean that the two functions are equal. (Two functions $f, g: \mathbb R \to \mathbb R$ are equal if and only if $f(x) = g(x)$ for all $x \in \mathbb R$.) Under this assumption, differentiation (with respect to the only variable) seems like a valid concept. Whether it yields a "true" statement or not is a separate matter. In this particular example, the initial assertion is false, so it is not a surprise that the conclusion $x = 0$ (which says that the identity function $x \mapsto x$ is equal to the zero function $x \mapsto 0$) is also nonsensical.
I think you actually can manufacture some context in which $x^2 = 25$ makes sense both before and after differentiation. For example, if $x$ is a name of a function $x: \mathbb R \to \mathbb R$, $25$ stands for the constant function $y \mapsto 25$, and $x^2$ stands for the function $x^2: y \mapsto x(y)^2$, then the statement "$x^2 = 25$" asserts that the function $x^2$ is equal to the function $25$. Differentiating this equation would yield $2x x'= 0$, by which I actually mean the function $y \mapsto 2 x(y) x'(y)$ and the function $y \mapsto 0$ are equal. (This suggests that $x$ should be a constant function if it is differentiable.)