The construction of an algorithm for calculating groups of S-unit in hyperelliptic fields with the help of rational functions and a square-free polynomial, is discussed. The corresponding valuation on the field of rational functions is defined by the ring of the valuation and the ideal of the valuation for an irreducible polynomial. The residue field coincides with rational functions, which is a finite extension of functions. A system of independent fundamental S-units is constructed using induction. Theorems are used to add an S-unit with minimum possible positive integer exponent for getting fundamental units. They produces a homogeneous system of linear equations with matrix. They also proves that the valuation equation has a solution in nonzero polynomials.