Calculus of variations is a branch of mathematics concerned with finding functions that maximize or minimize a given quantity, known as a functional. Unlike ordinary calculus, which seeks the extrema of functions of variables, calculus of variations seeks the optimal functions or curves from an entire family of possibilities. Its central result is the Euler–Lagrange equation, which provides a necessary condition for a function to make a functional stationary. One of its earliest celebrated applications is the brachistochrone problem, which asks for the curve along which a particle slides under gravity between two points in the shortest possible time. In optics, Fermat’s principle states that light follows a path for which the travel time is stationary, providing a foundation for the laws of reflection and refraction. The theory also explains geodesics, which are the shortest or locally extremal paths between points on curved surfaces and in more general geometries. In classical mechanics, the principle of least action allows the equations of motion to be derived from a Lagrangian using the calculus of variations. Further applications include the determination of minimal surfaces, the shape of elastic structures, and the analysis of fluid motion. The method is also fundamental to optimal control theory, where one seeks the best possible strategy for a dynamical system subject to specified constraints. By transforming optimization problems into differential equations and boundary conditions, calculus of variations provides a powerful framework connecting mathematics, physics, engineering, and geometry.