Example 5. Let the sequence of positive numbers $\left\{a_{\mathrm{n}}\right\}$ have the sum of the first $n$ terms $S_{\mathrm{n}}$ satisfying: $\quad S_{\mathrm{n}}=\frac{1}{2}\left(a_{\mathrm{n}}+\frac{1}{a_{\mathrm{n}}}\right)$, find $a_{\mathrm{n}}$.
$$
\begin{array}{l}
\text { Sol } \because S_{n}=\frac{1}{2}\left(a_{n}+\frac{1}{a_{n}}\right), \\
\therefore S_{n-1}=\frac{1}{2}\left(a_{n-1}+\frac{1}{a_{n-1}}\right) .
\end{array}
$$

Subtracting the two equations gives:
$$
a_{n}=\frac{1}{2}\left[\left(a_{n}-a_{n-1}\right)+\frac{1}{a_{n}}-\frac{1}{a_{n-1}}\right]
$$

Rearranging gives $a_{n}-\frac{1}{a_{n}}=-\left(a_{n-1}+\frac{1}{a_{n-1}}\right)$.
$$
\because \quad a_{1}=\frac{1}{2}\left(a_{1}+\frac{1}{a_{1}}\right)
$$

Thus, $2 a_{1}=a_{1}+\frac{1}{a_{1}}$, which gives $a_{1}^{2}=1$, i.e., $a_{1}=1$. Substituting into the recursive relation, we get $a_{2}-\frac{1}{a_{2}}=-2$. Rearranging gives $a_{2}^{2}+2 a_{2}-1=0$. Solving this, we get
$$
a_{2}=\sqrt{2}-1 \text {. }
$$

Similarly, we find $a_{3}=\sqrt{3}-\sqrt{2}$,
$$
a_{4}=\sqrt{4}-\sqrt{3} \text {. }
$$

From this, we can conjecture that $a_{n}=\sqrt{n}-\sqrt{n-1}$.
Proof: When $n=1$, $S_{1}=a_{1}=1$,
and $a_{1}=\sqrt{1}-\sqrt{1-1}=1$.
Assume that for $n=k$, $a_{k}=\sqrt{k}-\sqrt{k-1}$ holds.
$$
\begin{array}{l}
\text { Then for } n=k+1, \quad a_{k+1}-\frac{1}{a_{k+1}}=-\left(a_{k}+\frac{1}{a_{k}}\right) \\
=-\left(\sqrt{k}-\sqrt{k-1}+\frac{1}{\sqrt{k}-\sqrt{k-1}}\right) \\
=-(\sqrt{k}-\sqrt{k-1}+\sqrt{k}+\sqrt{k-1}) \\
=-2 \sqrt{k} \text {, } \\
\therefore a_{k+1}^{2}+2 \sqrt{k} a_{k+1}-1=0 \text { ? } \\
a_{k+1}=\frac{-2 \sqrt{k}+\sqrt{4 k+4}}{2} \\
=\sqrt{k+1}-\sqrt{k} \text { holds. } \\
\text { Therefore, } a_{n}=\sqrt{n}-\sqrt{n-1} \text {. } \\
\end{array}
$$