Example 5.23. Using differentiation and integration, find the Taylor series expansion for the given function $f(x)=\operatorname{arc} \operatorname{tg} x$ and specify the intervals in which these expansions are valid.
Solution. Let's write the expression of the given function in the form of an integral:

$$
\operatorname{arctg} x=\int_{0}^{x} \frac{d t}{1+t^{2}}
$$

Expand the integrand function $f(t)=\frac{1}{1+t^{2}}$ into a Taylor series. For this, replace $x$ with $-t^{2}$ in expansion (6):

$$
f(t)=\frac{1}{1-\left(-t^{2}\right)}=1-t^{2}+t^{4}-t^{6}+\ldots+(-1)^{n} t^{2 n}+\ldots
$$

It is clear that this series converges in the interval $(-1 ; 1)$. Integrating the obtained series term by term within the limits from 0 to $x$ (where $|x|<1$), we get the Taylor series expansion of the function $f(x)=\operatorname{arctg} x$:

$$
\operatorname{arctg} x=x-\frac{x^{3}}{3}+\frac{x^{5}}{5}-\frac{x^{7}}{7}+\ldots+(-1)^{n} \frac{x^{2 n+1}}{2 n+1}+\ldots
$$

This series converges in the same interval $(-1 ; 1)$ as the original series.

## 5.7. Application of Series to Approximate Calculations