Examples
edit
Example with one coefficient
edit
Suppose we wish to find a solution to the following linear inhomogeneous differential equation:
y
′
−
y
=
e
3
x
.
{\displaystyle y'-y=e^{3x}{\text{.}}\,\!}
Because the inhomogeneous part is e 3x , we guess (correctly) that the equation has a solution of the form
y
=
A
e
3
x
{\displaystyle y=Ae^{3x}\,\!}
for some constant A . Substituting this guess into the original equation yields:
3
A
e
3
x
−
A
e
3
x
=
e
3
x
2
A
e
3
x
=
e
3
x
2
A
=
1
A
=
1
2
.
{\displaystyle {\begin{alignedat}{2}3Ae^{3x}-Ae^{3x}&&&=e^{3x}\\2Ae^{3x}&&&=e^{3x}\\2A&&&=1\\A&&&={\frac {1}{2}}{\text{.}}\end{alignedat}}\,\!}
Therefore, one solution to the differential equation above is given by
y
=
1
2
e
3
x
.
{\displaystyle y={\frac {1}{2}}e^{3x}{\text{.}}\,\!}
The general solution is a sum of this particular solution with a general solution to the associated homogeneous equation (see the article on linear differential equations ).
Example with three coefficients
edit
Suppose we wish to find a solution to the equation
y
″
+
3
y
′
+
2
y
=
2
x
2
+
3
x
.
{\displaystyle y''+3y'+2y=2x^{2}+3x{\text{.}}\,\!}
Because the inhomogeneous part is a quadratic polynomial, we guess (correctly) that the equation has a solution of the form
y
=
A
x
2
+
B
x
+
C
{\displaystyle y=Ax^{2}+Bx+C\,\!}
for some constants A , B , and C . Substituting this guess into the original equation yields
(
2
A
)
+
3
(
2
A
x
+
B
)
+
2
(
A
x
2
+
B
x
+
C
)
=
2
x
2
+
3
x
{\displaystyle (2A)+3(2Ax+B)+2(Ax^{2}+Bx+C)=2x^{2}+3x\,\!}
or
(
2
A
)
x
2
+
(
6
A
+
2
B
)
x
+
(
2
A
+
3
B
+
2
C
)
=
2
x
2
+
3
x
.
{\displaystyle (2A)x^{2}+(6A+2B)x+(2A+3B+2C)=2x^{2}+3x{\text{.}}\,\!}
Setting the coefficients of x 2 , the coefficients of x , and the constant terms equal gives the following system of linear equations :
2
A
=
2
6
A
+
2
B
=
3
2
A
+
3
B
+
2
C
=
0
.
{\displaystyle {\begin{alignedat}{7}2A&&&&&&&&&&\;=\;&&2&\\6A&&\;+\;&&2B&&&&&&\;=\;&&3&\\2A&&\;+\;&&3B&&\;+\;&&2C&&\;=\;&&0&{\text{.}}\\\end{alignedat}}}
Solving yields A = 1, B = –3/2, and C = 5/4. Therefore, one solution to the differential equation above is given by
y
=
x
2
−
3
2
x
+
5
4
.
{\displaystyle y=x^{2}-{\frac {3}{2}}x+{\frac {5}{4}}{\text{.}}\,\!}
Guessing the form
edit
The first step in the method of undetermined coefficients is to guess the form of the particular solution. This guess is usually based on the inhomogeneous part of the equation:
Inhomogeneous part
Guess
e
r
x
A
e
r
x
cos
k
x
or
sin
k
x
A
cos
k
x
+
B
sin
k
x
e
r
x
cos
k
x
or
e
r
x
sin
k
x
A
e
r
x
cos
k
x
+
B
e
r
x
sin
k
x
x
n
A
n
x
n
+
A
n
−
1
x
n
−
1
+
⋯
+
A
1
x
+
A
0
x
n
e
r
x
A
n
x
n
e
r
x
+
A
n
−
1
x
n
−
1
e
r
x
+
⋯
+
A
0
e
r
x
x
n
cos
k
x
A
n
x
n
cos
k
x
+
⋯
+
A
0
cos
k
x
+
B
n
x
n
sin
k
x
+
⋯
+
B
0
sin
k
x
{\displaystyle {\begin{array}{cc}{\text{Inhomogeneous part}}&{\text{Guess}}\\[6pt]e^{rx}&Ae^{rx}\\\cos kx{\text{ or }}\sin kx&A\cos kx+B\sin kx\\[3pt]e^{rx}\cos kx{\text{ or }}e^{rx}\sin kx&Ae^{rx}\cos kx+Be^{rx}\sin kx\\[3pt]x^{n}&A_{n}x^{n}+A_{n-1}x^{n-1}+\cdots +A_{1}x+A_{0}\\[3pt]x^{n}e^{rx}&A_{n}x^{n}e^{rx}+A_{n-1}x^{n-1}e^{rx}+\cdots +A_{0}e^{rx}\\[3pt]x^{n}\cos kx&A_{n}x^{n}\cos kx+\cdots +A_{0}\cos kx+B_{n}x^{n}\sin kx+\cdots +B_{0}\sin kx\end{array}}}
Sometimes the guess listed above does not work, in which case it is necessary to multiply by a power of x . For example, one might guess that the equation
y
″
−
4
y
=
e
2
x
{\displaystyle y''-4y=e^{2x}\,\!}
has a solution of the form
y
=
A
e
2
x
.
{\displaystyle y=Ae^{2x}{\text{.}}\,\!}
However, this is not correct, as can be seen by substituting this guess into the equation:
4
A
e
2
x
−
4
A
e
2
x
=
e
2
x
.
{\displaystyle 4Ae^{2x}-4Ae^{2x}=e^{2x}{\text{.}}\,\!}
The correct guess is
y
=
A
x
e
2
x
,
{\displaystyle y=Axe^{2x}{\text{,}}\,\!}
which yields the solution
y
=
1
4
x
e
2
x
.
{\displaystyle y={\frac {1}{4}}xe^{2x}{\text{.}}\,\!}
The annihilator method explains this phenomenon, and can be used to determine the correct guess in a wide variety of situations.
Relation to vector spaces
edit
In linear algebra , the method of undetermined coefficients can be viewed as a simple application of function spaces and differential operators . Given an equation such as
y
″
+
3
y
′
−
5
y
=
x
3
e
x
+
2
x
e
x
,
{\displaystyle y''+3y'-5y=x^{3}e^{x}+2xe^{x}{\text{,}}\,\!}
let V be a vector space that contains the inhomogeneous part and which is closed under differentiation:
V
=
Span
{
x
3
e
x
,
x
2
e
x
,
x
e
x
,
e
x
}
.
{\displaystyle V={\text{Span}}\left\{x^{3}e^{x},x^{2}e^{x},xe^{x},e^{x}\right\}{\text{.}}\,\!}
This allows us to write a matrix for the differentiation operator:
d
d
x
[
x
3
e
x
]
=
x
3
e
x
+
3
x
2
e
x
d
d
x
[
x
2
e
x
]
=
x
2
e
x
+
2
x
e
x
d
d
x
[
x
e
x
]
=
x
e
x
+
e
x
d
d
x
[
e
x
]
=
e
x
so
D
=
[
1
3
0
0
0
1
2
0
0
0
1
1
0
0
0
1
]
{\displaystyle {\begin{alignedat}{2}{\frac {d}{dx}}\left[x^{3}e^{x}\right]&&&=x^{3}e^{x}+3x^{2}e^{x}\\{\frac {d}{dx}}\left[x^{2}e^{x}\right]&&&=x^{2}e^{x}+2xe^{x}\\{\frac {d}{dx}}\left[xe^{x}\right]&&&=xe^{x}+e^{x}\\{\frac {d}{dx}}\left[e^{x}\right]&&&=e^{x}\end{alignedat}}\;\;\;\;{\text{so}}\;\;\;\;D={\begin{bmatrix}1&3&0&0\\0&1&2&0\\0&0&1&1\\0&0&0&1\end{bmatrix}}}
We can now rewrite the differential equation as a matrix equation:
(
D
2
+
3
D
−
5
)
y
=
[
1
0
2
0
]
{\displaystyle \left(D^{2}+3D-5\right){\textbf {y}}={\begin{bmatrix}1\\0\\2\\0\end{bmatrix}}}
spanned by the functions x 3 ex , x 2 ex , xex , and ex .
Examples
edit
Find a particular solution of the equation
y
″
+
y
=
t
cos
t
{\displaystyle y''+y=t\cos {t}\!}
The right side t cos t has the form
P
n
e
α
t
cos
β
t
{\displaystyle P_{n}e^{\alpha t}\cos {\beta t}\!}
with n=1, α=0, and β=1.
Since α + iβ = i is a simple root of the characteristic equation
λ
2
+
1
=
0
{\displaystyle \lambda ^{2}+1=0\!}
we should try a particular solution of the form
y
p
=
t
[
F
1
(
t
)
e
α
t
cos
β
t
+
G
1
(
t
)
e
α
t
sin
β
t
]
{\displaystyle y_{p}=t[F_{1}(t)e^{\alpha t}\cos {\beta t}+G_{1}(t)e^{\alpha t}\sin {\beta t}]\!}
=
t
[
F
1
(
t
)
cos
t
+
G
1
(
t
)
sin
t
]
{\displaystyle =t[F_{1}(t)\cos {t}+G_{1}(t)\sin {t}]\!}
=
t
[
(
A
0
t
+
A
1
)
cos
t
+
(
B
0
t
+
B
1
)
sin
t
]
{\displaystyle =t[(A_{0}t+A_{1})\cos {t}+(B_{0}t+B_{1})\sin {t}]\!}
=
(
A
0
t
2
+
A
1
t
)
cos
t
+
(
B
0
t
2
+
B
1
t
)
sin
t
{\displaystyle =(A_{0}t^{2}+A_{1}t)\cos {t}+(B_{0}t^{2}+B_{1}t)\sin {t}\!}
Substituting yp into the differential equation, we have the identity
t
cos
t
=
y
p
″
+
y
p
{\displaystyle t\cos {t}=y_{p}''+y_{p}\!}
=
[
(
A
0
t
2
+
A
1
t
)
cos
t
+
(
B
0
t
2
+
B
1
t
)
sin
t
]
″
{\displaystyle =[(A_{0}t^{2}+A_{1}t)\cos {t}+(B_{0}t^{2}+B_{1}t)\sin {t}]''\!}
+
[
(
A
0
t
2
+
A
1
t
)
cos
t
+
(
B
0
t
2
+
B
1
t
)
sin
t
]
{\displaystyle +[(A_{0}t^{2}+A_{1}t)\cos {t}+(B_{0}t^{2}+B_{1}t)\sin {t}]\!}
=
[
2
A
0
cos
t
+
2
(
2
A
0
t
+
A
1
)
(
−
sin
t
)
+
(
A
0
t
2
+
A
1
t
)
(
−
cos
t
)
]
{\displaystyle =[2A_{0}\cos {t}+2(2A_{0}t+A_{1})(-\sin {t})+(A_{0}t^{2}+A_{1}t)(-\cos {t})]\!}
+
[
2
B
0
sin
t
+
2
(
2
B
0
t
+
B
1
)
cos
t
+
(
B
0
t
2
+
B
1
t
)
(
−
sin
t
)
]
{\displaystyle +[2B_{0}\sin {t}+2(2B_{0}t+B_{1})\cos {t}+(B_{0}t^{2}+B_{1}t)(-\sin {t})]\!}
+
[
(
A
0
t
2
+
A
1
t
)
cos
t
+
(
B
0
t
2
+
B
1
t
)
sin
t
]
{\displaystyle +[(A_{0}t^{2}+A_{1}t)\cos {t}+(B_{0}t^{2}+B_{1}t)\sin {t}]\!}
=
[
4
B
0
t
+
(
2
A
0
+
2
B
1
)
]
cos
t
+
[
−
4
A
0
t
+
(
−
2
A
1
+
2
B
0
)
]
sin
t
{\displaystyle =[4B_{0}t+(2A_{0}+2B_{1})]\cos {t}+[-4A_{0}t+(-2A_{1}+2B_{0})]\sin {t}\!}
Comparing both sides, we have
4
B
0
{\displaystyle 4B_{0}\!}
=
1
{\displaystyle =1\!}
2
A
0
{\displaystyle 2A_{0}\!}
+
{\displaystyle +\!}
2
B
1
=
0
{\displaystyle 2B_{1}=0\!}
−
4
A
0
{\displaystyle -4A_{0}\!}
=
0
{\displaystyle =0\!}
−
{\displaystyle -\!}
2
A
1
+
2
B
0
{\displaystyle 2A_{1}+2B_{0}\!}
=
0
{\displaystyle =0\!}
which has the solution
A
0
{\displaystyle A_{0}}
= 0,
A
1
{\displaystyle A_{1}}
= 1/4,
B
0
{\displaystyle B_{0}}
= 1/4,
B
1
{\displaystyle B_{1}}
= 0. We then have a particular solution
y
p
=
1
4
t
cos
t
+
1
4
t
2
sin
t
{\displaystyle y_{p}={\frac {1}{4}}t\cos {t}+{\frac {1}{4}}t^{2}\sin {t}}
Consider the following linear inhomogeneous differential equation:
d
y
d
x
=
y
+
e
x
{\displaystyle {\frac {dy}{dx}}=y+e^{x}}
This is like the first example above, except that the inhomogeneous part (
e
x
{\displaystyle e^{x}}
) is not linearly independent to the general solution of the homogeneous part (
c
1
e
x
{\displaystyle c_{1}e^{x}}
); as a result, we have to multiply our guess by a sufficiently large power of x to make it linearly independent.
Here our guess becomes:
y
p
=
A
x
e
x
{\displaystyle y_{p}=Axe^{x}}
By substituting this function and its derivative into the differential equation, one can solve for A :
d
d
x
(
A
x
e
x
)
=
A
x
e
x
+
e
x
{\displaystyle {\frac {d}{dx}}\left(Axe^{x}\right)=Axe^{x}+e^{x}}
A
x
e
x
+
A
e
x
=
A
x
e
x
+
e
x
{\displaystyle Axe^{x}+Ae^{x}=Axe^{x}+e^{x}}
A
=
1
{\displaystyle A=1}
So, the general solution to this differential equation is thus:
y
=
c
1
e
x
+
x
e
x
{\displaystyle y=c_{1}e^{x}+xe^{x}}