По теореме косинусов:
\[x^2=AB^2+AC^2-2\cdot AB\cdot AC\cos45^\circ.\]
\[x^2=8+25-2\cdot\sqrt8\cdot5\cdot\frac{\sqrt2}{2}=33-20=13.\]
\[x=\sqrt{13}\text{ дм}.\]
Ответ: \(x=\sqrt{13}\) дм.