My question is, in the calculation of the total impedance why is the angle of the inductive reactance taken to be negative and that of the capacitive reactance taken to be positive? I thought it was supposed to be the other way around? like below:
It looks like a mistake to me because they use the +X\$_G\$ inductive reactance value near the start of the equation and thereafter, the inductive reactances are treated as negative values. It has to be a mistake or some cunning plan that the context of your question doesn't cover.