Example 1. Solve the Riccati equation

$$
y^{\prime}-y^{2}+2 e^{x} y=e^{2 x}+e^{x}
$$

knowing its particular solution $y_{1}=e^{x}$.
Solution. Let $y=e^{x}+z(x)$ and substitute into equation (4); we get

$$
\frac{d z}{d x}=z^{2}
$$

from which

$$
-\frac{1}{z}=x-C, \quad \text { or } \quad z=\frac{1}{C-x} .
$$

Thus, the general solution of equation (4) is

$$
y=e^{x}+\frac{1}{C-x}
$$

Remark. Instead of substitution (2), it is often more practical to use the substitution

$$
y=y_{1}(x)+\frac{1}{u(x)}
$$

which immediately reduces the Riccati equation (1) to a linear equation

$$
u^{\prime}-\left(2 a y_{1}+b\right) u=a
$$

2. If two particular solutions of equation (1) are known, then its general integral can be found by a single quadrature.

Let two particular solutions $y_{1}(x)$ and $y_{2}(x)$ of equation (1) be known. Using the fact that the identity

$$
\frac{d y_{1}}{d x} \equiv-a(x) y_{1}^{2}-b(x) y_{1}-c(x)
$$

holds, we can represent equation (1) as

$$
\frac{1}{y-y_{1}} \frac{d\left(y-y_{1}\right)}{d x}=-a(x)\left(y+y_{1}\right)-b(x)
$$

or

$$
\frac{d}{d x}\left[\ln y-y_{1}\right]=-a(x)\left(y+y_{1}\right)-b(x)
$$

For the second particular solution $y_{2}(x)$, we similarly find

$$
\frac{d}{d x}\left[\ln y-y_{2}\right]=-a(x)\left(y+y_{2}\right)-b(x)
$$

Subtracting equation (6) from equation (5), we get

$$
\frac{d}{d x}\left[\ln \frac{y-y_{1}}{y-y_{2}}\right]=a(x)\left(y_{2}-y_{1}\right)
$$

from which

$$
\frac{y-y_{1}}{y-y_{2}}=C e^{\int a(x)\left[y_{2}(x)-y_{1}(x) \mid d x\right.}
$$