5. Given $\cos \left(\theta+\frac{\pi}{4}\right)<3\left(\sin ^{5} \theta-\cos ^{5} \theta\right)$, where $\theta \in[-\pi, \pi]$. Then the range of $\theta$ is $\qquad$ .
5. $\left[-\pi,-\frac{3 \pi}{4}\right) \cup\left(\frac{\pi}{4}, \pi\right]$.

Notice that,
$$
\begin{array}{l}
\cos \left(\theta+\frac{\pi}{4}\right)<3\left(\sin ^{5} \theta-\cos ^{5} \theta\right) \\
\Leftrightarrow \frac{\sqrt{2}}{2} \cos \theta+3 \cos ^{5} \theta<\frac{\sqrt{2}}{2} \sin \theta+3 \sin ^{5} \theta .
\end{array}
$$

Since $f(x)=\frac{\sqrt{2}}{2} x+3 x^{5}$ is an increasing function on $\mathbf{R}$, the original inequality is equivalent to
$$
\begin{array}{l}
f(\cos \theta)<f(\sin \theta)(\theta \in[-\pi, \pi]) \\
\Leftrightarrow \cos \theta<\sin \theta(\theta \in[-\pi, \pi]) \\
\Leftrightarrow-\pi \leqslant \theta<-\frac{3 \pi}{4} \text { or } \frac{\pi}{4}<\theta \leqslant \pi .
\end{array}
$$