Unlike equation (8) for case one, there is no analytical solution for Case Two (equation(16)). Therefore, we solve equation (16) given equation (17) using MATLAB or any other language or numerical software. Sample code that I wrote in MATLAB to solve equation (8) numerically is provided at http://clausius.engr.utk.edu/che310/index.html . This code can also be used for Case Two, with extremely simple modifications of the code.