12 Given $\sin (x+\sin x)=\cos (x-\cos x), x \in[0, \pi]$, then $x=$
$\qquad$ .
(12) $\frac{\pi}{4}$ Hint: The original equation is equivalent to:
$$
\cos \left(\frac{\pi}{2}-x-\sin x\right)=\cos (x-\cos x) .
$$

So
$$
x-\cos x=2 k \pi+\frac{\pi}{2}-x-\sin x, k \in \mathbf{Z},
$$

or
$$
x-\cos x=2 k \pi-\left(\frac{\pi}{2}-x-\sin x\right), k \in \mathbf{Z},
$$

From (1) we get:
$$
2 x+\sin x-\cos x=2 k \pi+\frac{\pi}{2},
$$

and the function $f(x)=2 x+\sin x-\cos x$ is increasing on $[0, \pi]$. Therefore,
$$
-1=f(0)<f(x)<f(\pi)=2 \pi+1, \quad x \in [0, \pi].
$$

Since $2 k \pi+\frac{\pi}{2} \in \left\{\frac{\pi}{2}, \frac{5 \pi}{2}, \frac{9 \pi}{2}, \cdots\right\}$, the only solution is $2 x+\sin x-\cos x=\frac{\pi}{2}$, i.e., $x=\frac{\pi}{4}$.

Let $g(x)=2 x+\sin x-\cos x-\frac{\pi}{2}$, then $g\left(\frac{\pi}{4}\right)=0$. When $x>\frac{\pi}{4}$, $g(x)>0$; when $x<\frac{\pi}{4}$, $g(x)<0$, so $g(x)=0$ if and only if $x=\frac{\pi}{4}$.
From (2) we get:
$$
\sin x+\cos x=\frac{\pi}{2}-2 k \pi.
$$

Since $1<\frac{\pi}{2}-2 k \pi<\sqrt{2}$, there is no integer solution for $k$, i.e., this equation has no solution.
In summary, the solution to the original equation is $x=\frac{\pi}{4}$.