How can I wrap the text from \mathclap so that the text doesn't spill over like the picture?
\usepackage{mathtools}
\makeatletter% From https://tex.stackexchange.com/a/419690/156344
\def\smalloverbrace#1{\mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern3\p@}%
\tiny\downbracefill\crcr\noalign{\kern3\p@\nointerlineskip}%
$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
\makeatother
\begin{document}
\[ \mu = \int_{-\infty}^{\infty} x f(x)dx = \frac{\int_{-\infty}^{\infty} x f(x)dx}{\int_{-\infty}^{\infty} x f(x)dx} = \underbrace{\bar{x}}_{\mathclap{\text{x-coordinate of centroid of region $\mathcal{R}$ under the graph}}}\]
\end{document}



\vphantom{$\bigg|$}in the limit text. (Adjust the "bigness" as necessary.) – barbara beeton Apr 20 '19 at 22:45