5. The maximum value of the function $y=|\sin x|+|\sin 2 x|$ is $\qquad$ .
5. $\frac{\sqrt{414+66 \sqrt{33}}}{16}$

Notice that $y=|\sin x|(1+2|\cos x|)$, then
$$
\begin{array}{l} 
y^{2}=\sin ^{2} x(1+2|\cos x|)^{2} \\
=(1-|\cos x|)(1+|\cos x|)(1+2|\cos x|)^{2} \\
= \frac{1}{\mu \lambda} \cdot \mu(1-|\cos x|) \cdot \lambda(1+|\cos x|) \cdot \\
(1+2|\cos x|)(1+2|\cos x|)(\lambda, \mu>0) \\
\leqslant \frac{1}{\mu}\left[\frac{\mu(1-|\cos x|)+\lambda(1+|\cos x|)+2(1+2|\cos x|)}{4}\right]^{4} \\
= \frac{1}{\mu \lambda}\left[\frac{\mu+\lambda+2+(\lambda-\mu+4)|\cos x|}{4}\right]^{4} . \\
\text { Let } \lambda-\mu+4=0, \\
\mu(1-|\cos x|)=\lambda(1+|\cos x|)=1+2|\cos x| .
\end{array}
$$

From equation (2), we know $|\cos x|=\frac{\lambda-1}{2-\lambda}=\frac{\mu-1}{2+\mu}$.
Combining with equation (1), we can solve for $\lambda=\frac{\sqrt{33}-3}{2}, \mu=\frac{\sqrt{33}+5}{2}$.
Therefore, $y^{2} \leqslant \frac{2}{\sqrt{33}-3} \times \frac{2}{\sqrt{33}+5}\left(\frac{\sqrt{33}+3}{4}\right)^{4}$.
Thus, $y_{\max }=\frac{\sqrt{414+66 \sqrt{33}}}{16}$.