This paper solves the Sylvester equation in the form of AX + XB = C in a distributed way, and proposes three distributed continuous-time algorithms for three cases. We start with the basic algorithm for solving a least squares solution of the equation, and then give a simplified algorithm for the case when there is an exact solution to the equation, followed by an algorithm with regularization case. Based on local information and appropriate communication among neighbor agents, we solve the distributed computation problem of the Sylvester equation from the optimization viewpoint, and we prove the convergence of proposed algorithms to an optimal solution in three different cases, with help of the convex optimization and semi-stability. separately, cooperate with their neighbors to exchange information and achieve global goals eventually.With the rapid development of distributed optimization algorithms, the idea of using distributed methods to solve matrix equations has attracted much interest. The Sylvester equation is an important class of matrix equations, which has wide application in control theory, systems theory and many other fields [7]-[10]. For instance, the Sylvester equation plays a significant role in computing invariant subspaces [11], achieving pole assignment [12] and model reduction [13]. There have been many centralized algorithms for solving matrix equations, such as Schur decomposition methods, Krylov-subspace methods, and iterative methods [9], [14]-[16]. However, those centralized algorithms for solving the Sylvester equation AX + XB = C mainly need to deal with the whole two coefficient matrices A and B, which could not be applied directly to many distributed scenarios, including the one we consider in this paper. Besides, the parallel distributed computation for the Sylvester equation [17] could not work only for such local information either, because it needs to transform A and B to real Schur form at first. Recently, there have been several works about solving the linear algebraic equation in the form of Ax = b by various distributed methods [18]-[22]. With the help of a network structure, every node only gets access to the local information, for example, a row [18]-[20] or a column [22]of the matrix A. In [21], there is a double-layered framework for all nodes and it enhances the flexibility of the access to information. There is not much work about solving matrix equations in a distributed way yet. Though we could transform a matrix equation into the form of a linear algebraic equation sometimes, its partition structure has less flexibility to a certain extent. Due to matrix multiplication rules, there are some differences between matrix equations and linear algebraic equations. A class of matrix equations formed as AXB = F was first discussed in [23], with different distributed algorithms according to different partition structures. However, there are no results on the distributed computation of the Sylvester equation, which is more complicated than AXB = F , to our knowledge.The object...