4. If the function
$$
f(x)=a x+\sin x
$$

has perpendicular tangents on its graph, then the real number $a$ is
$\qquad$ .
4.0.

Notice that, $f^{\prime}(x)=a+\cos x$.
If the function $f(x)$ has two perpendicular tangents, then there exist $x_{1}, x_{2} \in \mathbf{R}$, such that
$$
\begin{array}{l}
f^{\prime}\left(x_{1}\right) f^{\prime}\left(x_{2}\right)=-1 \\
\Leftrightarrow\left(a+\cos x_{1}\right)\left(a+\cos x_{2}\right)=-1 \\
\Leftrightarrow a^{2}+a\left(\cos x_{1}+\cos x_{2}\right)+\cos x_{1} \cdot \cos x_{2}+1=0 \\
\Leftrightarrow\left(a+\frac{\cos x_{1}+\cos x_{2}}{2}\right)^{2}+1- \\
\quad\left(\frac{\cos x_{1}-\cos x_{2}}{2}\right)^{2}=0 \\
\Leftrightarrow \cos x_{1}=-\cos x_{2}= \pm 1, a=0 .
\end{array}
$$