4. As shown in Figure 3, in the isosceles right triangle $\triangle ABC\left(\angle C=90^{\circ}\right)$, take a point $P$ inside, and $AP=AC=$ $a, BP=CP=b(a>b)$. Then $\frac{a^{2}+b^{2}}{a^{2}-b^{2}}=$ $\qquad$
4. $\sqrt{3}$.

From the problem, we know that $\angle B P C$ and $\angle C A P$ are supplementary.
As shown in Figure 7, extend $B P$ to intersect $A C$
at point $K$, then
$$
P C=P K=b, B K=2 b .
$$

Since $\triangle P C K \sim \triangle A C P$, we have
$$
C K=\frac{b^{2}}{a} \text {. }
$$

Also, $B K^{2}=B C^{2}+C K^{2}$, which means
$$
(2 b)^{2}=a^{2}+\left(\frac{b^{2}}{a}\right)^{2} \text {, }
$$

Therefore, $a^{4}+b^{4}=4 a^{2} b^{2}$.
Thus, $\left(a^{2}+b^{2}\right)^{2}=6 a^{2} b^{2}$,
$$
\left(a^{2}-b^{2}\right)^{2}=2 a^{2} b^{2}(a>b) \text {. }
$$

Hence, $\left(\frac{a^{2}+b^{2}}{a^{2}-b^{2}}\right)^{2}=3$, which means $\frac{a^{2}+b^{2}}{a^{2}-b^{2}}=\sqrt{3}$.