tan(x)= sin(x)/cos(x), therefore, substitute sin(x)/cos(x) in the expression:
=(cos(x)(sin(x)/cos(x))-1)/cos^2(x)
simplify the 2 cos(x):
=(sin(x)-1)/cos^2(x)
Sin^2(x)+ cos^2(x)=1, sin^2(x)-1=- cos^2(x), substitute in the expression:
= -cos^2(x)/cos^2(x)= -1