4. Given that the three sides of $\triangle A B C$ are $a, b, c$, and $D, E$ are the midpoints of sides $A B, A C$ respectively. Line $D E$ intersects the circumcircle of $\triangle A B C$ at points $F, G$. Then $D F-E G=$ $\qquad$ .
4. $\pm \frac{b^{2}-c^{2}}{2 a}$.

When line $D E$ intersects the arc $\overparen{A B}$ opposite $\angle C$ at point $F$, and intersects the arc $\overparen{A C}$ opposite $\angle B$ at point $G$, as shown in Figure 5. By the Midline Theorem of a triangle, we have
$$
D E=\frac{1}{2} B C=\frac{1}{2} a .
$$

By the Intersecting Chords Theorem, we get
$D F \cdot D G=A D \cdot D B, E G \cdot E F=A E \cdot E C$.
Thus, we have
$$
\left\{\begin{array}{l}
D F\left(\frac{1}{2} a+E G\right)=\frac{1}{4} c^{2}, \\
E G\left(\frac{1}{2} a+D F\right)=\frac{1}{4} b^{2} .
\end{array}\right.
$$
By subtracting the two equations and simplifying, we get
$$
D F-E G=\frac{c^{2}-b^{2}}{2 a} \text {. }
$$

When line $D E$ intersects the arc $\overparen{A B}$ opposite $\angle C$ at point $G$, and intersects the arc $\overparen{A C}$ opposite $\angle B$ at point $F$, as shown in Figure 6.
Similarly, we get
$$
\begin{array}{l}
D F-E G \\
=E F-D G=\frac{b^{2}-c^{2}}{2 a} .
\end{array}
$$

In summary, $D F-E G= \pm \frac{b^{2}-c^{2}}{2 a}$.