# How to add underbrace outside square root [duplicate]

I am trying to use latex to write the below. The code I have makes the underbrace contained in the square root so the square root symbol is larger, but I want it like it is in the bottom picture. This is what I have:

This is what I want:

Here is my code:

$\sqrt{\underbrace{\overline{xx\cdots x}}_{2n}- \underbrace{\overline{yy\cdots y}}_{n}}= \underbrace{\overline{zz\cdots z}}_{n}$


## marked as duplicate by Werner, Stefan Pinnow, Svend Tveskæg, egreg equations StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 10 '16 at 21:41

• Welcome to TeX.SE! Please post the code you've tried so far. – Mico May 10 '16 at 20:39

Encasing the argument of \sqrt macro in a \smash[b]{...} macro gets the stated job done.

In addition, I think it's important to make sure that the three underbraces are all at the same depth. This may achieved by inserting \vphantom{y} in the xx and zz groups.

For the finishing touch, I'd extend the square root's horizontal bar ever so slightly before \overline{xx...x} and beyond \overline{yy...y}, and I'd place empty "math atoms" around the - and = symbols to improve the horizontal spacing. (For some reason, the presence of the \underbraces interferes with the normal spacing around objects of type mathbin (-) and mathrel (=).)

\documentclass{article}
\usepackage{amsmath} % for '\smash[b]' macro
\setlength\textwidth{2in} % just for this example
\begin{document}
\noindent
some text before \dots  % filler text
$\sqrt{\smash[b]{\, \underbrace{\overline{\vphantom{y}xx\cdots x}}_{2n} {}-{} \underbrace{\overline{yy\cdots y}}_{n}}\,} {}={} \underbrace{\overline{\vphantom{y}zz\cdots z}}_{n}$
some text after \dots  % filler text
\end{document}

• Hmmm... I don't understand how you could vote to "keep open" this question when it's clearly a duplicate. You're using the same technique in this answer as you in the suggested duplicate (answer). Just an observation... – Werner May 10 '16 at 21:31
• @Werner - I think this question has not one but two issues that need to be solved. First, there's the stated issue about the depth of the surd. The unstated but nevertheless also interesting issue is the equalizing the depths of the three underbraces. – Mico May 10 '16 at 21:35