Determination of "a":
#a+1/a=2cosalpha##" "color(blue)((1))#
squaring on both sides
#(a+1/a)^2=(2cosalpha)^2#
#(a+1/a)^2=4cos^2alpha#
#(a-1/a)^2=(a+1/a)^2-(4*1/a*a)#
[since#(a-b)^2=(a+b)^2-4ab]#
#=>(a-1/a)^2=4cos^2alpha-4#
#=>(a-1/a)^2=-4(1-cos^2alpha)#
#=>(a-1/a)=sqrt(-4)sqrt(1-cos^2alpha#
#=>(a-1/a)=i2sinalpha##" "color(blue)((2))#
Add #" "color(blue)((1))#&#color(blue)((2))#
#a+1/a+a-1/a=2cosalpha+i2sinalpha#
#a=cosalpha+isinalpha=e^(ialpha)##" "color(blue)((3))#
(since#costheta+isin(theta)=e^(itheta)#)
Determination of "b":
Similarly
#b=cosbeta+isinbeta=e^(ibeta)##" "color(blue)((4))#
#a^pb^q+1/(a^pb^q)=e^(ipalpha)*e^(iqbeta)+1/(e^(ipalpha)*e^(iqbeta))#
#a^pb^q+1/(a^pb^q)=e^(ipalpha+iqbeta)+1/(e^(ipalpha+iqbeta)#
#a^pb^q+1/(a^pb^q)=e^(ipalpha+iqbeta)+(e^-(ipalpha+iqbeta))#
since #e^(itheta)+e^(-itheta)=2costheta#
#a^pb^q+1/(a^pb^q)=2cos(palpha+qbeta)#
Hence proved