3. From point $\mathbf{P}$ on the hypotenuse $\mathrm{AC}$ of the right triangle $\mathrm{ABC}$, draw a perpendicular line $\mathrm{PM}$ to $\mathrm{AC}$. If it divides the triangle into two figures of equal area, and $A P=a, P C=b$, find the area of $\triangle A B C$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
3. If the foot of the perpendicular $\mathrm{M}$ is on the right-angle side $\mathrm{AB}$, and $M$ does not coincide with $B$ (Figure 3), according to the problem, we have $\frac{1}{2} \mathrm{a} \cdot \mathbf{P M} > \frac{1}{2} \mathrm{~b} \cdot \mathbf{P M}$, thus $a > b$.

Conversely, it is easy to see that when condition (1) holds, point $M$ is on the right-angle side $AB$ and does not coincide with $B$. Assuming condition (1), we have $\triangle A B C \backsim \triangle A P M$. According to the problem, the area of $\triangle \mathrm{ABC}$ is twice the area of $\triangle \mathrm{APM}$, so the ratio of the corresponding sides of these two triangles is $\sqrt{2}$. This gives us $\mathrm{AB} = \mathrm{a} \sqrt{2}$. By the Pythagorean theorem, the other right-angle side $BC = \sqrt{b^{2} + 2 a b - a^{2}}$. Therefore, the area of $\triangle A B C$ is
$$
S = \frac{\sqrt{2}}{2} \mathrm{a} \sqrt{\mathrm{b}^{2} + 2 \mathrm{ab} - \mathrm{a}^{2}}.
$$

If $b > a$, then point $M$ is on the right-angle side $BC$, and in the previous argument, the positions of $\mathrm{a}$ and $\mathrm{b}$ need to be swapped. In this case,
$$
S = \frac{\sqrt{2}}{2} b \sqrt{a^{2} + 2 a b - b^{2}}.
$$

Finally, if $a = b$, then $M$ coincides with $B$, and $S = a^{2}$.