To find the value of \( a \) such that the area bounded by the curve \( y = \sin^{-1}(\sin x) \) from \( x = 0 \) to \( x = 4\pi \) is equal to the area bounded by the curve \( y = \cos^{-1}(\cos x) \) from \( x = -\pi \) to \( x = a \), we will follow these steps:
### Step 1: Determine the area \( A_1 \)
The function \( y = \sin^{-1}(\sin x) \) is periodic with a period of \( 2\pi \). The graph of \( y = \sin^{-1}(\sin x) \) oscillates between \( 0 \) and \( \pi \) for \( x \) in the intervals \( [0, \pi] \) and \( [2\pi, 3\pi] \), and between \( \pi \) and \( 0 \) for \( x \) in the intervals \( [\pi, 2\pi] \) and \( [3\pi, 4\pi] \).
- From \( x = 0 \) to \( x = \pi \): Area is \( \int_0^\pi \sin^{-1}(\sin x) \, dx = \int_0^\pi x \, dx = \left[ \frac{x^2}{2} \right]_0^\pi = \frac{\pi^2}{2} \).
- From \( x = \pi \) to \( x = 2\pi \): Area is \( \int_\pi^{2\pi} \sin^{-1}(\sin x) \, dx = \int_\pi^{2\pi} (\pi - x) \, dx = \left[ \pi x - \frac{x^2}{2} \right]_\pi^{2\pi} = \left[ 2\pi^2 - 2\pi^2 + \frac{\pi^2}{2} \right] = \frac{\pi^2}{2} \).
- From \( x = 2\pi \) to \( x = 3\pi \): Area is \( \int_{2\pi}^{3\pi} \sin^{-1}(\sin x) \, dx = \frac{\pi^2}{2} \).
- From \( x = 3\pi \) to \( x = 4\pi \): Area is \( \int_{3\pi}^{4\pi} \sin^{-1}(\sin x) \, dx = \frac{\pi^2}{2} \).
Thus, the total area \( A_1 \) from \( x = 0 \) to \( x = 4\pi \) is:
\[
A_1 = 4 \times \frac{\pi^2}{2} = 2\pi^2.
\]
### Step 2: Determine the area \( A_2 \)
Now we will find the area \( A_2 \) under the curve \( y = \cos^{-1}(\cos x) \) from \( x = -\pi \) to \( x = a \).
The function \( y = \cos^{-1}(\cos x) \) is also periodic with a period of \( 2\pi \). The graph oscillates between \( 0 \) and \( \pi \) for \( x \) in the intervals \( [-\pi, 0] \) and \( [\pi, 2\pi] \), and between \( \pi \) and \( 0 \) for \( x \) in the intervals \( [0, \pi] \) and \( [2\pi, 3\pi] \).
- From \( x = -\pi \) to \( x = 0 \): Area is \( \int_{-\pi}^0 \cos^{-1}(\cos x) \, dx = \int_{-\pi}^0 (-x) \, dx = \left[ -\frac{x^2}{2} \right]_{-\pi}^0 = \frac{\pi^2}{2} \).
- From \( x = 0 \) to \( x = a \): Area is \( \int_0^a \cos^{-1}(\cos x) \, dx \).
To find \( a \) such that \( A_1 = A_2 \), we need:
\[
A_1 = A_2 \implies 2\pi^2 = \frac{\pi^2}{2} + \int_0^a \cos^{-1}(\cos x) \, dx.
\]
### Step 3: Solve for \( a \)
We can rearrange this to find the area from \( 0 \) to \( a \):
\[
\int_0^a \cos^{-1}(\cos x) \, dx = 2\pi^2 - \frac{\pi^2}{2} = \frac{4\pi^2}{2} - \frac{\pi^2}{2} = \frac{3\pi^2}{2}.
\]
Now, we need to evaluate the area under \( \cos^{-1}(\cos x) \) from \( 0 \) to \( a \). The area from \( 0 \) to \( \pi \) is:
\[
\int_0^\pi \cos^{-1}(\cos x) \, dx = \frac{\pi^2}{2}.
\]
From \( \pi \) to \( 2\pi \):
\[
\int_\pi^{2\pi} \cos^{-1}(\cos x) \, dx = \frac{\pi^2}{2}.
\]
Thus, the area from \( 0 \) to \( 2\pi \) is:
\[
\int_0^{2\pi} \cos^{-1}(\cos x) \, dx = \frac{\pi^2}{2} + \frac{\pi^2}{2} = \pi^2.
\]
Continuing this process, we find that:
- From \( 0 \) to \( 3\pi \): Area is \( \frac{3\pi^2}{2} \).
- From \( 0 \) to \( 4\pi \): Area is \( 2\pi^2 \).
Thus, we find that \( a \) must be \( \pi \) to satisfy the equality \( A_1 = A_2 \).
### Final Answer
The value of \( a \) is:
\[
\boxed{\pi}.
\]