6. In $\triangle A B C$, the sides opposite to $\angle A, \angle B, \angle C$ are $a, b, c$ respectively. If $a=5, b=4, \cos (A-B)=\frac{31}{32}$, then the area of $\triangle A B C$ is $\qquad$ .
6. $\frac{15 \sqrt{7}}{4}$.
(Method 1) By the property of similar triangles $\frac{a}{\sin A}=\frac{b}{\sin B}=\frac{a+b}{\sin A+\sin B}=\frac{a-b}{\sin A-\sin B}$, we get
$$
9 \cdot(\sin A-\sin B)=1 \cdot(\sin A+\sin B),
$$

Thus,
$$
18 \sin \frac{A-B}{2} \cos \frac{A+B}{2}=2 \sin \frac{A+B}{2} \cos \frac{A-B}{2},
$$

which means $\tan \frac{A+B}{2}=9 \tan \frac{A-B}{2}$.
Since
$$
\cos (A-B)=\frac{1-\tan ^{2} \frac{A-B}{2}}{1+\tan ^{2} \frac{A-B}{2}},
$$

and given $a>b$ implies $\angle A>\angle B$, so $\tan \frac{A-B}{2}=\frac{\sqrt{7}}{21}$, thus $\tan \frac{A+B}{2}=\frac{3 \sqrt{7}}{7}$, hence $\tan \frac{C}{2}=$ $\cot \frac{A+B}{2}=\frac{\sqrt{7}}{3}, \sin C=\frac{3 \sqrt{7}}{8}, S=\frac{1}{2} a b \sin C=\frac{15 \sqrt{7}}{4}$.
(Method 2) Take a point $A_{1}$ on side $AB$ such that $CA_{1}=CA=4$, then $\angle A_{1}CB=\angle CA_{1}A-\angle ABC=$ $\angle A-\angle B$. By the given condition and the cosine rule, we get
$$
A_{1}B=\sqrt{4^{2}+5^{2}-2 \times 4 \times 5 \times \frac{31}{32}}=\frac{3}{2},
$$

thus
$$
\cos A=-\cos \angle CA_{1}B=-\frac{CA_{1}^{2}+A_{1}B^{2}-BC^{2}}{2 CA_{1} \cdot A_{1}B}=\frac{9}{16},
$$

therefore
$$
\begin{array}{l}
c=AA_{1}+A_{1}B=2 \times \frac{9}{16} \times 4+\frac{3}{2}=6, \\
h_{c}=4 \sqrt{1-\left(\frac{9}{16}\right)^{2}}=\frac{5 \sqrt{7}}{4},
\end{array}
$$

so $S=\frac{1}{2} c h_{c}=\frac{15 \sqrt{7}}{4}$.