2. Let $a, b$ be positive real numbers,
$$
A=\frac{a+b}{2}, B=\frac{2}{\frac{1}{a}+\frac{1}{b}} \text {. }
$$

If $A+B=a-b$, then $\frac{a}{b}=$
2. $3+2 \sqrt{3}$.

From the problem, simplifying we get
$$
\begin{array}{l}
a^{2}-6 a b-3 b^{2}=0 \\
\Rightarrow\left(\frac{a}{b}\right)^{2}-6 \cdot \frac{a}{b}-3=0 .
\end{array}
$$

Solving, we get $\frac{a}{b}=3+2 \sqrt{3}$ (negative root is discarded).