I am studying Ch -14 from Apostol's book and could not solve this particular problem.
I am unable to Solve 12(a) (I have done (b) ).
As q is prime, so (n, q) =1 or q| n and 11 (b) will be used. But I am unable to deduce how to count those nsuch that (n, q) =1 and similarly those n such that q|n as n goes from 1 to infinity.
So, can you please tell how to solve this problem.
Also, consider expresssion $\phi( x^q) $ on RHS of 12 (a). As |x| <1 and q>1 so $x^q$ <1 . As $\phi(x ) $ = no. of +ve integers co-prime to n. So, how does $\phi(x^q) $ makes sense as $x^q$ is less than 1. Does $\phi(x) $ is analytically continued here?

Here is the solution:
Using Exercise 14.11(b), we have \begin{align} \prod_{n=1}^{\infty}\prod_{h=1}^{q}(1-x^ne^{2\pi inh/q})&=\prod_{n\geq1}(1-x^{qn})^q\prod_{r=1}^{q-1}\prod_{m=1}^{\infty}(1-x^{q(mq-r)}\\&=\varphi(x^q)^q\prod_{r=0}^{q-1}\prod_{m=1}^{\infty}(1-x^{q^2m})^{-1}\\ &=\frac{\varphi(x^q)^{q+1}}{\varphi(x^{q^2})} \end{align} Which is the desired result.