14. Given the function
$$
f(x)=2\left(\sin ^{4} x+\cos ^{4} x\right)+m(\sin x+\cos x)
$$

has a maximum value of 5 for $x \in\left[0, \frac{\pi}{2}\right]$. Find the value of the real number $m$.
14. Notice,
$$
f(x)=2-(2 \sin x \cdot \cos x)^{2}+m(\sin x+\cos x)^{4} \text {. }
$$

Let $t=\sin x+\cos x$
$$
=\sqrt{2} \sin \left(x+\frac{\pi}{4}\right) \in[1, \sqrt{2}] \text {. }
$$

Thus, $2 \sin x \cdot \cos x=t^{2}-1$.
Therefore, $f(x)=2-\left(t^{2}-1\right)^{2}+m t^{4}$
$=(m-1) t^{4}+2 t^{2}+1$.
Let $u=t^{2} \in[1,2]$.
By the problem, $g(u)=(m-1) u^{2}+2 u+1$ has a maximum value of 5 for $u \in[1,2]$.
When $m-1=0$,
$$
g(u)=2 u+1 \leqslant g(2)=5,
$$

Thus, $m=1$ satisfies the condition;
When $m-1>0$,
$$
g(u)_{\max } \geqslant g(2)>2 \times 2+1=5 \text {, }
$$

which is a contradiction;
When $m-1<0$,
$$
g(u)<2 u+1 \leqslant 5 \text {, }
$$

which is a contradiction.
In conclusion, the real number $m=1$.