The textbook I'm using has this problem involving trig equations which goes $\tan(x) \sin^2(x)=2 \tan(x)$; we're trying to solve for x. The textbook advises not to divide this problem by $\tan(x)$ (in other words not to go $\tan(x)/\tan(x) \sin^2(x)=2(\tan(x)/\tan(x))$.
I don't understand why that won't be a good idea. After all, when we try to prove trig identities (I can't remember which one), don't we also do the same thing, dividing out things like $\tan(x)$ and $\sin(x)$ in order to simplify it? Or at least in trig problems where we try to prove 2 things are equal? So why can't we do that right here?
I'm guessing it's because by dividing out $\tan(x)$ in a problem where you are supposed to find the solution of $x$, you are dividing out a potential solution/root to the problem. But then, why can you divide out things like $\tan(x)$ in a problem where we try to prove 2 things are equal, or when trying to prove a trig identity? Isn't that dividing out a potential trig relationship?
As a rule, one should never divide both sides of an equation by anything, unless it has already been proved that that thing is never $0$. This is the case for $\tan x$ in your equation as much as it is for $x$ in the equation $x^2=x$.
The elimination of a $\tan x$ has the additional problem of changing the "domain of existence" of the equation. If anywhere in an equation some $\tan x$ appears, then the adept student should assume that the implicit hypothesis $\frac x\pi-\frac12\notin \Bbb Z$ holds throughout the whole discussion.
The first obstruction must be dealt in the usual way: just like no one ever solves $x^2=x$ by dividing both sides by $x$, but rather he just rewrites it in the equivalent form $$x^2=x\iff x^2-x=0\iff x(x-1)=0$$ and then uses the annulment of product law, you should carry everything to the left and then group the terms.
The way to go around the second obstruction is by taking note of all the domains of existence of the expressions that appear in your equation before starting to work on it. Once you've made clear that the entire discussion (solutions included) is restricted to those domains, algebraic manipulations (the correct ones) are allowed.