Oh wait I misread the problem ha. Working on it atm
Edit: I seem to be getting that this is impossible.
So, by moving the (tan x)^2 terms to the left side, you get (tan x)^2 * [ (sec x)^2 - 1 ] = (cos x)^2 - 1
==> (tan x)^4 = - (sin x)^2
==> (sin x)^4 = - (sin x)^2 * (cos x)^4 = -(sin x)^2 * (1 - (sin x)^2 )^2
==> (forget about the possible division by 0, since we're looking backwards and for arbitrary x) (sin x)^2 = - (1 - 2 * (sin x)^2 + (sin x)^4 )
==> (sin x)^4 - (sin x)^2 + 1 = 0
So, set t = sin x. Note that t^4 - t^2 + 1 = 0 is an even function, and the range of t is [-1, 1], so it is enough to look at [0, 1]. However, this equation is always greater than 0 for the possible values of t, so I think there's a typo here or your teacher gave a false problem.