五、解答题 (本题满分 9 分)
求微分方程 $y^{\prime \prime}+y=x+\cos x$ 的通解.
齐通:
$$
\lambda^{2}+1=0 \Rightarrow \lambda=0 \pm i \cdot 1 \Rightarrow
$$
$$
y^{*}=e^{\alpha x}\left(C_{1} \cos \beta x+C_{2} \sin \beta x\right) \Rightarrow
$$
$$
y^{*}=C_{1} \cos x+C_{2} \sin x
$$
非奇特:
先拆分:
$$
y^{\prime \prime}+y=x+\cos x\left\{\begin{array}{l}
y^{\prime \prime}+y=x \\ y^{\prime \prime}+y=\cos x
\end{array}\right.
$$
对 $y^{\prime \prime}+y=x$, 有:
$$
Y_{1}^{*}=x^{k}(A x+B) e^{0 x} \Rightarrow 0 \neq \lambda \Rightarrow k=0 \Rightarrow$$
$$
Y_{1}^{*}=A x+B \Rightarrow\left(Y_{1}^{*}\right)^{\prime}=A \quad \left(Y_{1}^{*}\right)^{\prime \prime}=0 \Rightarrow
$$
$$
\left(Y_{1}^{*}\right)^{\prime \prime}+Y^{*}=X \Rightarrow A=1, B=0
$$
$$
Y_{1}^{*}=x
$$
对 $y^{\prime \prime}+y=\cos x$, 有:
$$
Y_{2}^{*}=x^{k} e^{\alpha x}\left[Q_{n}{(x)} \cos \beta x+\omega_{n}(x) \sin \beta x\right] \Rightarrow
$$
$$
\alpha=0, \beta=1 \Rightarrow \alpha \pm i \beta=\lambda_{1}=\lambda_{2} \Rightarrow k=1 \Rightarrow
$$
$$
Y_{2}^{*}=x[C \cdot \cos x+D \cdot \sin x] \Rightarrow
$$
$$
\left(Y_{2}^{*}\right)^{\prime}=(C \cdot \cos x+D \sin x)+x(-\cos x+D \cos x) \Rightarrow
$$
$$
\left(Y_{2}^{*}\right)^{\prime \prime}=(-C \cdot \sin x+D \cos x)+(-C \sin x+
$$
$$
D \cos x)+x(-C \cdot \cos x-D \cdot \sin x) \Rightarrow
$$
$$
\left(Y_{2}^{*}\right)^{\prime \prime}+Y_{2}^{*}=\cos x \Rightarrow
$$
$$
-2 C \cdot \sin x+2 D \cos x=\cos x \Rightarrow
$$
$$
C=0, D=\frac{1}{2} \Rightarrow
$$
$$
Y_{2}^{*}=\frac{1}{2} x \sin x \Rightarrow
$$
于是:
$$
Y=y^{*}+Y_{1}^{*}+Y_{2}^{*} \Rightarrow
$$
$$
Y=C_{1} \cos x+C_{2} \sin x+x+\frac{1}{2} x \sin x
$$