equating coefficients on the left and right side ...

(1)

(2)

from equation (1) ...

substitute into equation (2) ...

square both sides ...

o.k. ... all the "grunt" work is done. Take the last equation, solve for Z, then go back and solve for A. Buena suerte.