Two sets of the Heun functions are introduced via integrals.
Theorems about expanding functions with respect to these sets are
proven. A number of integral and series representations as well
as integral equations and asymptotic formulas are obtained for
these functions. Some of the coefficients of the series are
orthogonal (J-orthogonal) functions of discrete
variables and may be interpreted as orthogonal polynomials. Other
sets of the coefficients are biorthonormal. Expanding infinite
vectors to series with respect to the coefficients is
discussed. Certain Legendre functions of complex degree are
limiting cases of the studied functions. This leads to new
relations for Legendre functions and associated integral
transforms. The treated Heun functions find a use for solving
dual Fourier series equations which are reduced to the Fredholm
integral equations of the second kind. Explicit solutions are
obtained in a special case.