# Calculus of variations
## Microsim (three.js)
<div class="microsim-player">
<!-- MICROSIM:PENDING_DEPLOY:BEGIN v1.7 g08 — embed target is not on the CDN; restore with g08 --undeploy-clear -->
<p class="wt-pending"><strong>Microsim staged, not yet on the CDN.</strong> <code>Calculus_of_variations.html</code> is built and deploy-ready in <code>Microsims for Dissemination/</code>, but the Netlify project still serves the geometry+spintronics set only. The player is disabled until the deploy lands; the explanatory text below is unchanged.</p>
<!--
<iframe src="https://wikitube-3d-microsims.netlify.app/Calculus_of_variations.html" width="100%" height="620" frameborder="0" loading="lazy" sandbox="allow-scripts allow-same-origin"></iframe>
-->
<!-- MICROSIM:PENDING_DEPLOY:END -->
</div>
*In the ALGORITHM hub this is where continuous optimization begins — the "find the best route" instinct behind [[Optimal_control]] and [[Dynamic_programming]], and the smooth-curve cousin of [[Combinatorial_optimization]], searching a whole space of functions instead of a finite list of choices.*
> The calculus of variations looks for the *function* — not the number — that makes a total quantity as small or as large as possible. Here that quantity is the length of a path joining two fixed points, and one knob deforms the candidate path while a readout reports its length. Slide the knob to zero and the path snaps to a straight line, the shortest route: an infinite-dimensional search reduced to a single-slider experiment whose minimum you find by eye.
## About this microsim
The canvas fixes two endpoints and draws a candidate path whose shape is set entirely by one control, **Bulge strength c**, running from **−1.5 to 1.5**. At $c=0$ the path is the straight segment; positive $c$ bows it one way, negative the other, with $\pm1.5$ giving the most pronounced bulge. A live arc-length readout updates as you drag. Because each $c$ names exactly one competing curve, sweeping the slider marches along a one-parameter family of paths, and the readout traces a function that visibly bottoms out at $c=0$. That show-before-tell moment — the minimum sitting precisely at the straight line — *is* the theorem, seen before any equation is written.
## Related microsims
- [[Optimal_control]] — extends "best path" from fixed curves to steered trajectories; Pontryagin's principle generalizes Euler–Lagrange.
- [[Dynamic_programming]] — Bellman's discrete route to shortest paths, working backward from the goal.
- Extreme value theorem — the finite-dimensional cousin: why a continuous quantity on a closed interval attains its minimum.
- [[Combinatorial_optimization]] — shortest paths when the choices are graph edges rather than smooth curves.
- [[Model_predictive_control]] — re-solves an optimal-path problem at every time step.
- [[Reinforcement_learning]] — learns optimal long-run paths from reward, sharing the Bellman backbone.
- [[Graph_of_a_function]] — related ALGORITHM microsim
## Links (Wikipedia order)
<!-- injected from _registry/childlinks/Calculus_of_variations.json (2026-07-30T02:09:12Z) -->
`Abel's_test` · `Abstract_Wiener_space` · `Action_(physics)` · `Adrien-Marie_Legendre` · `Alfred_Clebsch` · `Algebraic_analysis` · `Algebraic_interior` · `Alternating_series` · `Alternating_series_test` · `Analytical_mechanics` · `Antiderivative` · `Arc_length` · `Archimedes` · `Augustin-Louis_Cauchy` · `Banach_bundle` · `Banach_manifold` · `Beltrami_identity` · `Bernard_Dacorogna` · `Besov_measure` · `Binomial_series` · `Bochner_integral` · `Bochner_measurable_function` · `Bochner_space` · `Borel_functional_calculus` · `Boundary_value_problem` · `Brachistochrone_curve` · [[Calculus]] · `Calculus_on_Euclidean_space` · `Cameron–Martin_theorem` · `Carathéodory's_theorem_(convex_hull)` · `Carl_Friedrich_Gauss` · `Carl_Gustav_Jacob_Jacobi` · `Catenary` · `Cauchy_condensation_test` · `Chain_rule` · `Chaplygin_problem` · `Choquet_theory` · `Classical_Wiener_space` · `Closed_convex_function` · [[Complex_analysis]] · `Concave_function` · `Constant_(mathematics)` · `Continuous_function` · `Continuous_functional_calculus` · `Contour_integration` · `Convenient_vector_space` · `Convergence_tests` · `Converse_(logic)` · `Convex_analysis` · `Convex_combination` · `Convex_conjugate` · `Convex_function` · `Convex_geometry` · `Convex_hull` · `Convex_metric_space` · `Convex_optimization` · `Convex_series` · `Convex_set` · `Convexity_in_economics` · `Covariance_operator` · `Crinkled_arc` · `Curl_(mathematics)` · `Cylinder_set_measure` · `David_Hilbert` · `De_Donder–Weyl_theory` · `Derivative` · `Differentiable_vector-valued_functions_from_Euclidean_space` · `Differential_(mathematics)` · `Differential_calculus` · [[Differential_equation]] · `Differential_of_a_function` · `Differentiation_in_Fréchet_spaces` · `Differentiation_rules` · `Dimitri_Bertsekas` · `Direct_comparison_test` · `Direct_integral` · `Directional_derivative` · `Dirichlet's_principle` · `Dirichlet's_test` · `Disc_integration` · `Divergence` · `Divergence_theorem` · `Domain_of_a_function` · `Dual_system` · `Duality_(optimization)` · `Duality_gap` · [[Dynamic_programming]] · `Effective_domain` · `Ekeland's_variational_principle` · `Elliptic_partial_differential_equation` · `Emmy_Noether` · `Encyclopedia_of_Mathematics` · `Epigraph_(mathematics)` · `Euler_substitution` · `Euler–Lagrange_equation` · `Exterior_derivative` · `Faà_di_Bruno's_formula` · `Feldman–Hájek_theorem` · `Fenchel–Moreau_theorem` · `Fermat's_principle` · `Fermat_Prize` · `Finite_element_method` · `First-order_partial_differential_equation` · `First_variation` · [[Fourier_analysis]] · `Fractional_calculus` · `Fréchet_derivative` · `Fréchet_manifold` · `Fubini's_theorem` · `Function_(mathematics)` · `Function_space` · `Functional_(mathematics)` · [[Functional_analysis]] · `Functional_calculus` · `Functional_derivative` · `Fundamental_theorem_of_calculus` · `Galileo_Galilei` · `Gateaux_derivative` · `Gaussian_measure` · `General_Leibniz_rule` · `Generalizations_of_the_derivative` · `Generalized_Stokes_theorem` · `Generalized_function` · `Geodesic` · `Geometric_calculus` · `Geometric_series` · `Gilbert_Ames_Bliss` · `Glossary_of_calculus` · `Gradient` · `Gradient_theorem` · `Green's_theorem` · `Guillaume_de_l'Hôpital` · `Hadamard_derivative` · `Hamilton's_principle` · `Hamiltonian_mechanics` · `Hamiltonian_optics` · `Hamilton–Jacobi_equation` · `Harmonic_analysis` · `Harmonic_series_(mathematics)` · `Harold_J._Kushner` · `Heaviside_cover-up_method` · `Helmholtz_decomposition` · `Henri_Lebesgue` · `Herman_Goldstine` · `Hermite–Hadamard_inequality` · `Hessian_matrix` · `Hilbert's_twentieth_problem` · `Hilbert's_twenty-third_problem` · `Hilbert_manifold` · `History_of_calculus` · `Holomorphic_functional_calculus` · `Hu–Washizu_principle` · `Hypercomplex_analysis` · `Hypograph_(mathematics)` · `Implicit_differentiation` · `Improper_integral` · `Infinite-dimensional_Lebesgue_measure` · `Infinite-dimensional_holomorphy` · `Infinite-dimensional_optimization` · `Infinite-dimensional_vector_function` · `Infinitesimal` · `Infinity` · `Integral` · `Integral_of_inverse_functions` · `Integral_test_for_convergence` · [[Integral_transform]] · `Integration_Bee` · `Integration_by_parts` · `Integration_by_reduction_formulae` · `Integration_by_substitution` · `Integration_using_Euler's_formula` · `Inverse_function_rule` · `Inverse_function_theorem` · `Inverse_problem_for_Lagrangian_mechanics` · `Invex_function` · [[Isaac_Newton]] · `Isoperimetric_inequality` · `Israel_Gelfand` · `Jacob_Bernoulli` · `Jacobian_matrix_and_determinant` · `Jacques_Hadamard` · `Jensen's_inequality` · `Johann_Bernoulli` · `John_Hewitt_Jellett` · `John_ellipsoid` · `Joseph-Louis_Lagrange` · `Jürgen_Jost` · `K-convex_function` · `Karl_Weierstrass` · `Kinetic_energy` · `Krein–Milman_theorem` · `L'Hôpital's_rule` · `Lagrange_multiplier` · `Lagrangian_mechanics` · `Laplace_operator` · [[Least-squares_spectral_analysis]] · `Legendre_transformation` · `Leibniz_integral_rule` · `Lens_(geometry)` · `Leonhard_Euler` · `Leonida_Tonelli` · `Lev_Pontryagin` · `Limit_(mathematics)` · `Limit_comparison_test` · `Limit_of_a_function` · `Limit_of_distributions` · `Line_integral` · `List_of_calculus_topics` · `List_of_convexity_topics` · `Lists_of_integrals` · `Locally_convex_topological_vector_space` · `Logarithmic_differentiation` · `Logarithmically_convex_function` · `Louisiana_State_University` · `Luke's_variational_principle` · `Malliavin_calculus` · `Map_(mathematics)` · `Marston_Morse` · `MathWorld` · `Mathematical_analysis` · `Matrix_calculus` · `Mazur's_lemma` · `Mean_value_theorem` · `Measurable_function` · `Measure_(mathematics)` · `Measure_theory_in_topological_vector_spaces` · `Mechanics` · `Microlocal_analysis` · `Mikhail_Lavrentyev` · `Mikhail_Ostrogradsky` · `Minimal_surface` · `Morse_theory` · `Mountain_pass_theorem` · `Multiple_integral` · `Multivariable_calculus` · `Nash–Moser_theorem` · [[Necessity_and_sufficiency]] · `Nehari_manifold` · `Newton's_minimal_resistance_problem` · `Noether's_theorem` · `Nonelementary_integral` · `Nonstandard_analysis` · `Notation_for_differentiation` · `Obstacle_problem` · [[Optimal_control]] · `Order_of_integration_(calculus)` · [[Ordinary_differential_equation]] · `Oskar_Bolza` · `Otto_Hesse` · `P-adic_analysis` · `P-adic_number` · `Paley–Wiener_integral` · `Partial_derivative` · [[Partial_differential_equation]] · `Peter_Gustav_Lejeune_Dirichlet` · `Pettis_integral` · `Philip_Kelland` · `Philosophiæ_Naturalis_Principia_Mathematica` · `Pierre_Frédéric_Sarrus` · `PlanetMath` · `Plateau's_problem` · `Potential_energy` · `Power_rule` · `Power_series` · `Precalculus` · `Product_rule` · `Projection-valued_measure` · `Proper_convex_function` · `Pseudoconvex_function` · `Pseudoconvexity` · `Quasi-derivative` · `Quasiconvex_function` · `Quaternionic_analysis` · `Quotient_rule` · `R._Tyrrell_Rockafellar` · `Radial_set` · `Ratio_test` · `Rayleigh–Ritz_method` · `Real_analysis` · `Real_number` · `Regulated_integral` · `Related_rates` · `Representation_theory` · `Reynolds_transport_theorem` · `Richard_Bellman` · `Richard_Courant` · `Riemann_integral` · `Risch_algorithm` · `Rolle's_theorem` · `Root_test` · `Sazonov's_theorem` · `Scalar_(mathematics)` · `Second_derivative` · `Second_variation` · `Semi-continuity` · `Sergei_Fomin` · `Series_(mathematics)` · `Set_function` · `Shapley–Folkman_lemma` · `Shell_integration` · `Sign_(mathematics)` · `Simplex` · `Siméon_Denis_Poisson` · `Snell's_law` · `Special_functions` · `Stampacchia_Medal` · `Stochastic_calculus` · `Stochastic_differential_equation` · `Stokes'_theorem` · `Strauch` · `Strong_duality` · `Strongly_measurable_function` · `Structure_theorem_for_Gaussian_measures` · `Sturm–Liouville_theory` · `Subderivative` · `Surface_integral` · `Symmetry_of_second_derivatives` · `Tangent_half-angle_substitution` · `Tautochrone_curve` · `Taylor's_theorem` · `Taylor_series` · `Topological_vector_space` · `Topology` · `Total_variation_denoising` · `Trigonometric_substitution` · `Tropical_analysis` · `Ursescu_theorem` · `Variational_Bayesian_methods` · `Variational_analysis` · `Variational_bicomplex` · `Variational_method_(quantum_mechanics)` · `Variational_methods_in_general_relativity` · `Variational_principle` · `Variational_vector_field` · `Vector_calculus` · `Vector_calculus_identities` · `Vector_measure` · `Vincenzo_Brunacci` · `Volume_integral` · [[Wave_equation]] · `Weak_duality` · `Weakly_measurable_function` · `YouTube` · `Young_measure` · `Zonotope`
## Overview
The calculus of variations finds extrema of *functionals*: rules that map an entire function to a single number, usually an integral of a function and its derivatives. The unknown is a whole curve or trajectory, not one variable. Isoperimetric questions reach back to antiquity, but the modern subject opened with Johann Bernoulli's 1696 *brachistochrone* — the curve of fastest descent. Euler and Lagrange forged the general method in the mid-18th century; Euler named the field, and Lagrange added the variational $\delta$-notation still in use. Its central result, the Euler–Lagrange equation, drives the principle of least action, Fermat's principle, geodesics, and the continuous-time root of [[Optimal_control]].
## The mathematics
Write a functional with fixed endpoints,
$J[y] = \int_a^b F(x, y, y')\,dx .$
A necessary condition for $y$ to be an extremum is the **Euler–Lagrange equation**
$\frac{\partial F}{\partial y} - \frac{d}{dx}\!\left(\frac{\partial F}{\partial y'}\right) = 0 .$
For shortest path the quantity is arc length, so $F=\sqrt{1+(y')^2}$ depends on $y'$ alone. Then $\partial F/\partial y = 0$ and the equation forces $y'/\sqrt{1+(y')^2}$ to be constant — hence $y'$ constant, a **straight line**.
The microsim exposes the idea one step earlier. Replacing $y$ by a family $y_c=\bar y + c\,\eta$, with $\bar y$ the straight baseline and $\eta$ vanishing at both ends, collapses the functional into an ordinary function $J(c)$ — and bulge strength $c$ *is* that number. For a horizontal baseline,
$J'(0)=0,\qquad J''(0)=\int_a^b\big(\eta'(x)\big)^2\,dx>0,$
so near the bottom $J(c)\approx J(0)+\tfrac12 J''(0)\,c^2$, an upward parabola. That is the U-shaped length curve the slider traces, with $J'(0)=0$ the vanishing first variation.
## Controls -> what each maps to
| Control | Maps to | Range / values | Meaning |
|---|---|---|---|
| Bulge strength c | Amplitude of the perturbation $\eta$ added to the straight baseline — the variation parameter in $y_c=\bar y+c\,\eta$ | $-1.5$ to $1.5$ | How far, and in which direction, the candidate curve bows from the straight path; $c=0$ is the length-minimizing geodesic, $\pm1.5$ the largest deformations |
## Learning objective
After playing, a learner can explain why the straight line minimizes length and predict that any nonzero bulge lengthens the path, linking the U-shaped readout to the vanishing first variation $J'(0)=0$.
## Limits and connections
The sim searches only one hand-picked bulge family, so it *illustrates* the minimum rather than proving it over all curves — that is the Euler–Lagrange equation's job. The same reduction from a functional to a one-parameter function underlies gradient methods across [[Optimal_control]] and machine learning.
## Poster & source
<div class="microsim-fallback">
<!-- poster image pending backfill -->
<p><em>Live microsim · <a href="https://wikitube-3d-microsims.netlify.app/Calculus_of_variations.html">open full</a> · source: Microsims for Dissemination/ALGORITHM_microsims/Calculus_of_variations.html</em></p>
</div>
<!-- CRAFT-LINK:START g12 -->
*Built to the [[WT!Three_js_Microsim_Master_Class|three.js Master Class]].*
<!-- CRAFT-LINK:END -->
## Wikipedia : Wikitube
**Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Calculus_of_variations) : [Wikitube](https://en.wikitube.io/wiki/Calculus_of_variations)
## Previous hub tags
Tree parent: [[Decision_theory]].
Legacy hubs: `ALGORITHM`.
---
*Sources: 1 legacy note. Minted wave 1, 2026-07-30 (v1.6 order).*