evan's notes
cal 3discreteodeenv systems
English

本页目录

  • Constant coefficients 的 homogeneous equations
  • 为什么尝试 exponential functions
  • 例:两个 distinct real roots
  • Principle of superposition
  • 完整求解一个 initial value problem
  • 一个 interval 上的 existence and uniqueness
  • Wronskian 与 fundamental solutions
  • Distinct real roots 的一般情形
  • 使用 distinct-root 公式
  • 例:两个互为相反数的 real roots
  • Complex characteristic roots
  • Euler's formula
  • 从一个 complex solution 得到两个 real solutions
  • 使用 complex-root 公式
  • 例:带 complex roots 的 initial value problem
  • Repeated roots
  • 构造第二个 solution
  • 例:带 repeated root 的 initial value problem
  • 选择合适的一对 solutions
  • Variable coefficients 下的 reduction of order
  • 例:寻找第二个 power-function solution
  • Nonhomogeneous equations
  • 为什么可以这样相加
  • Undetermined coefficients
  • 例:exponential forcing
  • 例:trigonometric forcing
  • Trial form 必须包含哪些项
  • 把 forcing 的和拆开处理
  • Undetermined coefficients 中的 resonance
  • 例:simple characteristic root
  • 例:repeated characteristic root
  • Trial-form 规则
  • Variation of parameters
  • 选择两个未知函数
  • 联立求解两个条件
  • General solution
  • 例:重新求解 resonant exponential forcing
  • 例:tangent forcing
  • 如何选择 particular-solution 方法

Ordinary Differential Equations

§3 Second-Order Linear Equations

Evan Luo · 2026年9月23日

Ordinary Differential Equations

§3 Second-Order Linear Equations

Evan Luo2026年9月23日

44 分钟

Second-order differential equation 的最高阶 derivative 是 y′′y''y′′,也可以含有 y′y'y′ 和 yyy。如果方程是 linear,把每一项除以最高阶项的非零系数后,可以写成 normalized form:

y′′+p(t)y′+q(t)y=g(t).y''+p(t)y'+q(t)y=g(t). y′′+p(t)y′+q(t)y=g(t).

这里的 ppp、qqq、ggg 都是 independent variable ttt 的已知函数。如果在所讨论的整个 interval 上都有 g(t)=0g(t)=0g(t)=0,方程就是 homogeneous:

y′′+p(t)y′+q(t)y=0.y''+p(t)y'+q(t)y=0. y′′+p(t)y′+q(t)y=0.

如果 ggg 不恒为零,方程就是 nonhomogeneous。其中 ggg 是 input,也叫 forcing term。

由于方程是 second order,一个 initial value problem 通常需要在同一时刻 t0t_0t0​ 给出两个条件:

y(t0)=y0,y′(t0)=y0′.y(t_0)=y_0, \qquad y'(t_0)=y'_0. y(t0​)=y0​,y′(t0​)=y0′​.

第一个条件确定起始值,第二个确定起始 slope。要同时满足这两个条件,我们需要两个 independent solutions。后面会用 Wronskian 判断选出的两个 solution 是否提供了这种自由度。

Constant coefficients 的 homogeneous equations

先考虑

ay′′+by′+cy=0,ay''+by'+cy=0, ay′′+by′+cy=0,

其中 aaa、bbb、ccc 都是常数。我们假设 a≠0a\ne0a=0,这样方程才确实是 second order。如果 a=0a=0a=0 而 b≠0b\ne0b=0,它就变成 first-order equation:

y′=−cby,y'=-\frac cb y, y′=−bc​y,

其 solution 为 y(t)=Ce−(c/b)ty(t)=Ce^{-(c/b)t}y(t)=Ce−(c/b)t。

为什么尝试 exponential functions

这个方程要求函数值、slope 和 second derivative 之间满足一个关系。对于 a≠0a\ne0a=0,如果能找到一种求 derivative 后形式不变的函数,三个项就可以提取共同因子。Exponential function 正好有这个性质。令

y(t)=ert,y(t)=e^{rt}, y(t)=ert,

其中 rrr 是待求的常数。每求一次 derivative,只会多出一个 rrr:

y′(t)=rert,y′′(t)=r2ert.y'(t)=re^{rt}, \qquad y''(t)=r^2e^{rt}. y′(t)=rert,y′′(t)=r2ert.

把这些表达式放回 differential equation:

ar2ert+brert+cert=0.ar^2e^{rt}+bre^{rt}+ce^{rt}=0. ar2ert+brert+cert=0.

提取共同的 exponential 因子:

ert(ar2+br+c)=0.e^{rt}\bigl(ar^2+br+c\bigr)=0. ert(ar2+br+c)=0.

因为 erte^{rt}ert 永远不为零,polynomial 因子必须为零:

ar2+br+c=0.\boxed{ar^2+br+c=0}. ar2+br+c=0​.

这个 polynomial

P(r)=ar2+br+cP(r)=ar^2+br+c P(r)=ar2+br+c

称为 characteristic polynomial,而 P(r)=0P(r)=0P(r)=0 称为 characteristic equation。每个 real root 都会给出一个 real exponential solution。Repeated roots 和 nonreal roots 需要再做一步处理,所以先看两个 distinct real roots 的例子。

例:两个 distinct real roots

考虑

y′′+5y′+6y=0.y''+5y'+6y=0. y′′+5y′+6y=0.

它的 characteristic equation 是

r2+5r+6=0.r^2+5r+6=0. r2+5r+6=0.

将它 factorize:

(r+2)(r+3)=0.(r+2)(r+3)=0. (r+2)(r+3)=0.

得到 roots

r1=−2,r2=−3,r_1=-2, \qquad r_2=-3, r1​=−2,r2​=−3,

因此有两个 solutions:

y1(t)=e−2t,y2(t)=e−3t.y_1(t)=e^{-2t}, \qquad y_2(t)=e^{-3t}. y1​(t)=e−2t,y2​(t)=e−3t.

Principle of superposition

对于 homogeneous equation

y′′+p(t)y′+q(t)y=0,y''+p(t)y'+q(t)y=0, y′′+p(t)y′+q(t)y=0,

solutions 的任意 linear combination 仍然是 solution。这就是 principle of superposition:如果 y1y_1y1​ 和 y2y_2y2​ 都满足方程,那么

y(t)=C1y1(t)+C2y2(t)y(t)=C_1y_1(t)+C_2y_2(t) y(t)=C1​y1​(t)+C2​y2​(t)

对于任意 C1,C2∈RC_1,C_2\in\mathbb RC1​,C2​∈R 也满足方程。

原因在于 differentiation 是 linear 的。定义 differential operator

L[y]=y′′+p(t)y′+q(t)y.L[y]=y''+p(t)y'+q(t)y. L[y]=y′′+p(t)y′+q(t)y.

则

L[C1y1+C2y2]=C1L[y1]+C2L[y2]=C1(0)+C2(0)=0.\begin{aligned} L[C_1y_1+C_2y_2] &=C_1L[y_1]+C_2L[y_2]\\ &=C_1(0)+C_2(0)\\ &=0. \end{aligned} L[C1​y1​+C2​y2​]​=C1​L[y1​]+C2​L[y2​]=C1​(0)+C2​(0)=0.​

这个论证依赖于右侧为零。如果 L[y1]=gL[y_1]=gL[y1​]=g 且 L[y2]=gL[y_2]=gL[y2​]=g,那么

L[C1y1+C2y2]=(C1+C2)g,L[C_1y_1+C_2y_2]=(C_1+C_2)g, L[C1​y1​+C2​y2​]=(C1​+C2​)g,

一般并不等于 ggg。因此,可以任意 superpose solutions 是 associated homogeneous equation 的性质,不能直接用于 forcing 固定的 nonhomogeneous equation。

完整求解一个 initial value problem

回到方程

y′′+5y′+6y=0.y''+5y'+6y=0. y′′+5y′+6y=0.

根据 superposition,得到 solution family

y(t)=C1e−2t+C2e−3t.y(t)=C_1e^{-2t}+C_2e^{-3t}. y(t)=C1​e−2t+C2​e−3t.

现在加上 initial conditions:

y(0)=2,y′(0)=3.y(0)=2, \qquad y'(0)=3. y(0)=2,y′(0)=3.

把 t=0t=0t=0 分别代入 solution 及其 derivative,得到

C1+C2=2,C_1+C_2=2, C1​+C2​=2,

以及

−2C1−3C2=3.-2C_1-3C_2=3. −2C1​−3C2​=3.

同一个方程组也可以写成 matrix 形式:

(11−2−3)(C1C2)=(23).\begin{pmatrix} 1&1\\ -2&-3 \end{pmatrix} \begin{pmatrix} C_1\\ C_2 \end{pmatrix} = \begin{pmatrix} 2\\ 3 \end{pmatrix}. (1−2​1−3​)(C1​C2​​)=(23​).

这个 matrix 的 determinant 是 −1-1−1,因此方程组有唯一解:

C1=9,C2=−7.C_1=9, \qquad C_2=-7. C1​=9,C2​=−7.

所以 IVP 的 unique solution 为

y(t)=9e−2t−7e−3t.\boxed{y(t)=9e^{-2t}-7e^{-3t}}. y(t)=9e−2t−7e−3t​.

直接检查两个 initial conditions:

y(0)=9−7=2,y′(t)=−18e−2t+21e−3t,y′(0)=−18+21=3.\begin{aligned} y(0)&=9-7=2,\\ y'(t)&=-18e^{-2t}+21e^{-3t},\\ y'(0)&=-18+21=3. \end{aligned} y(0)y′(t)y′(0)​=9−7=2,=−18e−2t+21e−3t,=−18+21=3.​

The initial slope lifts the solution before both modes decay

Solution of the second-order initial-value problemThe solution starts at height two with initial slope three, rises to one maximum, and then approaches zero from above as time increases.y(0)=2y′(0)=3y(t)=9e−2t−7e−3tty
The curve y(t)=9e−2t−7e−3t starts at y(0)=2 and initially rises because y′(0)=3. Both exponential modes decay, so the solution eventually approaches zero from above.

Initial slope 为正,所以曲线一开始会上升。随着 ttt 增大,两个 exponential 项都趋于零,因此整个 solution 最终也趋于零。

一个 interval 上的 existence and uniqueness

考虑 linear IVP

y′′+p(t)y′+q(t)y=g(t),y(t0)=y0,y′(t0)=y0′.\begin{aligned} y''+p(t)y'+q(t)y&=g(t),\\ y(t_0)&=y_0,\\ y'(t_0)&=y'_0. \end{aligned} y′′+p(t)y′+q(t)yy(t0​)y′(t0​)​=g(t),=y0​,=y0′​.​

设 III 是 open interval,且 t0∈It_0\in It0​∈I。如果 ppp、qqq、ggg 在 III 上都 continuous,那么这个 IVP 在整个 III 上恰有一个 solution:

y:I→R.y:I\to\mathbb R. y:I→R.

这个结论不只是 local 的。只要 normalized coefficients 在 interval 内仍然 continuous,solution 就不会在某个内部点突然终止。定理保证的范围是所选的 coefficient interval,而这个 interval 不一定是整个 R\mathbb RR。

如果原方程写成

a2(t)y′′+a1(t)y′+a0(t)y=h(t),a_2(t)y''+a_1(t)y'+a_0(t)y=h(t), a2​(t)y′′+a1​(t)y′+a0​(t)y=h(t),

应先除以 a2(t)a_2(t)a2​(t)。Normalized coefficients 为

p(t)=a1(t)a2(t),q(t)=a0(t)a2(t),g(t)=h(t)a2(t).p(t)=\frac{a_1(t)}{a_2(t)}, \qquad q(t)=\frac{a_0(t)}{a_2(t)}, \qquad g(t)=\frac{h(t)}{a_2(t)}. p(t)=a2​(t)a1​(t)​,q(t)=a2​(t)a0​(t)​,g(t)=a2​(t)h(t)​.

定理适用于满足 a2(t)≠0a_2(t)\ne0a2​(t)=0 且这三个商都 continuous 的 interval。a2a_2a2​ 的零点可能把 real line 分成几个不同的 coefficient intervals。

Wronskian 与 fundamental solutions

两个 solutions 是否足以匹配任意起始值和 slope?Wronskian 就是用来回答这个问题的。对于两个 differentiable functions fff 和 ggg,其 Wronskian 定义为

W[f,g](t)=det⁡(f(t)g(t)f′(t)g′(t))=f(t)g′(t)−f′(t)g(t).\begin{aligned} W[f,g](t) &=\det \begin{pmatrix} f(t)&g(t)\\ f'(t)&g'(t) \end{pmatrix}\\ &=f(t)g'(t)-f'(t)g(t). \end{aligned} W[f,g](t)​=det(f(t)f′(t)​g(t)g′(t)​)=f(t)g′(t)−f′(t)g(t).​

Wronskian 检查这两个 solution functions 是否提供 independent initial data。假设 y1y_1y1​ 和 y2y_2y2​ 在 III 上满足同一个 homogeneous second-order linear equation,且 ppp、qqq 在该 interval 上 continuous。若要让

y=C1y1+C2y2y=C_1y_1+C_2y_2 y=C1​y1​+C2​y2​

满足 t0t_0t0​ 处给定的值,常数必须满足

(y1(t0)y2(t0)y1′(t0)y2′(t0))(C1C2)=(y0y0′).\begin{pmatrix} y_1(t_0)&y_2(t_0)\\ y_1'(t_0)&y_2'(t_0) \end{pmatrix} \begin{pmatrix} C_1\\ C_2 \end{pmatrix} = \begin{pmatrix} y_0\\ y'_0 \end{pmatrix}. (y1​(t0​)y1′​(t0​)​y2​(t0​)y2′​(t0​)​)(C1​C2​​)=(y0​y0′​​).

Coefficient matrix 的 determinant 正好是

W[y1,y2](t0).W[y_1,y_2](t_0). W[y1​,y2​](t0​).

这个 matrix 能匹配每一组 initial values,当且仅当

W[y1,y2](t0)≠0.\boxed{W[y_1,y_2](t_0)\ne0}. W[y1​,y2​](t0​)=0​.

此时 matrix 是 invertible 的,因此每一组 initial values 都确定唯一一组常数 C1,C2C_1,C_2C1​,C2​。再由 existence and uniqueness theorem 可知,这个 linear combination 就是满足该组 initial values 的唯一 solution。

这时称 {y1,y2}\{y_1,y_2\}{y1​,y2​} 为 III 上的 fundamental set of solutions,而

y(t)=C1y1(t)+C2y2(t)\boxed{y(t)=C_1y_1(t)+C_2y_2(t)} y(t)=C1​y1​(t)+C2​y2​(t)​

就是 homogeneous equation 的 general solution:在 III 上,每一个 solution 都唯一对应一组 C1C_1C1​ 和 C2C_2C2​。

以前面的 y1=e−2ty_1=e^{-2t}y1​=e−2t 和 y2=e−3ty_2=e^{-3t}y2​=e−3t 为例,

W[y1,y2](t)=e−2t(−3e−3t)−(−2e−2t)e−3t=−e−5t.\begin{aligned} W[y_1,y_2](t) &=e^{-2t}\bigl(-3e^{-3t}\bigr) -\bigl(-2e^{-2t}\bigr)e^{-3t}\\ &=-e^{-5t}. \end{aligned} W[y1​,y2​](t)​=e−2t(−3e−3t)−(−2e−2t)e−3t=−e−5t.​

它永远不为零,所以这两个 exponential functions 在 R\mathbb RR 上构成 fundamental set of solutions。

Distinct real roots 的一般情形

假设 a,b,c∈Ra,b,c\in\mathbb Ra,b,c∈R 且 a≠0a\ne0a=0。由 quadratic formula,

r=−b±Δ2a,Δ=b2−4ac,r=\frac{-b\pm\sqrt{\Delta}}{2a}, \qquad \Delta=b^2-4ac, r=2a−b±Δ​​,Δ=b2−4ac,

其中 Δ\DeltaΔ 读作 delta,称为 discriminant。它的正负决定三种 root 情形:

  • Δ>0\Delta>0Δ>0:两个 distinct real roots;
  • Δ<0\Delta<0Δ<0:两个 complex-conjugate roots;
  • Δ=0\Delta=0Δ=0:一个 repeated real root。

先考虑第一种。设两个 real roots 满足 r1≠r2r_1\ne r_2r1​=r2​,则

y1(t)=er1t,y2(t)=er2ty_1(t)=e^{r_1t}, \qquad y_2(t)=e^{r_2t} y1​(t)=er1​t,y2​(t)=er2​t

都是 solutions。它们的 Wronskian 为

W[y1,y2](t)=∣er1ter2tr1er1tr2er2t∣=(r2−r1)e(r1+r2)t.\begin{aligned} W[y_1,y_2](t) &= \begin{vmatrix} e^{r_1t}&e^{r_2t}\\ r_1e^{r_1t}&r_2e^{r_2t} \end{vmatrix}\\ &=(r_2-r_1)e^{(r_1+r_2)t}. \end{aligned} W[y1​,y2​](t)​=​er1​tr1​er1​t​er2​tr2​er2​t​​=(r2​−r1​)e(r1​+r2​)t.​

Exponential 因子永远不为零,且 r2−r1≠0r_2-r_1\ne0r2​−r1​=0,所以 Wronskian 永远不为零。这两个 exponential functions 因而构成 fundamental set,每个 real solution 都可以写成

y(t)=C1er1t+C2er2t.\boxed{y(t)=C_1e^{r_1t}+C_2e^{r_2t}}. y(t)=C1​er1​t+C2​er2​t​.

使用 distinct-root 公式

例:两个互为相反数的 real roots

考虑 initial value problem

y′′−y=0,y(0)=1,y′(0)=−1.y''-y=0, \qquad y(0)=1, \qquad y'(0)=-1. y′′−y=0,y(0)=1,y′(0)=−1.

Characteristic equation 可以 factorize 为

r2−1=(r−1)(r+1)=0,r^2-1=(r-1)(r+1)=0, r2−1=(r−1)(r+1)=0,

所以 roots 是 −1-1−1 和 111。选取

y1(t)=e−t,y2(t)=et.y_1(t)=e^{-t}, \qquad y_2(t)=e^t. y1​(t)=e−t,y2​(t)=et.

其 Wronskian 为

W[y1,y2](t)=∣e−tet−e−tet∣=2,W[y_1,y_2](t) = \begin{vmatrix} e^{-t}&e^t\\ -e^{-t}&e^t \end{vmatrix} =2, W[y1​,y2​](t)=​e−t−e−t​etet​​=2,

因此 general solution 是

y(t)=C1e−t+C2et.y(t)=C_1e^{-t}+C_2e^t. y(t)=C1​e−t+C2​et.

Initial conditions 给出

C1+C2=1,−C1+C2=−1.C_1+C_2=1, \qquad -C_1+C_2=-1. C1​+C2​=1,−C1​+C2​=−1.

把两个等式相加得 C2=0C_2=0C2​=0,再得 C1=1C_1=1C1​=1。所以 unique solution 是

y(t)=e−t.\boxed{y(t)=e^{-t}}. y(t)=e−t​.

Complex characteristic roots

现在设 Δ<0\Delta<0Δ<0。Quadratic formula 可以写成

r=−b2a±−Δ2ai=λ±iμ,r= \frac{-b}{2a} \pm \frac{\sqrt{-\Delta}}{2a}i =\lambda\pm i\mu, r=2a−b​±2a−Δ​​i=λ±iμ,

其中 iii 是 imaginary unit,满足 i2=−1i^2=-1i2=−1,并且

λ=−b2a,μ=−Δ2a≠0.\lambda=-\frac{b}{2a}, \qquad \mu=\frac{\sqrt{-\Delta}}{2a}\ne0. λ=−2ab​,μ=2a−Δ​​=0.

λ\lambdaλ 和 μ\muμ 都是 real numbers。这两个 roots 是 complex conjugates:real part 相同,imaginary part 互为相反数。

Euler's formula

要把 complex exponentials 转成 real functions,可以从 Taylor series 出发:

ez=∑k=0∞zkk!,z∈C.e^z=\sum_{k=0}^{\infty}\frac{z^k}{k!}, \qquad z\in\mathbb C. ez=k=0∑∞​k!zk​,z∈C.

这里 C\mathbb CC 是 complex numbers 的集合,k!k!k! 是 nonnegative integer kkk 的 factorial。对 real number xxx,令 z=ixz=ixz=ix。利用 i2=−1i^2=-1i2=−1、i3=−ii^3=-ii3=−i 和 i4=1i^4=1i4=1,得到

eix=1+ix−x22!−ix33!+x44!+ix55!−⋯=(1−x22!+x44!−⋯ )+i(x−x33!+x55!−⋯ ).\begin{aligned} e^{ix} &=1+ix-\frac{x^2}{2!}-i\frac{x^3}{3!} +\frac{x^4}{4!}+i\frac{x^5}{5!}-\cdots\\ &=\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\right) +i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\right). \end{aligned} eix​=1+ix−2!x2​−i3!x3​+4!x4​+i5!x5​−⋯=(1−2!x2​+4!x4​−⋯)+i(x−3!x3​+5!x5​−⋯).​

第一个括号是 cosine 的 Taylor series,第二个是 sine 的 Taylor series。因此

eix=cos⁡x+isin⁡x.\boxed{e^{ix}=\cos x+i\sin x}. eix=cosx+isinx​.

这就是 Euler's formula。

从一个 complex solution 得到两个 real solutions

在 Euler's formula 中令 x=μtx=\mu tx=μt:

e(λ+iμ)t=eλteiμt=eλt(cos⁡(μt)+isin⁡(μt))=eλtcos⁡(μt)+i eλtsin⁡(μt).\begin{aligned} e^{(\lambda+i\mu)t} &=e^{\lambda t}e^{i\mu t}\\ &=e^{\lambda t}\bigl(\cos(\mu t)+i\sin(\mu t)\bigr)\\ &=e^{\lambda t}\cos(\mu t) +i\,e^{\lambda t}\sin(\mu t). \end{aligned} e(λ+iμ)t​=eλteiμt=eλt(cos(μt)+isin(μt))=eλtcos(μt)+ieλtsin(μt).​

它的 real part 和 imaginary part 分别是下面两个 real-valued functions:

y1(t)=eλtcos⁡(μt),y2(t)=eλtsin⁡(μt).y_1(t)=e^{\lambda t}\cos(\mu t), \qquad y_2(t)=e^{\lambda t}\sin(\mu t). y1​(t)=eλtcos(μt),y2​(t)=eλtsin(μt).

为什么这两部分各自满足 ODE?定义

L[y]=ay′′+by′+cy,L[y]=ay''+by'+cy, L[y]=ay′′+by′+cy,

其中 aaa、bbb、ccc 都是 real numbers。如果 y=y1+iy2y=y_1+iy_2y=y1​+iy2​ 满足方程,由 linearity,

0=L[y1+iy2]=L[y1]+iL[y2].0=L[y_1+iy_2]=L[y_1]+iL[y_2]. 0=L[y1​+iy2​]=L[y1​]+iL[y2​].

一个 complex number 为零,当且仅当它的 real part 和 imaginary part 都为零。因此

L[y1]=0,L[y2]=0.L[y_1]=0, \qquad L[y_2]=0. L[y1​]=0,L[y2​]=0.

所以 real part 和 imaginary part 分别都是原方程的 real-valued solutions。

它们的 Wronskian 为

W[y1,y2](t)=∣eλtcos⁡(μt)eλtsin⁡(μt)eλt(λcos⁡(μt)−μsin⁡(μt))eλt(λsin⁡(μt)+μcos⁡(μt))∣=μe2λt(cos⁡2(μt)+sin⁡2(μt))=μe2λt≠0.\begin{aligned} W[y_1,y_2](t) &= \begin{vmatrix} e^{\lambda t}\cos(\mu t)&e^{\lambda t}\sin(\mu t)\\ e^{\lambda t}\bigl(\lambda\cos(\mu t)-\mu\sin(\mu t)\bigr)& e^{\lambda t}\bigl(\lambda\sin(\mu t)+\mu\cos(\mu t)\bigr) \end{vmatrix}\\ &=\mu e^{2\lambda t} \bigl(\cos^2(\mu t)+\sin^2(\mu t)\bigr)\\ &=\mu e^{2\lambda t}\ne0. \end{aligned} W[y1​,y2​](t)​=​eλtcos(μt)eλt(λcos(μt)−μsin(μt))​eλtsin(μt)eλt(λsin(μt)+μcos(μt))​​=μe2λt(cos2(μt)+sin2(μt))=μe2λt=0.​

因此这两个 real functions 构成 fundamental set,real general solution 为

y(t)=C1eλtcos⁡(μt)+C2eλtsin⁡(μt).\boxed{ y(t)=C_1e^{\lambda t}\cos(\mu t) +C_2e^{\lambda t}\sin(\mu t) }. y(t)=C1​eλtcos(μt)+C2​eλtsin(μt)​.

使用 complex-root 公式

例:带 complex roots 的 initial value problem

求解

y′′−2y′+5y=0,y(0)=1,y′(0)=0.y''-2y'+5y=0, \qquad y(0)=1, \qquad y'(0)=0. y′′−2y′+5y=0,y(0)=1,y′(0)=0.

Characteristic equation 为

r2−2r+5=0,r^2-2r+5=0, r2−2r+5=0,

由 quadratic formula,

r=2±4−202=1±2i.r=\frac{2\pm\sqrt{4-20}}{2}=1\pm2i. r=22±4−20​​=1±2i.

所以 λ=1\lambda=1λ=1、μ=2\mu=2μ=2,并且

y(t)=C1etcos⁡(2t)+C2etsin⁡(2t).y(t)=C_1e^t\cos(2t)+C_2e^t\sin(2t). y(t)=C1​etcos(2t)+C2​etsin(2t).

要使用 slope 条件,先求 derivative:

y′(t)=C1et(cos⁡(2t)−2sin⁡(2t))+C2et(sin⁡(2t)+2cos⁡(2t)).\begin{aligned} y'(t) &=C_1e^t\bigl(\cos(2t)-2\sin(2t)\bigr)\\ &\quad+C_2e^t\bigl(\sin(2t)+2\cos(2t)\bigr). \end{aligned} y′(t)​=C1​et(cos(2t)−2sin(2t))+C2​et(sin(2t)+2cos(2t)).​

在 t=0t=0t=0 处,

y(0)=C1=1,y′(0)=C1+2C2=0.y(0)=C_1=1, \qquad y'(0)=C_1+2C_2=0. y(0)=C1​=1,y′(0)=C1​+2C2​=0.

于是 C2=−1/2C_2=-1/2C2​=−1/2,unique solution 为

y(t)=etcos⁡(2t)−12etsin⁡(2t).\boxed{ y(t)=e^t\cos(2t)-\frac12e^t\sin(2t) }. y(t)=etcos(2t)−21​etsin(2t)​.

Repeated roots

如果 discriminant 为零,characteristic equation 只有一个 root,但它出现两次:

r=−b2a,b2−4ac=0.r=-\frac{b}{2a}, \qquad b^2-4ac=0. r=−2ab​,b2−4ac=0.

Exponential function y1(t)=erty_1(t)=e^{rt}y1​(t)=ert 仍然是 solution。但 C1ert+C2ertC_1e^{rt}+C_2e^{rt}C1​ert+C2​ert 并不能给出两个 independent solutions,因为它只是 (C1+C2)ert(C_1+C_2)e^{rt}(C1​+C2​)ert。我们需要的第二个函数不能是第一个的 constant multiple。

例如,

y′′−2y′+y=0y''-2y'+y=0 y′′−2y′+y=0

的 characteristic equation 为 (r−1)2=0(r-1)^2=0(r−1)2=0,所以 y1(t)=ety_1(t)=e^ty1​(t)=et。要找出缺少的 solution,可以保留这个 exponential function,但让乘在它前面的因子随时间变化。

构造第二个 solution

对于一般的 repeated root r=−b/(2a)r=-b/(2a)r=−b/(2a),尝试

y2(t)=v(t)y1(t),y_2(t)=v(t)y_1(t), y2​(t)=v(t)y1​(t),

其中 y1(t)=erty_1(t)=e^{rt}y1​(t)=ert 已知,v(t)v(t)v(t) 未知。这就是 reduction of order 的思路:利用一个已知 solution,把寻找另一个 solution 的问题化为 first-order problem。

用 product rule 求 derivative:

y2′=v′y1+vy1′,y2′′=v′′y1+2v′y1′+vy1′′.\begin{aligned} y_2'&=v'y_1+vy_1',\\ y_2''&=v''y_1+2v'y_1'+vy_1''. \end{aligned} y2′​y2′′​​=v′y1​+vy1′​,=v′′y1​+2v′y1′​+vy1′′​.​

代入 ay2′′+by2′+cy2=0ay_2''+by_2'+cy_2=0ay2′′​+by2′​+cy2​=0,并按 vvv 的各阶 derivative 整理:

ay1v′′+(2ay1′+by1)v′+(ay1′′+by1′+cy1)v=0.ay_1v''+(2ay_1'+by_1)v' +(ay_1''+by_1'+cy_1)v=0. ay1​v′′+(2ay1′​+by1​)v′+(ay1′′​+by1′​+cy1​)v=0.

因为 y1y_1y1​ 已经满足方程,vvv 的系数为零,剩下

ay1v′′+(2ay1′+by1)v′=0.ay_1v''+(2ay_1'+by_1)v'=0. ay1​v′′+(2ay1′​+by1​)v′=0.

这个方程中没有未求 derivative 的 vvv。令 w=v′w=v'w=v′,就得到 first-order equation:

ay1w′+(2ay1′+by1)w=0.ay_1w'+(2ay_1'+by_1)w=0. ay1​w′+(2ay1′​+by1​)w=0.

对于 repeated root,还能进一步简化。由于 y1′=ry1y_1'=ry_1y1′​=ry1​ 且 2ar+b=02ar+b=02ar+b=0,

2ay1′+by1=(2ar+b)y1=0.2ay_1'+by_1=(2ar+b)y_1=0. 2ay1′​+by1​=(2ar+b)y1​=0.

因此 ay1w′=0ay_1w'=0ay1​w′=0。aaa 和 exponential function y1y_1y1​ 都不为零,所以 w′=0w'=0w′=0。连续 integrate 两次,得到

w(t)=K,v(t)=Kt+D,w(t)=K, \qquad v(t)=Kt+D, w(t)=K,v(t)=Kt+D,

其中 KKK 和 DDD 都是常数。因此

v(t)y1(t)=Ktert+Dert.v(t)y_1(t)=Kte^{rt}+De^{rt}. v(t)y1​(t)=Ktert+Dert.

DertDe^{rt}Dert 只是已有 solution 的倍数。选择 D=0D=0D=0、K=1K=1K=1,就留下新的 solution:

y2(t)=tert.\boxed{y_2(t)=te^{rt}}. y2​(t)=tert​.

它与 y1y_1y1​ 的 Wronskian 为

W[y1,y2](t)=∣erttertrertert+rtert∣=ert(ert+rtert)−rerttert=e2rt≠0.\begin{aligned} W[y_1,y_2](t) &=\begin{vmatrix} e^{rt}&te^{rt}\\ re^{rt}&e^{rt}+rte^{rt} \end{vmatrix}\\ &=e^{rt}(e^{rt}+rte^{rt})-re^{rt}te^{rt}\\ &=e^{2rt}\ne0. \end{aligned} W[y1​,y2​](t)​=​ertrert​tertert+rtert​​=ert(ert+rtert)−rerttert=e2rt=0.​

所以 {ert,tert}\{e^{rt},te^{rt}\}{ert,tert} 在 R\mathbb RR 上构成 fundamental set。General solution 为

y(t)=C1ert+C2tert=(C1+C2t)ert.\boxed{y(t)=C_1e^{rt}+C_2te^{rt}=(C_1+C_2t)e^{rt}}. y(t)=C1​ert+C2​tert=(C1​+C2​t)ert​.

特别地,方程 y′′−2y′+y=0y''-2y'+y=0y′′−2y′+y=0 的 general solution 是 y(t)=(C1+C2t)ety(t)=(C_1+C_2t)e^ty(t)=(C1​+C2​t)et。

例:带 repeated root 的 initial value problem

求解

y′′−y′+14y=0,y(0)=2,y′(0)=13.y''-y'+\frac14y=0, \qquad y(0)=2, \qquad y'(0)=\frac13. y′′−y′+41​y=0,y(0)=2,y′(0)=31​.

Characteristic polynomial 可以 factorize 为

r2−r+14=(r−12)2,r^2-r+\frac14=\left(r-\frac12\right)^2, r2−r+41​=(r−21​)2,

所以 repeated root 是 r=1/2r=1/2r=1/2。General solution 及其 derivative 为

y(t)=C1et/2+C2tet/2,y′(t)=C12et/2+C2et/2+C22tet/2.\begin{aligned} y(t)&=C_1e^{t/2}+C_2te^{t/2},\\ y'(t)&=\frac{C_1}{2}e^{t/2} +C_2e^{t/2}+\frac{C_2}{2}te^{t/2}. \end{aligned} y(t)y′(t)​=C1​et/2+C2​tet/2,=2C1​​et/2+C2​et/2+2C2​​tet/2.​

起始值先确定 C1C_1C1​,再用 slope 确定 C2C_2C2​:

C1=2,C12+C2=13,C2=−23.C_1=2, \qquad \frac{C_1}{2}+C_2=\frac13, \qquad C_2=-\frac23. C1​=2,2C1​​+C2​=31​,C2​=−32​.

于是 unique solution 为

y(t)=(2−23t)et/2.\boxed{y(t)=\left(2-\frac23t\right)e^{t/2}}. y(t)=(2−32​t)et/2​.

虽然 et/2e^{t/2}et/2 会增长,但前面的因子会改变正负。求 derivative 可以看清整体变化:

y′(t)=1−t3et/2.y'(t)=\frac{1-t}{3}e^{t/2}. y′(t)=31−t​et/2.

对于 t≥0t\ge0t≥0,solution 在 t=1t=1t=1 之前上升,之后下降,并在 t=3t=3t=3 处穿过零。

如果保留 y(0)=2y(0)=2y(0)=2,但把 initial slope 改成 y′(0)=2y'(0)=2y′(0)=2,常数就改为满足 C1=2C_1=2C1​=2 和 1+C2=21+C_2=21+C2​=2。这给出

y(t)=(2+t)et/2,y(t)=(2+t)e^{t/2}, y(t)=(2+t)et/2,

它在 t≥0t\ge0t≥0 时一直增长。两条曲线满足同一个 ODE,也从同一个点出发;第二个 initial condition 决定我们得到哪一条。

The same initial value, two different slopesBoth solutions start at time zero with value two. The blue curve has initial slope one third, reaches a maximum at time one, and crosses zero at time three. The dark curve has initial slope two and keeps rising beyond the top of the plotted window.000111222333−1-1−1111222333444tttyyy
y′(0)=13y'(0)=\frac13y′(0)=31​y=(2−23t)et/2y=\left(2-\frac23t\right)e^{t/2}y=(2−32​t)et/2
y′(0)=2y'(0)=2y′(0)=2y=(2+t)et/2y=(2+t)e^{t/2}y=(2+t)et/2
The smaller initial slope gives a brief rise followed by a fall. Its maximum is at t=1t=1t=1, and it crosses zero at t=3t=3t=3. The other solution keeps increasing; it does not end where it leaves the plotted window.

选择合适的一对 solutions

对于 real constant coefficients 且 a≠0a\ne0a=0 的 ay′′+by′+cy=0ay''+by'+cy=0ay′′+by′+cy=0,三种 characteristic-root 情形分别给出以下 fundamental sets:

Characteristic roots第一个 solution第二个 solution
两个 distinct real roots r1≠r2r_1\ne r_2r1​=r2​er1te^{r_1t}er1​ter2te^{r_2t}er2​t
Nonreal roots λ±iμ\lambda\pm i\muλ±iμ,μ≠0\mu\ne0μ=0eλtcos⁡(μt)e^{\lambda t}\cos(\mu t)eλtcos(μt)eλtsin⁡(μt)e^{\lambda t}\sin(\mu t)eλtsin(μt)
Repeated real root rrrerte^{rt}erttertte^{rt}tert

每种情形都先组合成 y=C1y1+C2y2y=C_1y_1+C_2y_2y=C1​y1​+C2​y2​,再用 initial value 和 initial slope 求出常数。

Variable coefficients 下的 reduction of order

即使 coefficients 不是常数,同一个 substitution 仍然有效。考虑

y′′+p(t)y′+q(t)y=0,y''+p(t)y'+q(t)y=0, y′′+p(t)y′+q(t)y=0,

其中 ppp、qqq 在 open interval III 上 continuous。假设已知一个 solution y1y_1y1​。由于接下来要除以它,应在 y1(t)≠0y_1(t)\ne0y1​(t)=0 的 interval 上操作。如果已知 solution 有零点,就选择避开该零点的较小 interval,不能直接除过去。

仍令 y2=vy1y_2=vy_1y2​=vy1​。利用前面的 product-rule derivatives,得到

y1v′′+(2y1′+p(t)y1)v′+(y1′′+p(t)y1′+q(t)y1)v=0.y_1v''+\bigl(2y_1'+p(t)y_1\bigr)v' +\bigl(y_1''+p(t)y_1'+q(t)y_1\bigr)v=0. y1​v′′+(2y1′​+p(t)y1​)v′+(y1′′​+p(t)y1′​+q(t)y1​)v=0.

因为 y1y_1y1​ 满足原方程,最后一个括号为零,于是

y1v′′+(2y1′+p(t)y1)v′=0.y_1v''+\bigl(2y_1'+p(t)y_1\bigr)v'=0. y1​v′′+(2y1′​+p(t)y1​)v′=0.

令 w=v′w=v'w=v′,并除以 y1y_1y1​:

w′+(2y1′y1+p(t))w=0.\boxed{w'+\left(2\frac{y_1'}{y_1}+p(t)\right)w=0}. w′+(2y1​y1′​​+p(t))w=0​.

这是关于 www 的 first-order linear equation,同时也是 separable equation。与 repeated-root 的情形不同,www 的系数不一定为零。

先求出 www,再 integrate v′=wv'=wv′=w,最后乘以 y1y_1y1​。在 vvv 中加一个常数,只会给结果增加一个 y1y_1y1​ 的倍数,因此选择第二个 solution 时可以把这个常数设为零。w=0w=0w=0 也只会得到 y1y_1y1​ 的倍数;要得到 independent solution,应选择一个 nonzero solution www。

例:寻找第二个 power-function solution

考虑

y′′+32ty′−12t2y=0,t>0.y''+\frac{3}{2t}y'-\frac{1}{2t^2}y=0, \qquad t>0. y′′+2t3​y′−2t21​y=0,t>0.

已知 y1(t)=1/ty_1(t)=1/ty1​(t)=1/t。先检查它是否确实满足方程:

y1′=−1t2,y1′′=2t3,y_1'=-\frac{1}{t^2}, \qquad y_1''=\frac{2}{t^3}, y1′​=−t21​,y1′′​=t32​,

因此

y1′′+32ty1′−12t2y1=2t3−32t3−12t3=0.y_1''+\frac{3}{2t}y_1'-\frac{1}{2t^2}y_1 =\frac{2}{t^3}-\frac{3}{2t^3}-\frac{1}{2t^3}=0. y1′′​+2t3​y1′​−2t21​y1​=t32​−2t33​−2t31​=0.

这里 p(t)=3/(2t)p(t)=3/(2t)p(t)=3/(2t),且 y1y_1y1​ 在 (0,∞)(0,\infty)(0,∞) 上不为零。代入 w=v′w=v'w=v′ 所满足的方程:

1tw′+(−2t2+32t2)w=0.\frac1t w' +\left(-\frac{2}{t^2}+\frac{3}{2t^2}\right)w=0. t1​w′+(−t22​+2t23​)w=0.

乘以 ttt 并整理:

w′−12tw=0.w'-\frac{1}{2t}w=0. w′−2t1​w=0.

我们要找 nonzero solution,所以可以 separate variables 后 integrate:

dww=dt2t,ln⁡∣w∣=12ln⁡t+C.\frac{dw}{w}=\frac{dt}{2t}, \qquad \ln|w|=\frac12\ln t+C. wdw​=2tdt​,ln∣w∣=21​lnt+C.

Absolute value 允许 www 取正值或负值。因为 t>0t>0t>0,ttt 外面不需要 absolute value。两边取 exponential,并把正负号并入常数 KKK,得到

w(t)=Kt1/2.w(t)=Kt^{1/2}. w(t)=Kt1/2.

这一步只有一个常数。Integrate v′=wv'=wv′=w 时,第二个常数才会出现:

v(t)=2K3t3/2+B.v(t)=\frac{2K}{3}t^{3/2}+B. v(t)=32K​t3/2+B.

所以

v(t)y1(t)=(2K3t3/2+B)1t=2K3t1/2+Bt.v(t)y_1(t) =\left(\frac{2K}{3}t^{3/2}+B\right)\frac1t =\frac{2K}{3}t^{1/2}+\frac Bt. v(t)y1​(t)=(32K​t3/2+B)t1​=32K​t1/2+tB​.

B/tB/tB/t 已经是 y1y_1y1​ 的倍数。选择 B=0B=0B=0 和 K=32K=\frac32K=23​,便得到一个形式简洁的第二个 solution:

y2(t)=t1/2.y_2(t)=t^{1/2}. y2​(t)=t1/2.

选择任何其他非零 KKK,只会把这个 solution 乘上不同常数。Wronskian 可以确认 independence:

W[y1,y2](t)=∣t−1t1/2−t−212t−1/2∣=12t−3/2+t−3/2=32t−3/2≠0,t>0.\begin{aligned} W[y_1,y_2](t) &=\begin{vmatrix} t^{-1}&t^{1/2}\\ -t^{-2}&\frac12t^{-1/2} \end{vmatrix}\\ &=\frac12t^{-3/2}+t^{-3/2}\\ &=\frac32t^{-3/2}\ne0, \qquad t>0. \end{aligned} W[y1​,y2​](t)​=​t−1−t−2​t1/221​t−1/2​​=21​t−3/2+t−3/2=23​t−3/2=0,t>0.​

所以 {1/t,t1/2}\{1/t,t^{1/2}\}{1/t,t1/2} 在 (0,∞)(0,\infty)(0,∞) 上构成 fundamental set,且

y(t)=C1t+C2t1/2,t>0.\boxed{y(t)=\frac{C_1}{t}+C_2t^{1/2},\qquad t>0}. y(t)=tC1​​+C2​t1/2,t>0​.

关于 www 的 first-order equation 的 zero solution 对应这组 solutions 中 C2=0C_2=0C2​=0 的部分,因此并没有丢失。Domain restriction 仍然不能省略,因为原方程的 coefficients 在 t=0t=0t=0 处没有定义。

Nonhomogeneous equations

右侧不为零时会发生什么变化?考虑

y′′+p(t)y′+q(t)y=g(t),y''+p(t)y'+q(t)y=g(t), y′′+p(t)y′+q(t)y=g(t),

其中 ppp、qqq、ggg 在 open interval III 上 continuous。它的 associated homogeneous equation 保留同样的左侧,只把 forcing g(t)g(t)g(t) 换成零:

y′′+p(t)y′+q(t)y=0.y''+p(t)y'+q(t)y=0. y′′+p(t)y′+q(t)y=0.

假设 {y1,y2}\{y_1,y_2\}{y1​,y2​} 是这个 homogeneous equation 在 III 上的 fundamental set of solutions。其 general solution 称为 complementary solution:

yc(t)=C1y1(t)+C2y2(t).y_c(t)=C_1y_1(t)+C_2y_2(t). yc​(t)=C1​y1​(t)+C2​y2​(t).

Particular solution 记作 ypy_pyp​,指满足 nonhomogeneous equation 的任意一个函数。它不必满足给定的 initial conditions;它的作用是在代入方程左侧后产生 forcing g(t)g(t)g(t)。

只要找到一个这样的 ypy_pyp​,nonhomogeneous equation 的 general solution 就是

y(t)=C1y1(t)+C2y2(t)+yp(t)=yc(t)+yp(t),C1,C2∈R.\boxed{y(t)=C_1y_1(t)+C_2y_2(t)+y_p(t)=y_c(t)+y_p(t)}, \qquad C_1,C_2\in\mathbb R. y(t)=C1​y1​(t)+C2​y2​(t)+yp​(t)=yc​(t)+yp​(t)​,C1​,C2​∈R.

ycy_cyc​ 中的常数仍然负责匹配 initial value 和 slope。Particular solution 不会再增加一个 arbitrary constant。

为什么可以这样相加

使用 linear differential operator

L[u]=u′′+p(t)u′+q(t)u.L[u]=u''+p(t)u'+q(t)u. L[u]=u′′+p(t)u′+q(t)u.

yyy 和 ypy_pyp​ 都满足 L[u]=gL[u]=gL[u]=g,所以它们的差满足 homogeneous equation:

L[y−yp]=L[y]−L[yp]=g−g=0.L[y-y_p]=L[y]-L[y_p]=g-g=0. L[y−yp​]=L[y]−L[yp​]=g−g=0.

因为 {y1,y2}\{y_1,y_2\}{y1​,y2​} 是 fundamental set,这个差一定能写成

y−yp=C1y1+C2y2.y-y_p=C_1y_1+C_2y_2. y−yp​=C1​y1​+C2​y2​.

移项就得到前面的公式。反过来,在 ypy_pyp​ 上加任何 complementary solution 也仍然满足方程,因为

L[yc+yp]=L[yc]+L[yp]=0+g=g.L[y_c+y_p]=L[y_c]+L[y_p]=0+g=g. L[yc​+yp​]=L[yc​]+L[yp​]=0+g=g.

这既证明了公式确实给出 solutions,也证明它包含 III 上的每一个 solution。ypy_pyp​ 可以有很多种选择,但任何两个 particular solutions 的差都是 homogeneous solution,所以它们给出的是同一个 general solution family。

求解 nonhomogeneous equation 可以分成以下步骤:

  1. 先从 associated homogeneous equation 求出 complementary solution ycy_cyc​。
  2. 找到原方程的一个 particular solution ypy_pyp​。
  3. 相加得到 y=yc+ypy=y_c+y_py=yc​+yp​。如果有 initial conditions,要代入这个完整的和,而不是只代入 ycy_cyc​。

新增的工作是第二步:寻找 ypy_pyp​。

Undetermined coefficients

对于 constant coefficients 的方程

ay′′+by′+cy=g(t),a≠0,ay''+by'+cy=g(t), \qquad a\ne0, ay′′+by′+cy=g(t),a=0,

我们常能根据 g(t)g(t)g(t) 的形式选出 ypy_pyp​ 的 trial form。Method of undetermined coefficients 在 trial form 中放入未知常数,再通过 substitution 求出这些常数。

标准方法适用于由 polynomials、exponentials、sine 和 cosine 经有限次相加、相乘构成的 g(t)g(t)g(t)。这些函数反复求 derivative 后,仍然落在有限种同类项之中。配合 constant coefficients,代入 trial form 后就能得到关于未知常数的 algebraic equations。

下面的初步 trial forms 中,λ\lambdaλ 和 μ\muμ 是 forcing 中已知的 real constants,AAA 和 BBB 才是待求 coefficients:

Forcing termTrial particular solution
eλte^{\lambda t}eλtAeλtAe^{\lambda t}Aeλt
cos⁡(μt)\cos(\mu t)cos(μt) 或 sin⁡(μt)\sin(\mu t)sin(μt),其中 μ≠0\mu\ne0μ=0Acos⁡(μt)+Bsin⁡(μt)A\cos(\mu t)+B\sin(\mu t)Acos(μt)+Bsin(μt)

Exponential 在 differentiation 后形式不变。Sine 和 cosine 则会相互转换,所以即使 forcing 只有其中一个,trial form 也要包含两个。

使用 trial form 之前,先检查 complementary solution。如果 trial form 本身已经是 homogeneous solution,代入后只会得到零,无法产生所需的非零 forcing,这时就必须调整 trial form。下面两个例子都没有这种重合。

与 C1C_1C1​、C2C_2C2​ 不同,particular-solution trial 中的 coefficients 不能任意取值,而是由方程确定。Variation of parameters 是另一种更一般的 particular-solution 方法,也能处理 variable coefficients,但它和这里的 coefficient matching 不是同一种方法。

例:exponential forcing

求解

y′′−3y′−4y=3e2t.y''-3y'-4y=3e^{2t}. y′′−3y′−4y=3e2t.

先找 complementary solution。Characteristic equation 为

r2−3r−4=(r−4)(r+1)=0,r^2-3r-4=(r-4)(r+1)=0, r2−3r−4=(r−4)(r+1)=0,

所以两个 distinct roots 是 444 和 −1-1−1。因此

yc(t)=C1e4t+C2e−t.y_c(t)=C_1e^{4t}+C_2e^{-t}. yc​(t)=C1​e4t+C2​e−t.

Forcing 是 e2te^{2t}e2t 的倍数,而这个函数并不是上述 homogeneous solutions 之一。尝试

yp(t)=Ae2t,yp′(t)=2Ae2t,yp′′(t)=4Ae2t.y_p(t)=Ae^{2t}, \qquad y_p'(t)=2Ae^{2t}, \qquad y_p''(t)=4Ae^{2t}. yp​(t)=Ae2t,yp′​(t)=2Ae2t,yp′′​(t)=4Ae2t.

代入得到

yp′′−3yp′−4yp=4Ae2t−6Ae2t−4Ae2t=−6Ae2t.\begin{aligned} y_p''-3y_p'-4y_p &=4Ae^{2t}-6Ae^{2t}-4Ae^{2t}\\ &=-6Ae^{2t}. \end{aligned} yp′′​−3yp′​−4yp​​=4Ae2t−6Ae2t−4Ae2t=−6Ae2t.​

结果必须等于 3e2t3e^{2t}3e2t。由于 exponential 永远不为零,

−6A=3,A=−12.-6A=3, \qquad A=-\frac12. −6A=3,A=−21​.

因此

yp(t)=−12e2t,y_p(t)=-\frac12e^{2t}, yp​(t)=−21​e2t,

General solution 为

y(t)=C1e4t+C2e−t−12e2t.\boxed{y(t)=C_1e^{4t}+C_2e^{-t}-\frac12e^{2t}}. y(t)=C1​e4t+C2​e−t−21​e2t​.

没有给定 initial conditions,所以 C1C_1C1​、C2C_2C2​ 保持任意。所有 coefficients 和 forcing 对 real ttt 都 continuous,因此这组 solutions 在 R\mathbb RR 上有效。

例:trigonometric forcing

现在只改变 forcing:

y′′−3y′−4y=2sin⁡t.y''-3y'-4y=2\sin t. y′′−3y′−4y=2sint.

Associated homogeneous equation 没变,所以 complementary solution 也不变:

yc(t)=C1e4t+C2e−t.y_c(t)=C_1e^{4t}+C_2e^{-t}. yc​(t)=C1​e4t+C2​e−t.

寻找 particular solution 时,同时包含 sine 和 cosine:

yp(t)=Asin⁡t+Bcos⁡t,yp′(t)=Acos⁡t−Bsin⁡t,yp′′(t)=−Asin⁡t−Bcos⁡t.\begin{aligned} y_p(t)&=A\sin t+B\cos t,\\ y_p'(t)&=A\cos t-B\sin t,\\ y_p''(t)&=-A\sin t-B\cos t. \end{aligned} yp​(t)yp′​(t)yp′′​(t)​=Asint+Bcost,=Acost−Bsint,=−Asint−Bcost.​

代入 ODE,并合并同类项:

yp′′−3yp′−4yp=(−Asin⁡t−Bcos⁡t)−3(Acos⁡t−Bsin⁡t)−4(Asin⁡t+Bcos⁡t)=(−5A+3B)sin⁡t+(−3A−5B)cos⁡t.\begin{aligned} y_p''-3y_p'-4y_p &=(-A\sin t-B\cos t)\\ &\quad-3(A\cos t-B\sin t)\\ &\quad-4(A\sin t+B\cos t)\\ &=(-5A+3B)\sin t+(-3A-5B)\cos t. \end{aligned} yp′′​−3yp′​−4yp​​=(−Asint−Bcost)−3(Acost−Bsint)−4(Asint+Bcost)=(−5A+3B)sint+(−3A−5B)cost.​

我们需要下面的等式对每个 ttt 都成立:

(−5A+3B)sin⁡t+(−3A−5B)cos⁡t=2sin⁡t.(-5A+3B)\sin t+(-3A-5B)\cos t=2\sin t. (−5A+3B)sint+(−3A−5B)cost=2sint.

Sine 和 cosine 是 linearly independent 的,所以可以比较各自的 coefficients。右侧的 sine coefficient 是 222,cosine coefficient 是 000:

{−5A+3B=2,−3A−5B=0.\begin{cases} -5A+3B=2,\\ -3A-5B=0. \end{cases} {−5A+3B=2,−3A−5B=0.​

第二个等式给出 B=−3A/5B=-3A/5B=−3A/5。把它放回第一个等式:

−5A−95A=2⟹−345A=2.-5A-\frac95A=2 \quad\Longrightarrow\quad -\frac{34}{5}A=2. −5A−59​A=2⟹−534​A=2.

所以

A=−517,B=317,A=-\frac5{17}, \qquad B=\frac3{17}, A=−175​,B=173​,

得到一个 particular solution:

yp(t)=−517sin⁡t+317cos⁡t.y_p(t)=-\frac5{17}\sin t+\frac3{17}\cos t. yp​(t)=−175​sint+173​cost.

加上 complementary solution,便得到对所有 real ttt 都有效的 general solution:

y(t)=C1e4t+C2e−t−517sin⁡t+317cos⁡t.\boxed{ y(t)=C_1e^{4t}+C_2e^{-t} -\frac5{17}\sin t+\frac3{17}\cos t }. y(t)=C1​e4t+C2​e−t−175​sint+173​cost​.

检查这些 coefficients:−5A+3B=2-5A+3B=2−5A+3B=2,−3A−5B=0-3A-5B=0−3A−5B=0,所以左侧恰好为 2sin⁡t2\sin t2sint,没有多出的 cosine 项。

Trial form 必须包含哪些项

匹配 forcing 时,要包含 differentiation 可能产生的所有类型的项,而不只是照抄右侧已经出现的项。

  • 若 g(t)=t2+7g(t)=t^2+7g(t)=t2+7,先取 yp=At2+Bt+Cy_p=At^2+Bt+Cyp​=At2+Bt+C。虽然 forcing 没有 linear term,但 quadratic term 求 derivative 会产生 linear term,因此 trial form 仍然需要 BtBtBt。
  • 若 g(t)=−8etcos⁡(2t)g(t)=-8e^t\cos(2t)g(t)=−8etcos(2t),先取 yp=et(Acos⁡(2t)+Bsin⁡(2t))y_p=e^t\bigl(A\cos(2t)+B\sin(2t)\bigr)yp​=et(Acos(2t)+Bsin(2t))。Differentiation 会使两个 trigonometric functions 混合,同时保留 exponential 因子。
  • 若 g(t)=7tetsin⁡(8t)g(t)=7te^t\sin(8t)g(t)=7tetsin(8t),先取
yp=et[(A+Ct)sin⁡(8t)+(B+Dt)cos⁡(8t)].y_p=e^t\bigl[(A+Ct)\sin(8t)+(B+Dt)\cos(8t)\bigr]. yp​=et[(A+Ct)sin(8t)+(B+Dt)cos(8t)].

最后一个 trial 中,每个 trigonometric function 前面都需要一个常数项和一个含 ttt 的项,因为 ttt 求 derivative 后会产生常数。三个例子中的大写字母都是未知常数。如果 trial form 与 complementary solution 重合,仍可能需要额外乘一个因子。

把 forcing 的和拆开处理

Linearity 允许我们分开寻找 particular solutions。对于同一个 operator L[y]=ay′′+by′+cyL[y]=ay''+by'+cyL[y]=ay′′+by′+cy,假设

L[yp,1]=g1,L[yp,2]=g2.L[y_{p,1}]=g_1, \qquad L[y_{p,2}]=g_2. L[yp,1​]=g1​,L[yp,2​]=g2​.

下标区分两个 particular solutions,每个分别对应一个 forcing term。它们的和满足

L[yp,1+yp,2]=g1+g2.L[y_{p,1}+y_{p,2}]=g_1+g_2. L[yp,1​+yp,2​]=g1​+g2​.

这里并不是说 solutions 任意相加后还能保持原来的 forcing;forcing terms 也跟着相加了。

例如,考虑

y′′−3y′−4y=3e2t+2sin⁡t.y''-3y'-4y=3e^{2t}+2\sin t. y′′−3y′−4y=3e2t+2sint.

前两个例子已经完成 coefficient matching。直接把它们的 particular solutions 相加:

yp(t)=−12e2t−517sin⁡t+317cos⁡t.y_p(t)=-\frac12e^{2t}-\frac5{17}\sin t+\frac3{17}\cos t. yp​(t)=−21​e2t−175​sint+173​cost.

Complementary solution 不变,因此 general solution 为

y(t)=C1e4t+C2e−t−12e2t−517sin⁡t+317cos⁡t.\boxed{ y(t)=C_1e^{4t}+C_2e^{-t} -\frac12e^{2t}-\frac5{17}\sin t+\frac3{17}\cos t }. y(t)=C1​e4t+C2​e−t−21​e2t−175​sint+173​cost​.

Undetermined coefficients 中的 resonance

如果 trial form 已经是 homogeneous solution,那么不论 coefficient 取什么值,differential operator 都会把它变成零。再怎么 matching coefficients,也不可能产生非零 forcing。在 undetermined coefficients 中,这种重合称为 resonance。

例:simple characteristic root

求解

y′′−y=7et.y''-y=7e^t. y′′−y=7et.

最初的 trial yp=Aety_p=Ae^typ​=Aet 不适用,因为

yp′′−yp=Aet−Aet=0≠7et.y_p''-y_p=Ae^t-Ae^t=0\ne7e^t. yp′′​−yp​=Aet−Aet=0=7et.

问题在 trial form,并不是方程没有 solution。Associated homogeneous equation 是 y′′−y=0y''-y=0y′′−y=0,其 characteristic equation 为

r2−1=(r−1)(r+1)=0.r^2-1=(r-1)(r+1)=0. r2−1=(r−1)(r+1)=0.

因此

yc(t)=C1e−t+C2et.y_c(t)=C_1e^{-t}+C_2e^t. yc​(t)=C1​e−t+C2​et.

ete^tet 已经包含在这组 solutions 中。把 trial form 乘以 ttt,就得到不同的函数:

yp(t)=Atet,yp′(t)=A(1+t)et,yp′′(t)=A(2+t)et.\begin{aligned} y_p(t)&=Ate^t,\\ y_p'(t)&=A(1+t)e^t,\\ y_p''(t)&=A(2+t)e^t. \end{aligned} yp​(t)yp′​(t)yp′′​(t)​=Atet,=A(1+t)et,=A(2+t)et.​

这次 tette^ttet 项抵消后,还会留下一个非零 exponential 项:

yp′′−yp=2Aet=7et.y_p''-y_p=2Ae^t=7e^t. yp′′​−yp​=2Aet=7et.

因此 A=7/2A=7/2A=7/2,所以

yp(t)=72tet.y_p(t)=\frac72te^t. yp​(t)=27​tet.

加上 complementary solution,得到

y(t)=C1e−t+C2et+72tet.\boxed{y(t)=C_1e^{-t}+C_2e^t+\frac72te^t}. y(t)=C1​e−t+C2​et+27​tet​.

例:repeated characteristic root

只乘一个 ttt 并不总是够用。考虑

y′′−2y′+y=7et.y''-2y'+y=7e^t. y′′−2y′+y=7et.

Characteristic equation 为

r2−2r+1=(r−1)2=0,r^2-2r+1=(r-1)^2=0, r2−2r+1=(r−1)2=0,

因此 111 是 double root,且

yc(t)=(C1+C2t)et.y_c(t)=(C_1+C_2t)e^t. yc​(t)=(C1​+C2​t)et.

AetAe^tAet 和 AtetAte^tAtet 都是 homogeneous solutions,两者代入左侧都会得到零。继续增加时间因子的次方,首个避开这两个函数的 trial 是

yp(t)=At2et.y_p(t)=At^2e^t. yp​(t)=At2et.

求 derivative 并代入:

yp′=A(t2+2t)et,yp′′=A(t2+4t+2)et,yp′′−2yp′+yp=Aet[(t2+4t+2)−2(t2+2t)+t2]=2Aet.\begin{aligned} y_p'&=A(t^2+2t)e^t,\\ y_p''&=A(t^2+4t+2)e^t,\\ y_p''-2y_p'+y_p &=Ae^t\bigl[(t^2+4t+2)-2(t^2+2t)+t^2\bigr]\\ &=2Ae^t. \end{aligned} yp′​yp′′​yp′′​−2yp′​+yp​​=A(t2+2t)et,=A(t2+4t+2)et,=Aet[(t2+4t+2)−2(t2+2t)+t2]=2Aet.​

仍然得到 2A=72A=72A=7,所以

yp(t)=72t2et,y_p(t)=\frac72t^2e^t, yp​(t)=27​t2et,

从而

y(t)=(C1+C2t+72t2)et.\boxed{y(t)=\left(C_1+C_2t+\frac72t^2\right)e^t}. y(t)=(C1​+C2​t+27​t2)et​.

这两个 resonance 例子都对所有 real ttt 有效。由于都没有给定 initial conditions,complementary solution 中的两个常数保持任意。

Trial-form 规则

需要乘多少次 ttt,由 characteristic root 的 multiplicity 决定,也就是该 root 在 characteristic polynomial 中出现的次数。不是 root 的数值,其 multiplicity 记为零。

设 Pn(t)P_n(t)Pn​(t) 是一个已知的 degree nnn polynomial。令 Qn(t)Q_n(t)Qn​(t) 和 Rn(t)R_n(t)Rn​(t) 为 polynomials,从 tnt^ntn 一直到常数项,每一项都带有各自独立的未知 coefficient。例如,

Qn(t)=Antn+An−1tn−1+⋯+A0.Q_n(t)=A_nt^n+A_{n-1}t^{n-1}+\cdots+A_0. Qn​(t)=An​tn+An−1​tn−1+⋯+A0​.

下面的 α\alphaα 和 β\betaβ 是 forcing 中已知的 real constants。Trigonometric 那一行要求 β≠0\beta\ne0β=0。指数 sss 是最后一列所列 root 的 multiplicity。对于 constant coefficients 且 a≠0a\ne0a=0 的 ay′′+by′+cy=g(t)ay''+by'+cy=g(t)ay′′+by′+cy=g(t):

Forcing 的一个组成部分Trial particular solutionMultiplicity 为 sss 的 root
Pn(t)P_n(t)Pn​(t)tsQn(t)t^sQ_n(t)tsQn​(t)000
Pn(t)eαtP_n(t)e^{\alpha t}Pn​(t)eαttseαtQn(t)t^se^{\alpha t}Q_n(t)tseαtQn​(t)α\alphaα
Pn(t)eαtcos⁡(βt)P_n(t)e^{\alpha t}\cos(\beta t)Pn​(t)eαtcos(βt) 或 Pn(t)eαtsin⁡(βt)P_n(t)e^{\alpha t}\sin(\beta t)Pn​(t)eαtsin(βt)tseαt[Qn(t)cos⁡(βt)+Rn(t)sin⁡(βt)]t^se^{\alpha t}\bigl[Q_n(t)\cos(\beta t)+R_n(t)\sin(\beta t)\bigr]tseαt[Qn​(t)cos(βt)+Rn​(t)sin(βt)]α+iβ\alpha+i\betaα+iβ

sss 是消除与 homogeneous solution space 重合所需的最小 nonnegative integer。对于 second-order equation,它只能是 000、111 或 222;real quadratic 的 nonreal root 只能是 simple root。要把整个 trial 乘以 tst^sts,不能只乘其中一项。

这也解释了前两个例子:111 是 r2−1r^2-1r2−1 的 simple root,所以用 tette^ttet;它是 (r−1)2(r-1)^2(r−1)2 的 double root,所以用 t2ett^2e^tt2et。如果 forcing 是若干部分的和,就为各部分选合适的 trial,再把求出的 particular solutions 相加。

Variation of parameters

Undetermined coefficients 利用的是一组在 differentiation 后仍不超出其范围的函数。Variation of parameters 则从两个已知 homogeneous solutions 出发,把它们前面的常数换成未知函数。只要已知 homogeneous equation 的 fundamental set,这种方法就能处理更一般的 forcing,也适用于 variable coefficients。

考虑 normalized equation

y′′+p(t)y′+q(t)y=g(t),y''+p(t)y'+q(t)y=g(t), y′′+p(t)y′+q(t)y=g(t),

其中 ppp、qqq、ggg 在 open interval III 上 continuous。设 {y1,y2}\{y_1,y_2\}{y1​,y2​} 是 associated homogeneous equation 在 III 上的 fundamental set。把其 Wronskian 记作

W(t)=y1(t)y2′(t)−y1′(t)y2(t)≠0,t∈I.W(t)=y_1(t)y_2'(t)-y_1'(t)y_2(t)\ne0, \qquad t\in I. W(t)=y1​(t)y2′​(t)−y1′​(t)y2​(t)=0,t∈I.

这里一定要先 normalize。如果原方程是 a2(t)y′′+a1(t)y′+a0(t)y=h(t)a_2(t)y''+a_1(t)y'+a_0(t)y=h(t)a2​(t)y′′+a1​(t)y′+a0​(t)y=h(t),应在 a2(t)a_2(t)a2​(t) 不为零的 interval 上除以它。这个方法中使用的 forcing 是 g=h/a2g=h/a_2g=h/a2​,不是原来的 hhh。

选择两个未知函数

保留已知函数 y1y_1y1​、y2y_2y2​,但把它们前面的常数换成未知函数 u1u_1u1​、u2u_2u2​。寻找形如下面的 particular solution:

yp(t)=u1(t)y1(t)+u2(t)y2(t).y_p(t)=u_1(t)y_1(t)+u_2(t)y_2(t). yp​(t)=u1​(t)y1​(t)+u2​(t)y2​(t).

Product rule 给出

yp′=u1′y1+u1y1′+u2′y2+u2y2′.y_p'=u_1'y_1+u_1y_1'+u_2'y_2+u_2y_2'. yp′​=u1′​y1​+u1​y1′​+u2′​y2​+u2​y2′​.

为了构造一个 solution,我们引入了两个未知函数,可以利用这份自由度加一个 auxiliary condition,让第一项和第三项抵消:

y1u1′+y2u2′=0.\boxed{y_1u_1'+y_2u_2'=0}. y1​u1′​+y2​u2′​=0​.

这是构造时主动选择的条件,不是任意 u1,u2u_1,u_2u1​,u2​ 都满足的 identity。这样就剩下

yp′=u1y1′+u2y2′,y_p'=u_1y_1'+u_2y_2', yp′​=u1​y1′​+u2​y2′​,

再求一次 derivative,得到

yp′′=u1′y1′+u1y1′′+u2′y2′+u2y2′′.y_p''=u_1'y_1'+u_1y_1''+u_2'y_2'+u_2y_2''. yp′′​=u1′​y1′​+u1​y1′′​+u2′​y2′​+u2​y2′′​.

这样做的好处是,式子中不会出现 u1u_1u1​ 或 u2u_2u2​ 的 second derivatives。把这些表达式代入 nonhomogeneous equation,按未知函数整理:

yp′′+pyp′+qyp=u1(y1′′+py1′+qy1)+u2(y2′′+py2′+qy2)+u1′y1′+u2′y2′.\begin{aligned} y_p''+py_p'+qy_p &=u_1\bigl(y_1''+py_1'+qy_1\bigr)\\ &\quad+u_2\bigl(y_2''+py_2'+qy_2\bigr)\\ &\quad+u_1'y_1'+u_2'y_2'. \end{aligned} yp′′​+pyp′​+qyp​​=u1​(y1′′​+py1′​+qy1​)+u2​(y2′′​+py2′​+qy2​)+u1′​y1′​+u2′​y2′​.​

由于 y1y_1y1​、y2y_2y2​ 都满足 homogeneous equation,两个括号都为零。要产生所需的 forcing,剩下的项必须满足

y1′u1′+y2′u2′=g(t).\boxed{y_1'u_1'+y_2'u_2'=g(t)}. y1′​u1′​+y2′​u2′​=g(t)​.

联立求解两个条件

Auxiliary condition 与 ODE 一起给出了关于 u1′u_1'u1′​、u2′u_2'u2′​ 的 linear system:

(y1y2y1′y2′)(u1′u2′)=(0g).\begin{pmatrix} y_1&y_2\\ y_1'&y_2' \end{pmatrix} \begin{pmatrix} u_1'\\ u_2' \end{pmatrix} = \begin{pmatrix} 0\\ g \end{pmatrix}. (y1​y1′​​y2​y2′​​)(u1′​u2′​​)=(0g​).

方程组里的所有函数都在同一个 ttt 处取值。Coefficient matrix 的 determinant 是 W(t)W(t)W(t),它在 III 上不为零。因此 inverse matrix 为

(y1y2y1′y2′)−1=1W(t)(y2′−y2−y1′y1).\begin{pmatrix} y_1&y_2\\ y_1'&y_2' \end{pmatrix}^{-1} = \frac1{W(t)} \begin{pmatrix} y_2'&-y_2\\ -y_1'&y_1 \end{pmatrix}. (y1​y1′​​y2​y2′​​)−1=W(t)1​(y2′​−y1′​​−y2​y1​​).

乘以元素为 000、ggg 的列,得到

u1′=−y2gW,u2′=y1gW.\boxed{ u_1'=-\frac{y_2g}{W}, \qquad u_2'=\frac{y_1g}{W} }. u1′​=−Wy2​g​,u2′​=Wy1​g​​.

第一个公式的负号来自 inverse matrix 右上角的元素。两个公式中,Wronskian 都必须保持同一个顺序 W[y1,y2]W[y_1,y_2]W[y1​,y2​]。

Integrate 后,就能选出一组函数:

u1(t)=−∫y2(t)g(t)W(t) dt,u2(t)=∫y1(t)g(t)W(t) dt.u_1(t)=-\int\frac{y_2(t)g(t)}{W(t)}\,dt, \qquad u_2(t)=\int\frac{y_1(t)g(t)}{W(t)}\,dt. u1​(t)=−∫W(t)y2​(t)g(t)​dt,u2​(t)=∫W(t)y1​(t)g(t)​dt.

Integration constants 可以省略:在 u1,u2u_1,u_2u1​,u2​ 中加入常数 k1,k2k_1,k_2k1​,k2​,只会让 ypy_pyp​ 多出 k1y1+k2y2k_1y_1+k_2y_2k1​y1​+k2​y2​,这些项已经包含在 complementary solution 中。在 III 上任取相应的 antiderivatives,就能得到一个 particular solution。

General solution

把 u1u_1u1​、u2u_2u2​ 放回 yp=u1y1+u2y2y_p=u_1y_1+u_2y_2yp​=u1​y1​+u2​y2​:

yp(t)=−y1(t)∫y2(t)g(t)W(t) dt+y2(t)∫y1(t)g(t)W(t) dt.\boxed{ \begin{aligned} y_p(t) &=-y_1(t)\int\frac{y_2(t)g(t)}{W(t)}\,dt\\ &\quad+y_2(t)\int\frac{y_1(t)g(t)}{W(t)}\,dt. \end{aligned} } yp​(t)​=−y1​(t)∫W(t)y2​(t)g(t)​dt+y2​(t)∫W(t)y1​(t)g(t)​dt.​​

前面的两个条件保证这个函数满足 nonhomogeneous equation。III 上的 general solution 是

y(t)=C1y1(t)+C2y2(t)−y1(t)∫y2(t)g(t)W(t) dt+y2(t)∫y1(t)g(t)W(t) dt,\boxed{ \begin{aligned} y(t) &=C_1y_1(t)+C_2y_2(t)\\ &\quad-y_1(t)\int\frac{y_2(t)g(t)}{W(t)}\,dt\\ &\quad+y_2(t)\int\frac{y_1(t)g(t)}{W(t)}\,dt, \end{aligned} } y(t)​=C1​y1​(t)+C2​y2​(t)−y1​(t)∫W(t)y2​(t)g(t)​dt+y2​(t)∫W(t)y1​(t)g(t)​dt,​​

其中 C1,C2∈RC_1,C_2\in\mathbb RC1​,C2​∈R。如果有 initial conditions,应代入完整 solution。Variation of parameters 不需要猜 trial family 就能给出这些 integrals,但它们未必有 elementary antiderivatives。

也可以固定一个 t0∈It_0\in It0​∈I,把它作为两个 integrals 的共同下限,再合并为

yp(t)=∫t0ty1(s)y2(t)−y1(t)y2(s)W(s)g(s) ds.y_p(t)=\int_{t_0}^t \frac{y_1(s)y_2(t)-y_1(t)y_2(s)}{W(s)}g(s)\,ds. yp​(t)=∫t0​t​W(s)y1​(s)y2​(t)−y1​(t)y2​(s)​g(s)ds.

这里 sss 只是 integration variable,ttt 才是要计算 solution 的时刻。这种写法满足 yp(t0)=yp′(t0)=0y_p(t_0)=y_p'(t_0)=0yp​(t0​)=yp′​(t0​)=0。即使 integral 无法进一步化简,它仍然是有效的 particular solution。

例:重新求解 resonant exponential forcing

再看 y′′−y=7ety''-y=7e^ty′′−y=7et,这次使用 variation of parameters,而不是修改 trial form。按下面的顺序选取两个 solutions:

y1=et,y2=e−t,W=−2.y_1=e^t,\qquad y_2=e^{-t},\qquad W=-2. y1​=et,y2​=e−t,W=−2.

由 g(t)=7etg(t)=7e^tg(t)=7et,得到

u1=−∫e−t(7et)−2 dt=72t,u2=∫et(7et)−2 dt=−74e2t.\begin{aligned} u_1&=-\int\frac{e^{-t}(7e^t)}{-2}\,dt=\frac72t,\\ u_2&=\int\frac{e^t(7e^t)}{-2}\,dt=-\frac74e^{2t}. \end{aligned} u1​u2​​=−∫−2e−t(7et)​dt=27​t,=∫−2et(7et)​dt=−47​e2t.​

分别乘以对应的 homogeneous solutions:

yp=u1y1+u2y2=72tet−74et.y_p=u_1y_1+u_2y_2=\frac72te^t-\frac74e^t. yp​=u1​y1​+u2​y2​=27​tet−47​et.

最后一项本身就是 homogeneous solution。把它并入 ete^tet 前面的 arbitrary coefficient,得到

y(t)=C1et+C2e−t+72tet,t∈R.\boxed{y(t)=C_1e^t+C_2e^{-t}+\frac72te^t},\qquad t\in\mathbb R. y(t)=C1​et+C2​e−t+27​tet​,t∈R.

这与 undetermined coefficients 得到的是同一个 solution family。Variation of parameters 通过 integration 自动产生所需的 ttt 因子,不用事先猜出它。

例:tangent forcing

再考虑一个不属于通常 undetermined-coefficients 范围的 input:

y′′+y=tan⁡t,−π2<t<π2.y''+y=\tan t,\qquad -\frac\pi2<t<\frac\pi2. y′′+y=tant,−2π​<t<2π​.

两端不包含在 interval 中,因为 tan⁡t\tan ttant 在那里没有定义。在这个 open interval 上,coefficients 和 forcing 都 continuous。Homogeneous equation 的 roots 是 ±i\pm i±i,因此选取

y1=sin⁡t,y2=cos⁡t,W=sin⁡t(−sin⁡t)−cos⁡2t=−1.y_1=\sin t,\qquad y_2=\cos t,\qquad W=\sin t(-\sin t)-\cos^2t=-1. y1​=sint,y2​=cost,W=sint(−sint)−cos2t=−1.

使用公式时保持这个顺序。第一个 integral 可以直接化简:

u1=−∫cos⁡ttan⁡t−1 dt=∫sin⁡t dt=−cos⁡t.u_1=-\int\frac{\cos t\tan t}{-1}\,dt =\int\sin t\,dt=-\cos t. u1​=−∫−1costtant​dt=∫sintdt=−cost.

第二个 integral 中,先用 sin⁡2t=1−cos⁡2t\sin^2t=1-\cos^2tsin2t=1−cos2t 改写:

u2=∫sin⁡ttan⁡t−1 dt=−∫sin⁡2tcos⁡t dt=∫(cos⁡t−sec⁡t) dt=sin⁡t−ln⁡∣sec⁡t+tan⁡t∣.\begin{aligned} u_2&=\int\frac{\sin t\tan t}{-1}\,dt =-\int\frac{\sin^2t}{\cos t}\,dt\\ &=\int(\cos t-\sec t)\,dt\\ &=\sin t-\ln|\sec t+\tan t|. \end{aligned} u2​​=∫−1sinttant​dt=−∫costsin2t​dt=∫(cost−sect)dt=sint−ln∣sect+tant∣.​

要检查 logarithm,只需求 derivative:(sec⁡t+tan⁡t)′=sec⁡t(sec⁡t+tan⁡t)(\sec t+\tan t)'=\sec t(\sec t+\tan t)(sect+tant)′=sect(sect+tant),所以它的 logarithmic derivative 是 sec⁡t\sec tsect。

构造 particular solution 时,混合的 sine–cosine 项抵消:

yp=(−cos⁡t)sin⁡t+(sin⁡t−ln⁡∣sec⁡t+tan⁡t∣)cos⁡t=−cos⁡tln⁡∣sec⁡t+tan⁡t∣.\begin{aligned} y_p&=(-\cos t)\sin t +\bigl(\sin t-\ln|\sec t+\tan t|\bigr)\cos t\\ &=-\cos t\ln|\sec t+\tan t|. \end{aligned} yp​​=(−cost)sint+(sint−ln∣sect+tant∣)cost=−costln∣sect+tant∣.​

因此,指定 interval 上的 general solution 是

y(t)=C1sin⁡t+C2cos⁡t−cos⁡tln⁡∣sec⁡t+tan⁡t∣.\boxed{y(t)=C_1\sin t+C_2\cos t-\cos t\ln|\sec t+\tan t|}. y(t)=C1​sint+C2​cost−costln∣sect+tant∣​.

还可以直接检查。令 H(t)=ln⁡∣sec⁡t+tan⁡t∣H(t)=\ln|\sec t+\tan t|H(t)=ln∣sect+tant∣,由于 H′=sec⁡tH'=\sec tH′=sect,

yp′=sin⁡t H−1,yp′′=cos⁡t H+tan⁡t,y_p'=\sin t\,H-1,\qquad y_p''=\cos t\,H+\tan t, yp′​=sintH−1,yp′′​=costH+tant,

所以 yp′′+yp=tan⁡ty_p''+y_p=\tan typ′′​+yp​=tant,确实满足原方程。

如何选择 particular-solution 方法

如果 coefficients 是常数,forcing 由 polynomials、exponentials、sine、cosine 构成,可以用 undetermined coefficients。先检查与 homogeneous solutions 是否重合,再按需要把整个 trial 乘以相应次方的 ttt。

如果 forcing 更一般,或者 coefficients 随变量变化,而我们已知一对 fundamental homogeneous solutions,就可以用 variation of parameters。它不会替我们找出这对 solutions,最后的 integrals 也可能需要保留原样。

接下来把这些方法用于 mechanical vibrations 与 RLC circuits:这两个系统都能用同一种 second-order equation 描述。

来源: https://notes.ohevan.com/zh/notes/ode/03-second-order-linear-equations

© 2026 Evan Luo. 保留所有权利。

返回 Ordinary Differential Equations

0 次阅读

·最后编辑 今天
  • 邮件订阅

  • 关于我

  • 赞助

© 2026 Evan Luo. 保留所有权利。