Is this an incorrect proof of $\cot (x)+\tan(x)=\csc(x)\sec(x)$?

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.


You can make it rigorous by going in the reverse direction. $1=1 \implies \frac{1}{\cos x \sin x}=\frac{1}{\cos x \sin x} \implies \dots$.

But this is a silly looking "proof" and it is really clunky. The point is that this is not $X \implies 1=1$, but rather the proof given ensures that $X \iff 1=1$ by following equality (which is symmetric) in either direction for the proof.

Personally the way you suggest is much preferred , $$\frac{1}{\cos x \sin x}=\frac{\cos^2x+\sin^2x}{\cos x\sin x}=\frac{\cos x}{\sin x}+\frac{\sin x}{\cos x}=\cot x+\tan x.$$