5. Given that $M$ is the midpoint of edge $C_{1} D_{1}$ of the cube $A_{1} B_{1} C_{1} D_{1}-A B C D$, $O$ is the midpoint of $B D_{1}$, and $O M / /$ plane $\beta$, where plane $\beta$ passes through point $B$ and is different from plane $B_{1} B C C_{1}$. If point $P \in \beta$, and $P$ is within or on the boundary of the square $B_{1} B C C_{1}$, let $\theta$ be the angle between $A_{1} P$ and plane $B_{1} B C C_{1}$, then the maximum value of $\tan \theta$ is $\qquad$
5. $\sqrt{2}$.

As shown in Figure 2, by the given conditions, point $P$ lies on segment $B C_{1}$. Then the angle $\theta$ formed by $A_{1} P$ and plane $B_{1} B C C_{1}$ is
$$
\begin{array}{l}
\theta=\angle A_{1} P B_{1}, \\
\tan \theta=\frac{A_{1} B_{1}}{B_{1} P} .
\end{array}
$$

Since the minimum value of $B_{1} P$ is $\frac{\sqrt{2}}{2} A_{1} B_{1}$, the maximum value of $\tan \theta$ is $\sqrt{2}$.