文章目录
- 常数变易法求解一阶非齐次线性微分方程
- 常数变易法求解二阶非齐次线性微分方程
- 例题
常数变易法求解一阶非齐次线性微分方程
对于一阶非齐次线性微分方程
y ′ + p ( x ) y = q ( x ) y' + p(x)y = q(x) y′+p(x)y=q(x)
先用分离变量法求解对应的齐次方程
y ′ + p ( x ) y = 0 ⇒ y = C e − ∫ p ( x ) d x \begin{aligned} & y' + p(x)y = 0 \\ \Rightarrow & y = C e^{- \int p(x)dx} \end{aligned} ⇒y′+p(x)y=0y=Ce−∫p(x)dx
将 C C C 改为 C ( x ) C(x) C(x),令 y = C ( x ) e − ∫ p ( x ) d x y = C(x) e^{- \int p(x)dx} y=C(x)e−∫p(x)dx,代入原非齐次方程得
[ C ′ ( x ) e − ∫ p ( x ) d x − p ( x ) e − ∫ p ( x ) d x ] + p ( x ) e − ∫ p ( x ) d x = q ( x ) ⇒ C ′ ( x ) e − ∫ p ( x ) d x = q ( x ) ⇒ C ( x ) = ∫ q ( x ) e ∫ p ( x ) d x d x + C \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} ⇒⇒[C′(x)e−∫p(x)dx−p(x)e−∫p(x)dx]+p(x)e−∫p(x)dx=q(x)C′(x)e−∫p(x)dx=q(x)C(x)=∫q(x)e∫p(x)dxdx+C
所以一阶非齐次线性微分方程的通解为
y = e − ∫ p ( x ) d x ( ∫ q ( x ) e ∫ p ( x ) d x d x + C ) y = e^{- \int p(x)dx} \left( \int q(x) e^{\int p(x)dx} dx + C \right) y=e−∫p(x)dx(∫q(x)e∫p(x)dxdx+C)
常数变易法求解二阶非齐次线性微分方程
对于二阶非齐次线性微分方程
y ′ ′ + p ( x ) y ′ + q ( x ) y = f ( x ) y''+p(x)y'+q(x)y=f(x) y′′+p(x)y′+q(x)y=f(x)
设对应齐次方程的两个线性无关解为 y 1 , y 2 y_1,y_2 y1,y2,则其通解为
y = C 1 y 1 + C 2 y 2 ( C 1 , C 2 为任意常数) y = C_1 y_1 + C_2 y_2(C_1,C_2为任意常数) y=C1y1+C2y2(C1,C2为任意常数)
因此可设非齐次方程的特解为
y ∗ = C 1 ( x ) y 1 + C 2 ( x ) y 2 y^* = C_1(x) y_1 + C_2(x) y_2 y∗=C1(x)y1+C2(x)y2
为确定函数 C 1 ( x ) , C 2 ( x ) C_1(x),C_2(x) C1(x),C2(x),可对上式进行求导得
( 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 ′ ] \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∗)′=[C1′(x)y1+C1(x)y1′]+[C2′(x)y2+C2(x)y2′]=[C1′(x)y1+C2′(x)y2]+[C1(x)y1′+C2(x)y2′]
接下来对上式再进行一次求导,不过在此之前,为了使得 y ′ ′ y'' y′′ 中不含 C 1 ′ ′ ( x ) , C 2 ′ ′ ( x ) C_1''(x),C_2''(x) C1′′(x),C2′′(x),可令 C 1 ′ ( x ) y 1 + C 2 ′ ( x ) y 2 = 0 C_1'(x) y_1 + C_2'(x) y_2 = 0 C1′(x)y1+C2′(x)y2=0,现在对上式求导得
( 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 ′ ′ ] \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∗)′′=[C1(x)y1′+C2(x)y2′]′=[C1′(x)y1′+C1(x)y1′′]+[C2′(x)y2′+C2(x)y2′′]
将 y , y ′ , y ′ ′ y,y',y'' y,y′,y′′ 代入原非齐次方程得
[ 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 ) ⇒ 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 ) ⇒ C 1 ′ ( x ) y 1 ′ + C 2 ′ ( x ) y 2 ′ = f ( x ) \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} ⇒⇒[C1′(x)y1′+C1(x)y1′′]+[C2′(x)y2′+C2(x)y2′′]+p(x)[C1(x)y1′+C2(x)y2′]+q(x)[C1(x)y1+C2(x)y2]=f(x)C1(x)[y1′′+p(x)y1′+q(x)y1]+C2(x)[y2′′+p(x)y2′+q(x)y2]+[C1′(x)y1′+C2′(x)y2′]=f(x)C1′(x)y1′+C2′(x)y2′=f(x)
联立两个方程
{ C 1 ′ ( x ) y 1 + C 2 ′ ( x ) y 2 = 0 C 1 ′ ( x ) y 1 ′ + C 2 ′ ( x ) y 2 ′ = f ( x ) \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} {C1′(x)y1+C2′(x)y2=0C1′(x)y1′+C2′(x)y2′=f(x)
即可求得 C 1 ′ ( x ) , C 2 ′ ( x ) C_1'(x),C_2'(x) C1′(x),C2′(x),最后进行积分得到 C 1 ( x ) , C 2 ( x ) C_1(x),C_2(x) C1(x),C2(x)。
【注】常数变易法在同济七版高等数学中有介绍,适用于求解任意二阶非齐次常系数线性微分方程(提醒:在考研范围内,非齐次项的形式是固定的,而非任意形式)。
例题
【例 1】求解微分方程 y ′ ′ + 3 y ′ + 2 y = x 2 y'' + 3y' + 2y = x^2 y′′+3y′+2y=x2
【解】先求对应齐次通解: y = C 1 e − x + C 2 e − 2 x y = C_1 e^{-x} + C_2 e^{-2x} y=C1e−x+C2e−2x,所以 y 1 = e − x , y 2 = e − 2 x y_1 = e^{-x}, y_2 = e^{-2x} y1=e−x,y2=e−2x,解方程组
{ C 1 ′ ( x ) e − x + C 2 ′ ( x ) e − 2 x = 0 − C 1 ′ ( x ) e − x − 2 C 2 ′ ( x ) e − 2 x = x 2 \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} {C1′(x)e−x+C2′(x)e−2x=0−C1′(x)e−x−2C2′(x)e−2x=x2
可求得
{ C 1 ′ ( x ) = ∣ 0 e − 2 x x 2 − 2 e − 2 x ∣ / ∣ e − x e − 2 x − e − x − 2 e − 2 x ∣ = − x 2 e − 2 x − e − 3 x = x 2 e x C 2 ′ ( x ) = ∣ e − x 0 − e − x x 2 ∣ / ∣ e − x e − 2 x − e − x − 2 e − 2 x ∣ = x 2 e − x − e − 3 x = − x 2 e 2 x \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} ⎩ ⎨ ⎧C1′(x)= 0x2e−2x−2e−2x / e−x−e−xe−2x−2e−2x =−e−3x−x2e−2x=x2exC2′(x)= e−x−e−x0x2 / e−x−e−xe−2x−2e−2x =−e−3xx2e−x=−x2e2x
于是
{ C 1 ( x ) = ( x 2 − 2 x + 2 ) e x C 2 ( x ) = − 1 4 ( 2 x 2 − 2 x + 1 ) e 2 x \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} {C1(x)=(x2−2x+2)exC2(x)=−41(2x2−2x+1)e2x
所以特解为
y ∗ = C 1 ( x ) y 1 + C 2 ( x ) y 2 = ( x 2 − 2 x + 2 ) − 1 4 ( 2 x 2 − 2 x + 1 ) = 1 2 x 2 − 3 2 x + 7 4 \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} y∗=C1(x)y1+C2(x)y2=(x2−2x+2)−41(2x2−2x+1)=21x2−23x+47
【例 2】求解微分方程 y ′ ′ + 3 y ′ + 2 y = sin x y'' + 3y' + 2y = \sin x y′′+3y′+2y=sinx
【解】先求对应齐次通解: y = C 1 e − x + C 2 e − 2 x y = C_1 e^{-x} + C_2 e^{-2x} y=C1e−x+C2e−2x,所以 y 1 = e − x , y 2 = e − 2 x y_1 = e^{-x}, y_2 = e^{-2x} y1=e−x,y2=e−2x,解方程组
{ C 1 ′ ( x ) e − x + C 2 ′ ( x ) e − 2 x = 0 − C 1 ′ ( x ) e − x − 2 C 2 ′ ( x ) e − 2 x = sin x \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} {C1′(x)e−x+C2′(x)e−2x=0−C1′(x)e−x−2C2′(x)e−2x=sinx
可求得
{ C 1 ′ ( x ) = ∣ 0 e − 2 x sin x − 2 e − 2 x ∣ / ∣ e − x e − 2 x − e − x − 2 e − 2 x ∣ = e − 2 x sin x − e − 3 x = e x sin x C 2 ′ ( x ) = ∣ e − x 0 − e − x sin x ∣ / ∣ e − x e − 2 x − e − x − 2 e − 2 x ∣ = e − x sin x − e − 3 x = − e 2 x sin x \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} ⎩ ⎨ ⎧C1′(x)= 0sinxe−2x−2e−2x / e−x−e−xe−2x−2e−2x =−e−3xe−2xsinx=exsinxC2′(x)= e−x−e−x0sinx / e−x−e−xe−2x−2e−2x =−e−3xe−xsinx=−e2xsinx
于是
{ C 1 ( x ) = 1 2 ( sin x − cos x ) e x C 2 ( x ) = − 4 5 ( 1 2 sin x − 1 4 cos x ) e 2 x \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} {C1(x)=21(sinx−cosx)exC2(x)=−54(21sinx−41cosx)e2x
所以特解为
y ∗ = C 1 ( x ) y 1 + C 2 ( x ) y 2 = 1 2 ( sin x − cos x ) − 4 5 ( 1 2 sin x − 1 4 cos x ) = 1 10 sin x − 3 10 cos x \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} y∗=C1(x)y1+C2(x)y2=21(sinx−cosx)−54(21sinx−41cosx)=101sinx−103cosx
【例 3】求解微分方程 y ′ ′ + 4 y = cos 2 x y'' + 4y = \cos 2x y′′+4y=cos2x
【解】先求对应齐次通解: y = C 1 cos 2 x + C 2 sin 2 x y = C_1 \cos 2x + C_2 \sin 2x y=C1cos2x+C2sin2x,所以 y 1 = cos 2 x , y 2 = sin 2 x y_1 = \cos 2x, y_2 = \sin 2x y1=cos2x,y2=sin2x,解方程组
{ C 1 ′ ( x ) cos 2 x + C 2 ′ ( x ) sin 2 x = 0 − 2 C 1 ′ ( x ) sin 2 x + 2 C 2 ′ ( x ) cos 2 x = cos 2 x \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} {C1′(x)cos2x+C2′(x)sin2x=0−2C1′(x)sin2x+2C2′(x)cos2x=cos2x
可求得
{ C 1 ′ ( x ) = ∣ 0 sin 2 x cos 2 x 2 cos 2 x ∣ / ∣ cos 2 x sin 2 x − 2 sin 2 x 2 cos 2 x ∣ = − sin 2 x cos 2 x 2 cos 2 2 x + 2 sin 2 2 x = − 1 4 sin 4 x C 2 ′ ( x ) = ∣ cos 2 x 0 − 2 sin 2 x cos 2 x ∣ / ∣ cos 2 x sin 2 x − 2 sin 2 x 2 cos 2 x ∣ = cos 2 2 x 2 cos 2 2 x + 2 sin 2 2 x = 1 4 ( cos 4 x + 1 ) \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} ⎩ ⎨ ⎧C1′(x)= 0cos2xsin2x2cos2x / cos2x−2sin2xsin2x2cos2x =−2cos22x+2sin22xsin2xcos2x=−41sin4xC2′(x)= cos2x−2sin2x0cos2x / cos2x−2sin2xsin2x2cos2x =2cos22x+2sin22xcos22x=41(cos4x+1)
于是
{ C 1 ( x ) = 1 16 cos 4 x C 2 ( x ) = 1 4 x + 1 16 sin 4 x \begin{cases} C_1(x) = \frac{1}{16} \cos 4x \\ C_2(x) = \frac{1}{4} x + \frac{1}{16}\sin 4x \end{cases} {C1(x)=161cos4xC2(x)=41x+161sin4x
所以特解为
y ∗ = C 1 ( x ) y 1 + C 2 ( x ) y 2 = 1 16 cos 4 x cos 2 x + ( 1 4 x + 1 16 sin 4 x ) sin 2 x = 1 16 ( cos 4 x cos 2 x + sin 4 x sin 2 x ) + 1 4 x sin 2 x = 1 16 cos 2 x + 1 4 x sin 2 x \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} y∗=C1(x)y1+C2(x)y2=161cos4xcos2x+(41x+161sin4x)sin2x=161(cos4xcos2x+sin4xsin2x)+41xsin2x=161cos2x+41xsin2x
由于方程的通解为
y = ( C 1 + 1 16 ) cos 2 x + C 2 sin 2 x + 1 4 x sin 2 x = C 3 cos 2 x + C 2 sin 2 x + 1 4 x sin 2 x \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=(C1+161)cos2x+C2sin2x+41xsin2x=C3cos2x+C2sin2x+41xsin2x
所以特解应为
y ∗ = 1 4 x sin 2 x y^* = \frac{1}{4} x \sin 2x y∗=41xsin2x
【例 4】求解微分方程 y ′ ′ − 2 y ′ + y = x e x y'' - 2y' + y = xe^x y′′−2y′+y=xex
【解】先求对应齐次通解: y = C 1 e x + C 2 x e x y = C_1 e^{x} + C_2 xe^{x} y=C1ex+C2xex,所以 y 1 = e x , y 2 = x e x y_1 = e^{x}, y_2 = xe^{x} y1=ex,y2=xex,解方程组
{ C 1 ′ ( x ) e x + C 2 ′ ( x ) x e x = 0 C 1 ′ ( x ) e x + C 2 ′ ( x ) ( x + 1 ) e x = x e 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} {C1′(x)ex+C2′(x)xex=0C1′(x)ex+C2′(x)(x+1)ex=xex
可求得
{ C 1 ′ ( x ) = ∣ 0 x e x x e x ( x + 1 ) e x ∣ / ∣ e x x e x e x ( x + 1 ) e x ∣ = − x 2 e 2 x e 2 x = − x 2 C 2 ′ ( x ) = ∣ e x 0 e x x e x ∣ / ∣ e x x e x e x ( x + 1 ) e x ∣ = x e 2 x e 2 x = x \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} ⎩ ⎨ ⎧C1′(x)= 0xexxex(x+1)ex / exexxex(x+1)ex =e2x−x2e2x=−x2C2′(x)= exex0xex / exexxex(x+1)ex =e2xxe2x=x
于是
{ C 1 ( x ) = − 1 3 x 3 C 2 ( x ) = 1 2 x 2 \begin{cases} C_1(x) = -\frac{1}{3} x^3 \\ C_2(x) = \frac{1}{2} x^2 \end{cases} {C1(x)=−31x3C2(x)=21x2
所以特解为
y ∗ = C 1 ( x ) y 1 + C 2 ( x ) y 2 = − 1 3 x 3 ⋅ e x + 1 2 x 2 ⋅ x e x = 1 6 x 3 e x \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} y∗=C1(x)y1+C2(x)y2=−31x3⋅ex+21x2⋅xex=61x3ex