I have the following two-variable function involving a large product:
Z[p_, q_] := (p^(-1)*(1 - p)^2)*
Product[((1 - p*(q)^m)^2*(1 - p^(-1)*q^m)^2)/((1 - q^m)^4), {m, 1, 200}];
and I'm hoping to take the following expansion in the variable q
where the coefficients are functions of the variable p
:
Series[Z[p, q], {q, 0, 5}]
However, I actually would like the coefficients of this expansion to be not functions of p
, but rather of the auxiliary variable
z = p^(-1)*(1-p)^2
Is there a nice, clean way to carry this out? I think I would know what to do if I could solve for p
in terms of z
, but that clearly won't work here. I should also mention that I'm only thinking of this as a formal object I'm expanding, so I definitely don't want to worry about whether or not things are honest "functions", branch cuts, or anything like that!
/.
replace? $\endgroup$/.
seeks for exact patterns like in aFullForm
. SoFullSimplify @ Series[Z[p, q], {q, 0, 1}] /. p^(-1)*(1 - p)^2 -> z
does nothing. $\endgroup$