In mathematics, variation of parameters, also known as variation of constants, is a general method to solve inhomogeneous linear ordinary differential equations.
For first-order inhomogeneous linear differential equations it is usually possible to find solutions via integrating factors or undetermined coefficients with considerably less effort, although those methods leverage heuristics that involve guessing and don't work for all inhomogeneous linear differential equations.
Variation of parameters extends to linear partial differential equations as well, specifically to inhomogeneous problems for linear evolution equations like the heat equation, wave equation, and vibrating plate equation. In this setting, the method is more often known as Duhamel's principle, named after Jean-Marie Duhamel(1797-1872) who first applied the method to solve the inhomogeneous heat equation. Sometimes variation of parameters itself is called Duhamel's principle and vice versa.
The method of variation of parameters was introduced by the Swiss-born mathematician Leonhard Euler (1707–1783) and completed by the Italian-French mathematician Joseph-Louis Lagrange (1736–1813). A forerunner of the method of variation of a celestial body's orbital elements appeared in Euler's work in 1748, while he was studying the mutual perturbations of Jupiter and Saturn. In his 1749 study of the motions of the earth, Euler obtained differential equations for the orbital elements; and in 1753 he applied the method to his study of the motions of the moon. Lagrange first used the method in 1766. Between 1778 and 1783, Lagrange further developed the method both in a series of memoirs on variations in the motions of the planets and in another series of memoirs on determining the orbit of a comet from three observations. (It should be noted that Euler and Lagrange applied this method to nonlinear differential equations and that, instead of varying the coefficients of linear combinations of solutions to homogeneous equations, they varied the constants of the unperturbed motions of the celestial bodies.) During 1808-1810, Lagrange gave the method of variation of parameters its final form in a series of papers. The central result of his study was the system of planetary equations in the form of Lagrange, which described the evolution of the Keplerian parameters (orbital elements) of a perturbed orbit.