已知 $\frac{\pi}{2}<\alpha<\pi$, 且 $\sin \alpha=\frac{4}{5}$.

(1) 求 $\tan \alpha$ 的值;

(2) 求 $\cos 2 \alpha+\cos \left(\alpha+\frac{\pi}{2}\right)$ 的值.
(1) $\because \frac{\pi}{2}<\alpha<\pi, \sin \alpha=\frac{4}{5}$,

$\therefore \cos \alpha=-\sqrt{1-\sin ^{2} \alpha}=-\frac{3}{5}$,

$\therefore \tan \alpha=\frac{\sin \alpha}{\cos \alpha}=-\frac{4}{3}$.

(2) $\because \sin \alpha=\frac{4}{5}$,

$\therefore$ 原式 $=1-2 \sin ^{2} \alpha-\sin \alpha=1-\frac{32}{25}-\frac{4}{5}=-\frac{27}{25}$.