If tan(pi/4 + x) = A sec 2x + B tan 2x is an identity for all real values of x for which both sides of the equation are defined, find (A,B).