2. Find the largest prime $p$, such that there exist $a, b \in \mathbf{Z}_{+}$, satisfying
$$
p=\frac{b}{2} \sqrt{\frac{a-b}{a+b}} .
$$
2. Let $(a, b)=d, a=d a_{1}, b=d b_{1}$, where $d$, $a_{1}$, $b_{1} \in \mathbf{Z}_{+}$, $a_{1}>b_{1}$, and $\left(a_{1}, b_{1}\right)=1$. Then,
$$
4\left(a_{1}+b_{1}\right) p^{2}=d^{2} b_{1}^{2}\left(a_{1}-b_{1}\right) \text {. }
$$

Notice that,
$$
\begin{array}{l}
\left(a_{1}+b_{1}, a_{1}-b_{1}\right) \\
=\left(a_{1}+b_{1}, 2 b_{1}\right) \\
=\left(a_{1}+b_{1}, 2\right) \\
=1 \text { or } 2 .
\end{array}
$$
(1) If $\left(a_{1}+b_{1}, a_{1}-b_{1}\right)=1$, then $a_{1}-b_{1}$ and $a_{1}+b_{1}$ can only be odd and perfect squares.

Let $a_{1}+b_{1}=t^{2}$, $a_{1}-b_{1}=s^{2}$ (where $s$ and $t$ are coprime positive odd numbers). Then,
$$
a_{1}=\frac{s^{2}+t^{2}}{2} \text { is odd, } b_{1}=\frac{t^{2}-s^{2}}{2} \text { is even. }
$$

Let $b_{1}=2 b_{2}$. Then,
$$
\begin{array}{l}
\left(a_{1}+2 b_{2}\right) p^{2}=d^{2} b_{2}^{2}\left(a_{1}-2 b_{2}\right) \\
\Rightarrow b_{2}^{2}\left(a_{1}-2 b_{2}\right) \mid p^{2} \\
\Rightarrow b_{2}=1 \text { or } p .
\end{array}
$$

If $b_{2}=1$, then
$$
t^{2}-s^{2}=2 \Rightarrow(t-s)(t+s)=2 \text {, }
$$

and $t-s$ and $t+s$ are both positive even numbers, which is a contradiction;
If $b_{2}=p$, then
$$
\begin{array}{l}
a_{1}+2 p=d^{2}\left(a_{1}-2 p\right) \\
\Rightarrow a_{1}+2 p=d^{2}, a_{1}-2 p=1 \\
\Rightarrow p=\frac{d-1}{2} \cdot \frac{d+1}{2} \\
\Rightarrow \frac{d-1}{2}=1 \\
\Rightarrow d=3, p=2 .
\end{array}
$$
(2) If $\left(a_{1}+b_{1}, a_{1}-b_{1}\right)=2$, then $\frac{a_{1}+b_{1}}{2}$ and $\frac{a_{1}-b_{1}}{2}$ $(>0)$ are coprime perfect squares, and $\left.b_{1}^{2} \frac{a_{1}-b_{1}}{2} \right\rvert\, 4 p^{2}$.

Since $\frac{a_{1}+b_{1}}{2}-\frac{a_{1}-b_{1}}{2}=b_{1}$ is the difference of two perfect squares, thus, $b_{1} \geqslant 3$.
Also, $b_{1}^{2} \mid 4 p^{2}$, then $b_{1}=p$, $\frac{a_{1}-b_{1}}{2}=1$ or 4, i.e., $\left(a_{1}, b_{1}\right)=(p+2, p)$ or $(p+8, p)$.
If $\left(a_{1}, b_{1}\right)=(p+2, p)$, then
$$
\begin{array}{l}
4(2 p+2) p^{2}=2 d^{2} p^{2} \\
\Rightarrow d^{2}=4(p+1)
\end{array}
$$
$\Rightarrow p+1$ is a perfect square.
Let $p+1=m^{2}\left(m \in \mathbf{Z}_{+}\right)$. Hence, the prime $p$ is
$$
\begin{array}{l}
p=(m-1)(m+1) \\
\Rightarrow m-1=1 \\
\Rightarrow p=3 .
\end{array}
$$

If $\left(a_{1}, b_{1}\right)=(p+8, p)$, then
$$
\begin{array}{l}
4(2 p+8) p^{2}=8 d^{2} p^{2} \\
\Rightarrow d^{2}=p+4 \\
\Rightarrow p=(d-2)(d+2) \\
\Rightarrow d-2=1, p=5 .
\end{array}
$$

In this case, $(a, b)=(39,15)$.
In summary, $p_{\max }=5$.