On page 193 the following example shows that $a₁ = 1/ π$
But solving with this formula gives me $a₁ = 2/ π$
It appears there's an error in the textbook and your derivation is correct.
The function $x(t)$ is defined as follows:
(1) $\quad x(t)=\left\{ \begin{array}{cc} 1 & |t|<T_1 \\ 0 & T_1<|t|<\frac{T}{2} \\ x(|t|-T) & \text{True} \\ \end{array}\right.$
For $T=2 \pi$ and $T=4 T_1$ formula (1) above simplifies to formula (2) below with Fourier series illustrated in formula (3) below.
(2) $\quad x(t)=\left\{ \begin{array}{cc} 1 & | t| <\frac{\pi}{2} \\ 0 & \frac{\pi}{2}<|t|<\pi \\ x(|t|-2 \pi) & \text{True} \\ \end{array}\right.$
(3) $\quad x(t)=\frac{1}{2}+\underset{K\to\infty}{\text{lim}}\ \sum\limits_{k=1}^K \frac{2 \sin\left(\frac{\pi k}{2}\right)}{\pi k} \cos (k t)$
The following table gives the first $10$ coefficients of the Fourier cos series defined in formula (3) above.
$$\begin{array}{cc} k & \frac{2 \sin \left(\frac{\pi k}{2}\right)}{\pi k} \\ 1 & \frac{2}{\pi } \\ 2 & 0 \\ 3 & -\frac{2}{3 \pi } \\ 4 & 0 \\ 5 & \frac{2}{5 \pi } \\ 6 & 0 \\ 7 & -\frac{2}{7 \pi } \\ 8 & 0 \\ 9 & \frac{2}{9 \pi } \\ 10 & 0 \\ \end{array}$$
Figure (1) below illustrates formula (3) for $x(t)$ in orange overlaid on the reference function defined in formula (2) in blue where formula (3) is evaluated at $K=20$.
Figure (1): Illustration of formula (3) for $x(t)$
Copyright © 2021 JogjaFile Inc.
It appears there's an error in the textbook and your derivation is correct.
The function $x(t)$ is defined as follows:
(1) $\quad x(t)=\left\{ \begin{array}{cc} 1 & |t|<T_1 \\ 0 & T_1<|t|<\frac{T}{2} \\ x(|t|-T) & \text{True} \\ \end{array}\right.$
For $T=2 \pi$ and $T=4 T_1$ formula (1) above simplifies to formula (2) below with Fourier series illustrated in formula (3) below.
(2) $\quad x(t)=\left\{ \begin{array}{cc} 1 & | t| <\frac{\pi}{2} \\ 0 & \frac{\pi}{2}<|t|<\pi \\ x(|t|-2 \pi) & \text{True} \\ \end{array}\right.$
(3) $\quad x(t)=\frac{1}{2}+\underset{K\to\infty}{\text{lim}}\ \sum\limits_{k=1}^K \frac{2 \sin\left(\frac{\pi k}{2}\right)}{\pi k} \cos (k t)$
The following table gives the first $10$ coefficients of the Fourier cos series defined in formula (3) above.
$$\begin{array}{cc} k & \frac{2 \sin \left(\frac{\pi k}{2}\right)}{\pi k} \\ 1 & \frac{2}{\pi } \\ 2 & 0 \\ 3 & -\frac{2}{3 \pi } \\ 4 & 0 \\ 5 & \frac{2}{5 \pi } \\ 6 & 0 \\ 7 & -\frac{2}{7 \pi } \\ 8 & 0 \\ 9 & \frac{2}{9 \pi } \\ 10 & 0 \\ \end{array}$$
Figure (1) below illustrates formula (3) for $x(t)$ in orange overlaid on the reference function defined in formula (2) in blue where formula (3) is evaluated at $K=20$.
Figure (1): Illustration of formula (3) for $x(t)$