## 题目
微分方程 $ y'+y\tan x = \cos x $ 的通解为______.
---
#### 分析
给定的微分方程 $ y'+y\tan x = \cos x $ 是一个标准的一阶线性非齐次微分方程,其形式为
$$ y'+P(x)y = Q(x) $$
可知:
$ P(x) = \tan x $
$ Q(x) = \cos x $
确定好$ P(x) $ 和 $ Q(x) $的值后,我们就可以使用公式了。
公式为:
$$ y = e^{ -\int P(x) dx } ( \int Q(x) e^{ \int P(x) dx } dx + C ) $$
---
#### 解:
$ y = e^{ -\int \tan x dx } ( \int \cos x e^ { \int \tan x dx} dx + C ) $
$ = e^{- \int \frac{ \sin x } { \cos x } dx} ( \int \cos x e ^{ \int \frac { \sin x } { \cos x } dx } dx + C ) $
$ = e^{ \int \frac { 1 } { \cos x } d (\cos x) }( \int \cos x e^{ -\int \frac {1} {\cos x} dx } dx + C ) $
$ = e^{ \ln \cos x } ( \int \cos x e^{-\ln \cos x} dx + C )$
$ = \cos x ( $ - $\int 1dx + C ) $
$ = \cos x ( x + C )$
故微分方程的通解为:
$$ y = \cos x ( x + C ) $$