1391. Find for each series the partial sum of the first $n$ terms $\left(S_{n}\right)$; show, using the definition, the convergence (divergence) of the series; find the sum of the series ( $S$ ):
1) $a+a q+a q^{2}+\ldots+a q^{n-1}+\ldots$

$$
\text { 2) } \frac{1}{1 \cdot 2}+\frac{1}{2 \cdot 3}+\frac{1}{3 \cdot 4}+\ldots+\frac{1}{n(n+1)}+\ldots
$$
Solution. Let's consider several cases.

1) Let $|q|<1$, then the partial sum $S_{n}$ is found using the formula for the sum of a decreasing geometric progression

$$
S=\frac{a-a q^{n}}{1-q}
$$

Therefore, the partial sum of the given series is

$$
S_{n}=\frac{a-a q^{n}}{1-q}
$$

The sum of the series is

$$
S=\lim _{n \rightarrow \infty} S_{n}=\lim _{n \rightarrow \infty}\left(\frac{a}{1-q}-\frac{a q^{n}}{1-q}\right)=\frac{a}{1-q}
$$

since the second term under the limit is an infinitesimal quantity ($q^{n} \rightarrow 0$ as $n \rightarrow+\infty$). The series converges.

If $|q|>1$, then the partial sum $S_{n}$ is found using the formula for the sum of an increasing geometric progression

$$
S=\frac{l q-a}{q-1}
$$

Therefore, the partial sum of the given series is

$$
S_{n}=\frac{a q^{n}-a}{q-1}
$$

The sum of the series is

$$
S=\lim _{n \rightarrow \infty} S_{n}=\lim _{n \rightarrow \infty}\left(\frac{a q^{n}}{q-1}-\frac{a}{q-1}\right)=\infty
$$

since the first term under the limit is an infinitely large quantity ($q^{n} \rightarrow \infty$ as $n \rightarrow+\infty$). The series diverges.

If $q=1$, then $S_{n}=a+a+\ldots+a=n a$, therefore, $\lim S_{n}=\lim a n=\infty$. The series diverges. $n \rightarrow \infty \quad n \rightarrow \infty$

If $q=-1$, then $S_{1}=a, S_{2}=a-a=0, S_{3}=a-a+a=a, S_{4}=0, S_{5}=a, \ldots$, from which it is clear that the sequence of partial sums does not have a limit, therefore, the series 1 diverges.

Thus, the given series converges when $|q|<1$ and diverges when $|q| \geqslant 1$.

2) The general term of the series $a_{n}=\frac{1}{n(n+1)}$ can be rewritten as:

$$
\frac{1}{n(n+1)}=\frac{A}{n}+\frac{B}{n+1}
$$

Determining the coefficients $A$ and $B$, we get

$$
a_{n}=\frac{1}{n}-\frac{1}{n+1}
$$

Therefore,

$$
\sum_{n=1}^{\infty} \frac{1}{n(n+1)}=\sum_{n=1}^{\infty}\left(\frac{1}{n}-\frac{1}{n+1}\right)
$$

Let's write the partial sum of the series

$$
\begin{gathered}
S_{n}=\left(1-\frac{1}{2}\right)+\left(\frac{1}{2}-\frac{1}{3}\right)+\left(\frac{1}{3}-\frac{1}{4}\right)+ \\
+\ldots+\left(\frac{1}{n}-\frac{1}{n+1}\right)=1-\frac{1}{n+1} \\
S=\lim _{n \rightarrow \infty} S_{n}=\lim _{n \rightarrow \infty}\left(1-\frac{1}{n+1}\right)=1
\end{gathered}
$$

It follows that the series 2 converges and its sum $S=1$.