$$\\
\frac{\cos(x)\sin^2(x)}{1-\cos(x)}=\cos(x)+\cos^2(x) \\\\
\text{Divide by cos(x)}\\
\frac{\sin^2(x)}{1-\cos(x)}=1+\cos(x) \\\\
\text{Multiply by 1-cos(x)}\\
\sin^2(x)=(1-\cos(x))(1+\cos(x))\\\\
\text{The right-hand side is the difference of two squares so}\\
\sin^2(x)=1-\cos^2(x)\\\\
\text{so:}\\
\sin^2(x)+\cos^2(x)=1\\
\text{which is correct!}$$
.
.$$\\
\frac{\cos(x)\sin^2(x)}{1-\cos(x)}=\cos(x)+\cos^2(x) \\\\
\text{Divide by cos(x)}\\
\frac{\sin^2(x)}{1-\cos(x)}=1+\cos(x) \\\\
\text{Multiply by 1-cos(x)}\\
\sin^2(x)=(1-\cos(x))(1+\cos(x))\\\\
\text{The right-hand side is the difference of two squares so}\\
\sin^2(x)=1-\cos^2(x)\\\\
\text{so:}\\
\sin^2(x)+\cos^2(x)=1\\
\text{which is correct!}$$
.