The phase retrieval problem can be reduced to the second order partial differential equation. In order to retrieve the absolute values of the X-ray phase and to minimize the reconstruction artifacts we defined the mixed inhomogeneous boundary condition using available a priori information about the sample. Finite element technique was used to solve the boundary value problem. The approach is validated on numerical and experimental phantoms. In order to demonstrate a possible application of the method, we have processed an entire tomographic set of differential phase images and estimated the magnitude of the refractive index decrement for some tissues inside complex biomedical samples.