This example is on "Fundamentals of Statistical and Thermal Physics" by Reif. I didn't know what exactly to write on the title, the subject is quite new to me.
My question is how they got the $\alpha + 2\beta \ln 2$ which is not explained in the book.

It's a "vector field line integral", it's a standard topic in multivariable calculus. Importantly this particular field is not conservative (in thermodynamics terminology, there is no corresponding state function) so the result depends on the path. For the path they described, you end up with $\int_1^2 \alpha dx + \int_1^2 \beta (2)/y dy=\alpha+2\beta \ln(2)$. For the other path they showed (going via the point $b=(1,2)$), you end up with $\int_1^2 \beta (1)/y dy + \int_1^2 \alpha dx = \alpha + \beta \ln(2)$.