Expression for fugacity coefficient derived from a pressure-explicite EOS In the book, Thermodynamics for Process Simulation, the authors propose to derive an expression for the fugacity coefficient from a pressure-explicit equation of state, as an example among many others. 

Assuming, $P = P(T, v)$ or $z =\frac{Pv}{RT} = z(T, v)$, the calculations lead to,

$$\left(\frac{\partial \ln \phi}{\partial v}\right)_T = \left(\frac{\partial z}{\partial v}\right)_T-\left(\frac{\partial \ln z}{\partial v}\right)_T + \left(\frac{1}{v}-\frac{P}{RT}\right) \tag1$$

where $\phi$ is the fugacity coefficient.

What I don't understand is, when they integrate, they get,

$$\ln \phi = z - 1 - \ln z + \frac{1}{RT}\int_{\infty}^v \left(\frac{RT}{v}-P\right)\mathrm{d}v \tag2$$

Can someone explain me how they find $z-1-\ln z$ by integrating the first two terms of $(1)$ between $\infty$ and $v$?



When integrating the first two terms, it leads to $$\left[z - \ln z \right]_{\infty}^v$$ which I understand, but then I don't get the final result.

I suppose it's linked to the values of $z$ when the volume is very large and when the volume is "$v$" but it does't make sense for me. 

I would have assume to get $$\left[z - \ln z \right]_{\infty}^v = v - \ln v - \left[z(v^{\infty}) - \ln z(v^{\infty}) \right]$$ and nothing else. 

But I am missing something probably obvious.

Thank you in advance for your help!
Mindful of the guideline "don't give answers in comments", I've converted my comment to an answer, trivial though it is.

When $v\rightarrow \infty$ you get the ideal gas eos, so $z\rightarrow 1$. This gives you the result, i.e. $1$ at the lower limit (subtracted) and $z-\ln z$ at the upper one.

When you write down the integrated form, $z-\ln z$, you need to remember that it means that you are evaluating the function $z(v)$ at the two limits $v=\infty$ and $v=v$, and using those values in that expression; you should not be trying to set $z=v$ at the limits, which seems to be (partly) what you have written at the end of your question.

Edit following OP comment.

More details. At constant $T$, $z=z(v)$ is a function of molar volume $v$,
determined by the equation of state, $P(v)$ at the given value of $T$. This equation is unknown, but we can be sure that,
in the ideal gas limit $v\rightarrow\infty$, $z(v)\rightarrow 1$.

Integrating both sides of the equation from the ideal gas limit to 
the desired volume $v$, and using $v'$ as the integration variable, gives
eqn (2) of the question in its full form:
$$
\left| \ln \phi(v')\right|_{v'=\infty}^{v'=v} 
= \left|  z(v') - \ln z(v') \right|_{v'=\infty}^{v'=v} 
+ \frac{1}{RT}\int_{\infty}^v \left(\frac{RT}{v'}-P(v')\right)\mathrm{d}v' 
$$
I think it's clearer to distinguish between the integration variable $v'$
and the "upper" limit of integration $v$, 
but many people would be happy just to use $v$ instead of $v'$.

Anyway,
on the left,
we know that, in the ideal gas limit, 
the fugacity coefficient $\phi(\infty)=1$,
so $\ln\phi(\infty)=0$ and we are just left with $\ln\phi(v)$.
On the right,
similarly,
we substitute in the upper and lower limits for $v'$.
We know $z(\infty)=1$, so 
the function being evaluated is $z(\infty)-\ln z(\infty)=1$ at the lower limit,
and $z(v)-\ln z(v)$ at the upper limit.
So the final answer is
$$
\ln \phi(v)
= z(v) - \ln z(v) - 1
+ \frac{1}{RT}\int_{\infty}^v \left(\frac{RT}{v'}-P(v')\right)\mathrm{d}v' 
$$
An important point is that the integration variable 
is the molar volume $v'$ (or $v$ if you prefer), not $z$.
In evaluating the result, the integration limits $v$ and $\infty$ 
are substituted for $v'$, the argument of the function being evaluated.
It is incorrect to set $z=v$, or $z=\infty$.
(This should be even more clear in this case, 
since $z$ is a dimensionless quantity, whereas $v$ is not).