12.2: The Method of Separation of Variables
- Page ID
- 106877
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Most PDEs you will encounter in physical chemistry can be solved using a method called “separation of variables”. We will exemplify the method by solving the easiest PDE: The Laplace equation in two dimensions:
\[\label{eq:pde5} \dfrac{\partial f(x,y)}{\partial x}+\dfrac{\partial f(x,y)}{\partial y}=0 \]
The solutions of Laplace’s equation are important in many fields of science, including electromagnetism, astronomy, and fluid dynamics.
The following steps summarize everything we have done to find the solution:
- Assume that the solution of the differential equation can be expressed as the product of functions of each of the variables.
- Group terms that depend on each of the independent variables (in this case \(x\) and \(y\)).
- Identify the terms that need to equal constants.
- Solve the ODEs (do not forget the integration constants!)
- Put everything together. Your answer will have one or more constants that will eventually be determined from boundary conditions
Step 1
The first step in the method of separation of variables is to assume that the solution of the differential equation, in this case \(f(x,y)\), can be expressed as the product of a function of \(x\) times a function of \(y\).
\[f(x,y)=X(x)Y(y) \label{eq1} \]
Don’t get confused with the nomenclature. We use lower case to denote the variable, and upper case to denote the function. We could have written Eqution \ref{eq1} as
\[f(x,y)=h(x)g(y) \nonumber \]
Step 2
In the second step, we substitute \(f(x,y)\) in Equation \ref{eq:pde5} by Equation \ref{eq1}:
\[\dfrac{\partial X(x)Y(y)}{\partial x}+\dfrac{\partial X(x)Y(y)}{\partial y}=0 \nonumber \]
\[\label{eq:pde7} Y(y)\dfrac{\partial X(x)}{\partial x}+X(x)\dfrac{\partial Y(y)}{\partial y}=0 \]
Step 3
The third step involves reorganizing the terms of Equation \ref{eq:pde7} so all terms in \(x\) and \(y\) are grouped together. There is no universal method for this step. In this example, we’ll separate variables by dividing all terms by \(X(x)Y(y)\), but in general you will need to figure out how to separate variables for the particular equation you are solving:
\[\label{eq:pde8} \dfrac{1}{X(x)}\dfrac{\partial X(x)}{\partial x}+\dfrac{1}{Y(y)}\dfrac{\partial Y(y)}{\partial y}=0 \]
Step 4
In the fourth step, we recognize that Equation \ref{eq:pde8} is the sum of two terms (it would be three if we were solving a problem in 3 dimensions), and each term depends on one variable only. In this case, the first term is a function of \(x\) only, and the second term is a function of \(y\) only. How can we add something that depends on \(x\) only to something that depends on \(y\) only and get zero? This sounds impossible, as terms in \(x\) will never cancel out terms in \(y\) 1.
The only way to make Equation \ref{eq:pde8} hold for any value of \(x\) and \(y\) is to force each summand to be a constant. The term \(\dfrac{1}{X(x)}\dfrac{\partial X(x)}{\partial x}\) cannot be a function of \(x\), and the term \(\dfrac{1}{Y(y)}\dfrac{\partial Y(y)}{\partial y}\) cannot be a function of \(y\):
\[\label{eq:pde9a} \dfrac{1}{X(x)}\dfrac{\partial X(x)}{\partial x}=K_1 \]
\[\label{eq:pde9b} \dfrac{1}{Y(y)}\dfrac{\partial Y(y)}{\partial y}=K_2 \]
This step transforms a PDE into two ODEs. In general, we will have one ODE for each independent variable. In this particular case, because the two terms need to add up to zero, we have \(K_1=-K_2\).
Step 5
In the fifth step, we solve the 2 ODEs using the methods we learned in previous chapters. We will get \(X(x)\) from Equation \ref{eq:pde9a} and \(Y(y)\) from Equation \ref{eq:pde9b}. Both solutions will contain arbitrary constants that we will evaluate using initial or boundary conditions if given. In this case, the two equations are mathematically identical, and are separable 1st order ordinary differential equations. The solutions (which you should be able to get on your own) are:
\[X(x)=Ae^{K_1x} \nonumber \]
\[Y(y)=Be^{-K_1y} \nonumber \]
Step 6
In step 6, we combine the one-variable solutions to obtain the many-variable solution we are looking for (Equation \ref{eq1}):
\[f(x,y)=X(x)Y(y)=Ae^{K_1x}Be^{-K_1y}=Ce^{K_1(x-y)} \nonumber \]
where \(C\) is a constant.
We should always finish by checking that our answer indeed satisfies the PDE we were trying to solve:
\[\dfrac{\partial f(x,y)}{\partial x}+\dfrac{\partial f(x,y)}{\partial y}=0 \nonumber \]
\[\begin{align*} f(x,y) &=Ce^{K_1(x-y)}\rightarrow \dfrac{\partial f(x,y)}{\partial x}=CK_1e^{K_1(x-y)} \\[4pt] \dfrac{\partial f(x,y)}{\partial y} &=-CK_1e^{K_1(x-y)}\rightarrow \dfrac{\partial f(x,y)}{\partial x}+\dfrac{\partial f(x,y)}{\partial y}=0 \end{align*} \]