81. Solve the equation $y^{\prime}+y \tan x=\cos ^{2} x$.
Solution. This is a linear equation, as it has the form $y^{\prime}+p y=q$, where $p=\operatorname{tg} x, q=\cos ^{2} x$. Let $y=u v$; then $y^{\prime}=u^{\prime} v+$ $+v^{\prime} u$

$$
u^{\prime} v+v^{\prime} u-u v \operatorname{tg} x=\cos ^{2} x
$$

or

$$
u^{\prime} v+\left(v^{\prime}+v \operatorname{tg} x\right) u=\cos ^{2} x
$$

Of the two functions $u$ and $v$, one can be chosen arbitrarily; therefore, we define the function $v$ so that the multiplier of $u$ in equation (2) becomes zero, i.e.,

$$
v^{\prime}+v \operatorname{tg} x=0 \text { or } \frac{d v}{v}+\operatorname{tg} x d x=0
$$

from which

$$
\int \frac{d v}{v}+\int \operatorname{tg} x=0 ; \ln |v|-\ln |\cos x|=0 ; v=\cos x
$$

(the arbitrary constant $C$ is taken to be zero).

Substituting the expression for the function $v$ into equation (2), to determine $u$ we obtain the equation

$$
u^{\prime} \cos x=\cos ^{2} x \text { or } d u=\cos x d x
$$

from which

$$
\int d u=\int \cos x d x+C, \text { i.e., } u=\sin x+C
$$

Since $y=u v$, the general solution of the given equation will be

$$
y=(\sin x+C) \cos x
$$

From the considered examples, it is easy to establish the algorithm for solving a linear differential equation of the first order.

$1^{0}$. Reduce the equation to the form $y^{\prime}+p y=q$.

$2^{0}$. Using the substitution $y=u v$, find $y^{\prime}=u^{\prime} v+v^{\prime} u$ and substitute these expressions into the equation.

$3^{0}$. Group the terms of the equation, factoring out one of the functions $v$ or $u$. Find the second function by setting the expression in parentheses to zero and solving the resulting equation.

$4^{0}$. Substitute the found function into the remaining expression and find the second function.

$5^{0}$. Write the general solution, substituting the expressions for the found functions $u$ and $v$ into the equality $y=u v$.

$6^{0}$. If a particular solution is required, determine $C$ from the initial conditions and substitute it into the general solution.