  In 1966, Leo Moser introduced the "moving sofa problem," which seeks to
determine the largest area of a shape that can be maneuvered through a
90-degree hallway of unit-width. This problem remains unsolved and open yet. In
this paper, we employ calculus of variations method to solve this problem.
Assuming the trajectories and envelopes are convex, the sofa's area is
formulated as an integral functional on a set of parametric equations for
curves. The final shape is determined by solving the Euler-Lagrange equations.
Utilizing numerical methods, we obtain the non-trivial area of 2.2195316,
consistent with the previously well-known Gerver's constant since 1992. We
prove that both the results of Gerver's sofa and Romik's car satisfy the
Euler-Lagrange equations for the necessary condition of maximal area. We also
explore additional cases and asymmetric conditions, and discuss other variant
problems.
