Separation of variables
In mathematics, separation of variables (also known as the Fourier method) is any of several methods for solving ordinary and partial differential equations, in which algebra allows one to rewrite an equation so that each of two variables occurs on a different side of the equation. Ordinary differential equations (ODE). Suppose a differential equation can be written in the form which we can write more simply by letting formula_2: As long as "h"("y") ≠ 0, we can rearrange terms to obtain: so that the two variables "x" and "y" have been separated. "dx" (and "dy") can be  viewed, at a simple level, as just a convenient notation, which provides a handy mnemonic aid for assisting with manipulations. A formal definition of "dx" as a differential (infinitesimal) is somewhat advanced. Alternative notation. Those who dislike Leibniz's notation may prefer to write this as but that fails to make it quite as obvious why this is called "separation of variables". Integrating both sides of the equation with respect to formula_6, we have or equivalently, because of the substitution rule for integrals. If one can evaluate the two integrals, one can find a solution to the differential equation. Observe  that this process effectively allows us to treat the derivative formula_8 as a fraction which can be separated. This allows us to solve separable differential equations more conveniently, as demonstrated in the example below. (Note that we do not need to use two constants of integration, in equation () as in because a single constant formula_10 is equivalent.) Example. Population growth is often modeled by the differential equation where formula_12 is the population with respect to time formula_13, formula_14 is the rate of growth, and formula_15 is the carrying capacity of the environment. Separation of variables may be used to solve  this differential equation. To evaluate the integral on the left side, we simplify the fraction and then, we decompose the fraction into partial fractions Thus we have Let formula_20. Therefore, the solution to the logistic equation is To find formula_23, let formula_24 and formula_25. Then we have Noting that formula_27, and solving for "A" we get Generalization of separable ODEs to the nth order. Much like one can speak of a separable first-order ODE, one can speak of a separable second-order, third-order or "n"th-order ODE. Consider the separable first-order ODE: The derivative can alternatively be  written the following way to underscore that it is an operator working on the unknown function, "y": Thus, when one separates variables for first-order equations, one in fact moves the "dx" denominator of the operator to the side with the "x" variable, and the "d"("y") is left on the side with the "y" variable. The second-derivative operator, by analogy, breaks down as follows: The third-, fourth- and "n"th-derivative operators break down in the same way. Thus, much like a first-order separable ODE is reducible to the form a separable second-order ODE is reducible to the  form and an nth-order separable ODE is reducible to Example. Consider the simple nonlinear second-order differential equation:formula_35This equation is an equation only of "y<nowiki>"</nowiki>" and "y'", meaning it is reducible to the general form described above and is, therefore, separable. Since it is a second-order separable equation, collect all "x" variables on one side and all "y'" variables on the other to get:formula_36Now, integrate the right side with respect to "x" and the left with respect to "y"':formula_37This givesformula_38which simplifies to:formula_39This is now a simple integral problem that gives the final  answer:formula_40 Partial differential equations. The method of separation of variables is also used to solve a wide range of linear partial differential equations with boundary and initial conditions, such as the heat equation, wave equation, Laplace equation, Helmholtz equation and biharmonic equation. The analytical method of separation of variables for solving partial differential equations has also been generalized into a computational method of decomposition in invariant structures that can be used to solve systems of partial differential equations. Example: homogeneous case. Consider the one-dimensional heat equation. The equation is The variable "u" denotes temperature. The boundary condition is  homogeneous, that is Let us attempt to find a solution which is not identically zero satisfying the boundary conditions but with the following property: "u" is a product in which the dependence of "u" on "x", "t" is separated, that is: Substituting "u" back into equation and using the product rule, Since the right hand side depends only on "x" and the left hand side only on "t", both sides are equal to some constant value −"λ". Thus: and −"λ" here is the eigenvalue for both differential operators, and "T"("t") and "X"("x") are corresponding eigenfunctions. We will now show that  solutions for "X"("x") for values of "λ" ≤ 0 cannot occur: Suppose that "λ" < 0. Then there exist real numbers "B", "C" such that From we get and therefore "B" = 0 = "C" which implies "u" is identically 0. Suppose that "λ" = 0. Then there exist real numbers "B", "C" such that From we conclude in the same manner as in 1 that "u" is identically 0. Therefore, it must be the case that "λ" > 0. Then there exist real numbers "A", "B", "C" such that and From we get "C" = 0 and that  for some positive integer "n", This solves the heat equation in the special case that the dependence of "u" has the special form of . In general, the sum of solutions to which satisfy the boundary conditions also satisfies and . Hence a complete solution can be given as where "D" are coefficients determined by initial condition. Given the initial condition we can get This is the sine series expansion of "f"("x"). Multiplying both sides with formula_49 and integrating over result in This method requires that the eigenfunctions "X", here formula_51, are orthogonal and complete. In general this is guaranteed by Sturm -Liouville theory. Example: nonhomogeneous case. Suppose the equation is nonhomogeneous, with the boundary condition the same as . Expand "h"("x,t"), "u"("x","t") and "f"("x") into where "h"("t") and "b" can be calculated by integration, while "u"("t") is to be determined. Substitute and back to and considering the orthogonality of sine functions we get which are a sequence of linear differential equations that can be readily solved with, for instance, Laplace transform, or Integrating factor. Finally, we can get If the boundary condition is nonhomogeneous, then the expansion of and is no longer valid. One has to find a function "v" that  satisfies the boundary condition only, and subtract it from "u". The function "u-v" then satisfies homogeneous boundary condition, and can be solved with the above method. Example: mixed derivatives. For some equations involving mixed derivatives, the equation does not separate as easily as the heat equation did in the first example above, but nonetheless separation of variables may still be applied. Consider the two-dimensional biharmonic equation Proceeding in the usual manner, we look for solutions of the form and we obtain the equation Writing this equation in the form we see that the derivative with respect to "x  and y" eliminates the first and last terms, so that i.e. either "F"("x") or "G"("y") must be a constant, say −λ. This further implies that either formula_59 or formula_60 are constant. Returning to the equation for "X" and "Y", we have two cases and which can each be solved by considering the separate cases for formula_63 and noting that formula_64. Curvilinear coordinates. In orthogonal curvilinear coordinates, separation of variables can still be used, but in some details different from that in Cartesian coordinates. For instance, regularity or periodic condition may determine the eigenvalues in place of boundary conditions. See spherical  harmonics for example. Applicability. Partial differential equations For many PDEs, such as the wave equation, Helmholtz equation and Schrodinger equation, the applicability of separation of variables is a result of the spectral theorem. In some cases, separation of variables may not be possible. Separation of variables may be possible in some coordinate systems but not others, and which coordinate systems allow for separation depends on the symmetry properties of the equation. Below is an outline of an argument demonstrating the applicability of the method to certain linear equations, although the precise method may differ in individual cases (for instance in  the biharmonic equation above). Consider an initial boundary value problem for a function formula_65 on formula_66 in two variables: where formula_68 is a differential operator with respect to formula_6 and formula_70 is a differential operator with respect to formula_13 with boundary data: where formula_76 is a known function. We look for solutions of the form formula_77. Dividing the PDE through by formula_78 gives The right hand side depends only on formula_6 and the left hand side only on formula_81 so both must be equal to a constant formula_82, which gives two ordinary differential equations which we can recognize as eigenvalue  problems for the operators for formula_68 and formula_70. If formula_68 is a compact, self-adjoint operator on the space formula_87 along with the relevant boundary conditions, then by the Spectral theorem there exists a basis for formula_87 consisting of eigenfunctions for formula_68. Let the spectrum of formula_68 be formula_91 and let formula_92 be an eigenfunction with eigenvalue formula_93. Then for any function which at each time formula_13 is square-integrable with respect to formula_6, we can write this function as a linear combination of the formula_92. In particular, we know the solution formula_97 can be written as For some functions  formula_99. In the separation of variables, these functions are given by solutions to formula_100 Hence, the spectral theorem ensures that the separation of variables will (when it is possible) find all the solutions. For many differential operators, such as formula_101, we can show that they are self-adjoint by integration by parts. While these operators may not be compact, their inverses (when they exist) may be, as in the case of the wave equation, and these inverses have the same eigenfunctions and eigenvalues as the original operator (with the possible exception of zero). Matrices. The matrix form of the separation  of variables is the Kronecker sum. As an example we consider the 2D discrete Laplacian on a regular grid: where formula_103 and formula_104 are 1D discrete Laplacians in the "x"- and "y"-directions, correspondingly, and formula_105 are the identities of appropriate sizes. See the main article Kronecker sum of discrete Laplacians for details. Software. Some mathematical programs are able to do separation of variables: Xcas among others.