Transformation of virial coefficients from molar volume to pressure

I have the following virial equation for a real gas:


$Z = \frac{PV\_m}{RT} = 1 + \frac{B}{V\_m} + \frac{C}{V\_m^2}$


I would like to transform the coefficients $B$ and $C$ so the equation is expressed in terms of pressure:


$Z = \frac{PV\_m}{RT} = 1 + B'P+ C'P^2$


My book says that the transformations are:


$B' = \frac{B}{RT}$ and $C' = \frac{(C-B^2)}{(RT)^2}$


How are these derived? I can get the first one by:


$Z(\frac{1}{V\_m}) = Z(P)$ and only considering $B$:


$1 + \frac{B}{V\_m} = 1 + B'P$,


$\frac{BP}{RT} = B'P$,


$\frac{B}{RT} = B'$.


For the second one I also consider C:


$1 + \frac{B}{V\_m} + \frac{C}{V\_m^2}= 1 + B'P + C'P^2$,


$\frac{BP}{RT} + \frac{CP^2}{(RT)^2}= \frac{B}{RT}P + C'P^2$,


$\frac{CP^2}{(RT)^2}= C'P^2$,


$\frac{C}{(RT)^2}= C'$.


This result (mine) differs to the one given by the book. They have an additional $-B^2$ term in the numerator. Where is that term coming from?




We want to take this:


$$Z = \frac{PV\_m}{RT} = 1 + \frac{B}{V\_m} + \frac{C}{V\_m^2}+…\tag{1}$$


And transform it into this:


$$Z = \frac{PV\_m}{RT} = 1 + B'P+ C'P^2+…\tag{2}$$




---


We begin by expressing (1) in terms of $\rho\_m = 1/V\_m$:


$$Z=1+B\rho\_m+C\rho\_m^2+…\tag{3}$$


We then multiply (2) and (3) by $RT\rho\_m$ to get (4) and (5), respectively. Remember that $ZRT\rho=ZRT/V\_m =P$, because $Z=PV\_m/RT$.


$$RT\rho\_m Z = P = RT\rho\_m + RT\rho\_mB'P+ RT\rho\_mC'P^2+…\tag{4}$$
$$RT\rho\_m Z= P = RT\rho\_m + RTB\rho\_m^2 + RTC\rho\_m^3+…\tag{5}$$


Next, we use (5) to substitute for $P$ in (4):


$$P = RT\rho\_m + RT\rho\_mB'(RT\rho\_m + RTB\rho\_m^2 + RTC\rho\_m^3+…) +$$
$$ RT\rho\_mC'(RT\rho\_m + RTB\rho\_m^2 + RTC\rho\_m^3+…)^2+…\tag{6}$$


Collecting all the $\rho\_m^2$ terms from (5) and (6):


$$RTB=(RTB')(RT)$$
Rearranging leads to the desired $$B'=\frac{B}{RT} \tag{7}$$


Next, collecting all the $\rho\_m^3$ terms from (5) and (6):


$$RTC=(RTB')(RTB)+(RTC')(RT)^2$$


Simplifying, rearranging, and making use of (7) leads to the desired
$$C' = \frac{C-B^2}{(RT)^2}\tag{8}$$


 1