Why we can't differentiate both sides of a polynomial equation? Suppose we had the equation below and we are going to differentiate it both sides:
\begin{align}
&2x^2-x=1\\
&4x-1=0\\
&4=0
\end{align}
This problem doesn't seems to happens with other equation like $\ln x =1$ or $\sin x = 0$, we can keep differentiating these two without getting "$4=0$", for example. This why I asked about polynomials.
PS: I'm not trying to solve any of these equations by differentiating then. But differentiation or integration helps and solving equations?
I remember that sometimes to solve trigonometry equtions like $\sin x = \cos x$ we had to square both side so we could use the identity $\sin^2x + \cos^2x =1$. Even thought squaring appears to make it worse because we have a new root.

The kicker is that our domain of truth isn't "big enough" to allow it.
From your example, the functions on both sides only agree on $\left\{-\frac12,1\right\}$ However, we can't differentiate functions at isolated points of their domains!
On the other hand, consider the equation $$\sin x=\cos x\tan x.$$ The functions here agree everywhere the function on the right-hand side is defined--namely, all points except the odd integer multiples of $\frac\pi2.$ We can therefore differentiate at all such points, to obtain $$\cos x=-\sin x\tan x+\cos x\sec^2 x,$$ which one can verify to be true for all such points.
