常数变易法求解一阶非齐次线性微分方程
对于一阶非齐次线性微分方程
\[y' + p(x)y = q(x)
\]
先用分离变量法求解对应的齐次方程
\[\begin{aligned}
& y' + p(x)y = 0 \\
\Rightarrow & y = C e^{- \int p(x)dx}
\end{aligned}
\]
将 \(C\) 改为 \(C(x)\),令 \(y = C(x) e^{- \int p(x)dx}\),代入原非齐次方程得
\[\begin{aligned}
& \left[ C'(x) e^{- \int p(x)dx} - p(x) e^{- \int p(x)dx} \right] + p(x) e^{- \int p(x)dx} = q(x) \\
\Rightarrow & C'(x) e^{- \int p(x)dx} = q(x) \\
\Rightarrow & C(x) = \int q(x) e^{\int p(x)dx} dx + C
\end{aligned}
\]
所以一阶非齐次线性微分方程的通解为
\[y = e^{- \int p(x)dx} \left( \int q(x) e^{\int p(x)dx} dx + C \right)
\]
常数变易法求解二阶非齐次线性微分方程
对于二阶非齐次线性微分方程
\[y''+p(x)y'+q(x)y=f(x)
\]
设对应齐次方程的两个线性无关解为 \(y_1,y_2\),则其通解为
\[y = C_1 y_1 + C_2 y_2(C_1,C_2为任意常数)
\]
因此可设非齐次方程的特解为
\[y^* = C_1(x) y_1 + C_2(x) y_2
\]
为确定函数 \(C_1(x),C_2(x)\),可对上式进行求导得
\[\begin{aligned}
(y^*)' &= [C_1'(x) y_1 + C_1(x) y_1'] + [C_2'(x) y_2 + C_2(x) y_2'] \\
&= [C_1'(x) y_1 + C_2'(x) y_2] + [C_1(x) y_1' + C_2(x) y_2']
\end{aligned}
\]
接下来对上式再进行一次求导,不过在此之前,为了使得 \(y''\) 中不含 \(C_1''(x),C_2''(x)\),可令 \(C_1'(x) y_1 + C_2'(x) y_2 = 0\),现在对上式求导得
\[\begin{aligned}
(y^*)'' &= [C_1(x) y_1' + C_2(x) y_2']' \\
&= [C_1'(x) y_1' + C_1(x) y_1''] + [C_2'(x) y_2' + C_2(x) y_2'']
\end{aligned}
\]
将 \(y,y',y''\) 代入原非齐次方程得
\[\begin{aligned}
& [C_1'(x) y_1' + C_1(x) y_1''] + [C_2'(x) y_2' + C_2(x) y_2''] + p(x)[C_1(x) y_1' + C_2(x) y_2'] + q(x) [C_1(x) y_1 + C_2(x) y_2] = f(x) \\
\Rightarrow & C_1(x) [y_1''+p(x)y_1'+q(x)y_1] + C_2(x) [y_2''+p(x)y_2'+q(x)y_2] + [C_1'(x) y_1' + C_2'(x) y_2'] = f(x) \\
\Rightarrow & C_1'(x) y_1' + C_2'(x) y_2' = f(x)
\end{aligned}
\]
联立两个方程
\[\begin{cases}
C_1'(x) y_1 + C_2'(x) y_2 = 0 \\
C_1'(x) y_1' + C_2'(x) y_2' = f(x) \\
\end{cases}
\]
即可求得 \(C_1'(x),C_2'(x)\),最后进行积分得到 \(C_1(x),C_2(x)\)。
【注】常数变易法在同济七版高等数学中有介绍,适用于求解任意二阶非齐次常系数线性微分方程(提醒:在考研范围内,非齐次项的形式是固定的,而非任意形式)。
例题
【例 1】求解微分方程 \(y'' + 3y' + 2y = x^2\)
【解】先求对应齐次通解:\(y = C_1 e^{-x} + C_2 e^{-2x}\),所以 \(y_1 = e^{-x}, y_2 = e^{-2x}\),解方程组
\[\begin{cases}
C_1'(x) e^{-x} + C_2'(x) e^{-2x} = 0 \\
-C_1'(x) e^{-x} - 2C_2'(x) e^{-2x} = x^2 \\
\end{cases}
\]
可求得
\[\begin{cases}
C_1'(x) = \begin{vmatrix} 0 & e^{-2x} \\ x^2 & -2e^{-2x} \end{vmatrix} / \begin{vmatrix} e^{-x} & e^{-2x} \\ -e^{-x} & -2e^{-2x} \end{vmatrix} = \frac{-x^2e^{-2x}}{-e^{-3x}} = x^2 e^x\\
C_2'(x) = \begin{vmatrix} e^{-x} & 0 \\ -e^{-x} & x^2 \end{vmatrix} / \begin{vmatrix} e^{-x} & e^{-2x} \\ -e^{-x} & -2e^{-2x} \end{vmatrix} = \frac{x^2e^{-x}}{-e^{-3x}} = -x^2 e^{2x}
\end{cases}
\]
于是
\[\begin{cases}
C_1(x) = (x^2-2x+2) e^x\\
C_2(x) = -\frac{1}{4}(2x^2 - 2x + 1) e^{2x}
\end{cases}
\]
所以特解为
\[\begin{aligned}
y^* &= C_1(x) y_1 + C_2(x) y_2 \\
&= (x^2-2x+2) - \frac{1}{4}(2x^2 - 2x + 1) \\
&= \frac{1}{2}x^2 - \frac{3}{2}x + \frac{7}{4}
\end{aligned}
\]
【例 2】求解微分方程 \(y'' + 3y' + 2y = \sin x\)
【解】先求对应齐次通解:\(y = C_1 e^{-x} + C_2 e^{-2x}\),所以 \(y_1 = e^{-x}, y_2 = e^{-2x}\),解方程组
\[\begin{cases}
C_1'(x) e^{-x} + C_2'(x) e^{-2x} = 0 \\
-C_1'(x) e^{-x} - 2C_2'(x) e^{-2x} = \sin x \\
\end{cases}
\]
可求得
\[\begin{cases}
C_1'(x) = \begin{vmatrix} 0 & e^{-2x} \\ \sin x & -2e^{-2x} \end{vmatrix} / \begin{vmatrix} e^{-x} & e^{-2x} \\ -e^{-x} & -2e^{-2x} \end{vmatrix} = \frac{e^{-2x}\sin x}{-e^{-3x}} = e^x \sin x\\
C_2'(x) = \begin{vmatrix} e^{-x} & 0 \\ -e^{-x} & \sin x \end{vmatrix} / \begin{vmatrix} e^{-x} & e^{-2x} \\ -e^{-x} & -2e^{-2x} \end{vmatrix} = \frac{e^{-x}\sin x}{-e^{-3x}} = -e^{2x} \sin x
\end{cases}
\]
于是
\[\begin{cases}
C_1(x) = \frac{1}{2} (\sin x - \cos x) e^x\\
C_2(x) = -\frac{4}{5}(\frac{1}{2} \sin x - \frac{1}{4} \cos x) e^{2x}
\end{cases}
\]
所以特解为
\[\begin{aligned}
y^* &= C_1(x) y_1 + C_2(x) y_2 \\
&= \frac{1}{2} (\sin x - \cos x) -\frac{4}{5}(\frac{1}{2} \sin x - \frac{1}{4} \cos x) \\
&= \frac{1}{10} \sin x - \frac{3}{10} \cos x
\end{aligned}
\]
【例 3】求解微分方程 \(y'' + 4y = \cos 2x\)
【解】先求对应齐次通解:\(y = C_1 \cos 2x + C_2 \sin 2x\),所以 \(y_1 = \cos 2x, y_2 = \sin 2x\),解方程组
\[\begin{cases}
C_1'(x) \cos 2x + C_2'(x) \sin 2x = 0 \\
-2C_1'(x) \sin 2x + 2C_2'(x) \cos 2x = \cos 2x \\
\end{cases}
\]
可求得
\[\begin{cases}
C_1'(x) = \begin{vmatrix} 0 & \sin 2x \\ \cos 2x & 2\cos 2x \end{vmatrix} / \begin{vmatrix} \cos 2x & \sin 2x \\ -2\sin 2x & 2\cos 2x \end{vmatrix} = -\frac{\sin 2x \cos 2x}{2\cos^2 2x + 2\sin^2 2x} = -\frac{1}{4} \sin 4x \\
C_2'(x) = \begin{vmatrix} \cos 2x & 0 \\ -2\sin 2x & \cos 2x \end{vmatrix} / \begin{vmatrix} \cos 2x & \sin 2x \\ -2\sin 2x & 2\cos 2x \end{vmatrix} = \frac{\cos^2 2x}{2\cos^2 2x + 2\sin^2 2x} = \frac{1}{4} (\cos 4x + 1)
\end{cases}
\]
于是
\[\begin{cases}
C_1(x) = \frac{1}{16} \cos 4x \\
C_2(x) = \frac{1}{4} x + \frac{1}{16}\sin 4x
\end{cases}
\]
所以特解为
\[\begin{aligned}
y^* &= C_1(x) y_1 + C_2(x) y_2 \\
&= \frac{1}{16} \cos 4x \cos 2x + (\frac{1}{4} x + \frac{1}{16}\sin 4x) \sin 2x \\
&= \frac{1}{16} (\cos 4x \cos 2x + \sin 4x \sin 2x) + \frac{1}{4} x \sin 2x \\
&= \frac{1}{16} \cos 2x + \frac{1}{4} x \sin 2x
\end{aligned}
\]
由于方程的通解为
\[\begin{aligned}
y &= (C_1 + \frac{1}{16}) \cos 2x + C_2 \sin 2x + \frac{1}{4} x \sin 2x \\
&= C_3 \cos 2x + C_2 \sin 2x + \frac{1}{4} x \sin 2x
\end{aligned}
\]
所以特解应为
\[y^* = \frac{1}{4} x \sin 2x
\]
【例 4】求解微分方程 \(y'' - 2y' + y = xe^x\)
【解】先求对应齐次通解:\(y = C_1 e^{x} + C_2 xe^{x}\),所以 \(y_1 = e^{x}, y_2 = xe^{x}\),解方程组
\[\begin{cases}
C_1'(x) e^{x} + C_2'(x) xe^{x} = 0 \\
C_1'(x) e^{x} + C_2'(x) (x+1)e^{x} = xe^x \\
\end{cases}
\]
可求得
\[\begin{cases}
C_1'(x) = \begin{vmatrix} 0 & xe^{x} \\ xe^{x} & (x+1)e^{x} \end{vmatrix} / \begin{vmatrix} e^{x} & xe^{x} \\ e^{x} & (x+1)e^{x} \end{vmatrix} = \frac{-x^2e^{2x}}{e^{2x}} = -x^2 \\
C_2'(x) = \begin{vmatrix} e^{x} & 0 \\ e^{x} & xe^{x} \end{vmatrix} / \begin{vmatrix} e^{x} & xe^{x} \\ e^{x} & (x+1)e^{x} \end{vmatrix} = \frac{xe^{2x}}{e^{2x}} = x
\end{cases}
\]
于是
\[\begin{cases}
C_1(x) = -\frac{1}{3} x^3 \\
C_2(x) = \frac{1}{2} x^2
\end{cases}
\]
所以特解为
\[\begin{aligned}
y^* &= C_1(x) y_1 + C_2(x) y_2 \\
&= -\frac{1}{3} x^3 \cdot e^{x} + \frac{1}{2} x^2 \cdot xe^{x} \\
&= \frac{1}{6} x^3 e^{x}
\end{aligned}
\]