TITLE: Is this an incorrect proof of $\cot (x)+\tan(x)=\csc(x)\sec(x)$?
QUESTION [21 upvotes]: If you input the trig identity:
$$\cot (x)+\tan(x)=\csc(x)\sec(x)$$
Into WolframAlpha, it gives the following proof:
Expand into basic trigonometric parts:
$$\frac{\cos(x)}{\sin(x)} + \frac{\sin(x)}{\cos(x)} \stackrel{?}{=} \frac{1}{\sin(x)\cos(x)}$$ 
Put over a common denominator:
$$\frac{\cos^2(x)+\sin^2(x)}{\cos(x)\sin(x)} \stackrel{?}{=} \frac{1}{\sin(x)\cos(x)}$$ 
Use the Pythagorean identity $\cos^2(x)+\sin^2(x)=1$:
$$\frac{1}{\sin(x)\cos(x)}  \stackrel{?}{=} \frac{1}{\sin(x)\cos(x)}$$ 
And finally simplify into 
$$1\stackrel{?}{=} 1$$
The left and right side are identical, so the identity has been verified.
However, I take some issue with this. All this is doing is manipulating a statement that we don't know the veracity of into a true statement. And I've learned that any false statement can prove any true statement, so if this identity was wrong you could also reduce it to a true statement.
Obviously, this proof can be easily adapted into a proof by simply manipulating one side into the other, but:
Is this proof correct on its own? And can the steps WolframAlpha takes be justified, or is it completely wrong?

REPLY [35 votes]: It is good that you are wary of proving identities this way. Indeed, I could "prove" $0=1$ by saying
\begin{align*}
0 &\stackrel{?}{=}1\\
0\cdot 0 &\stackrel{?}{=} 0 \cdot 1\\
0 &=0.
\end{align*}
The important point is that every step WolframAlpha did is reversible, while the step I took (multiplying by $0$) was not. That is what allows the proof from WolframAlpha to be rearranged into a proof that starts with one side of the identity and ends at the other:
\begin{align*}
\cot(x)+\tan(x) &= \frac{\cos(x)}{\sin(x)} + \frac{\sin(x)}{\cos(x)}\\
&= \frac{\cos^2(x)}{\sin(x)\cos(x)} + \frac{\sin^2(x)}{\sin(x)\cos(x)}\\
&= \frac{\sin^2(x)+\cos^2(x)}{\sin(x)\cos(x)}\\
&=\frac{1}{\sin(x)\cos(x)}\\
&=\csc(x)\sec(x).
\end{align*}
So no, the WolframAlpha proof is not wrong, but it neglects to emphasize the important fact that every step is reversible. I am not a fan of that sort of proof, as it gives students the idea that they can prove an identity by manipulating both sides in any way they like to arrive at a true statement.