I want to keep the size of the square root unchanged without putting the underbrace outside
\sqrt{\underbrace{=A}{B}}
I want to keep the size of the square root unchanged without putting the underbrace outside
\sqrt{\underbrace{=A}{B}}
Smashing the radicand is not sufficient. Here's a working version:
\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % just for the example
\newcommand{\smashedsqrt}[2][]{%
\vphantom{#2}%
\sqrt[#1]{\smash[b]{#2}}%
}
\begin{document}
\lipsum*[3]
\[
\smashedsqrt{\underbrace{B}_{=A}}
\]
\lipsum*[3]
\[
\sqrt{\smash[b]{\underbrace{B}_{=A}}}
\]
\lipsum[3]
\end{document}
The second example shows the problem with the simple smashing.

I suppose this is what you want:

Here is the exact code:
\sqrt{\smash[b]{{\underbrace{B}_{=A}}}}
However the square root symbol is wider than if there were no underbrace if the "B" part is too small. In such case one has to do some (limited) manual adjustment because the square root symbol must not be too close from the underbrace. All this is illustrated with the following code:
\begin{align*}
& \sqrt{\smash[b]{{\underbrace{B + C + D}_{=A}}}}\qquad \sqrt{B + C + D}\\[4ex]
& \sqrt{B}\qquad \sqrt{\mskip-6mu \smash[b]{{\underbrace{B}_{=A}}}\mskip-6mu}
\end{align*}

Moreover, as pointed by @egreg, smashing can cause a problem with vertical spacing with the following text, so one should add, as he did in his answer, a \vphantom of the unsmashed square root, hence the creation of macro in order to make typing less painful — and the code clearer.
\sqrt symbol sure looks bigger than it needs to be with just the B (without the underbrace).
– Peter Grill
May 08 '14 at 17:53
\vphantom.
– Bernard
May 08 '14 at 18:19
Here is an adaptation of
Typesetting 144...4 with "n times" under the 4's is easy, but what about \sqrt{144...4}?, and note that the size of the \sqrt symbol is not affected by the underbrace:

This does require two runs. First one to determine the locations, and the second to do the drawing.
The \tikzmark is from Adding a large brace next to a body of text.
As this is a tikz solution, all the inherent drawing capabilities are available - shown here is just the color of the brace and the text, but many more options are available.
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
% Tweak these as necessary
\newcommand{\BraceAmplitude}{0.25em}%
\newcommand{\VerticalOffset}{0.4ex}%
\newcommand{\HorizontalOffset}{0.12em}%
\newcommand{\SquareBraceVOffset}{-0.4ex}%
\newcommand*{\InsertUnderBrace}[4][]{%
\begin{tikzpicture}[overlay,remember picture]
\draw [decoration={brace,amplitude=\BraceAmplitude},decorate, thick,draw=blue,text=black,#1]
($(#3)+(\HorizontalOffset,-\VerticalOffset)$) --
($(#2)+(-\HorizontalOffset,-\VerticalOffset)$)
node [below=\VerticalOffset, midway] {#4};
\end{tikzpicture}%
}%
\newcommand*{\InsertUnderSquareBrace}[4][]{%
\begin{tikzpicture}[overlay,remember picture]
\draw [text=black,line width=0.7pt, #1]
($(#3)+(\HorizontalOffset,\VerticalOffset+\SquareBraceVOffset)$) --
($(#3)+(\HorizontalOffset,-\VerticalOffset+\SquareBraceVOffset)$) --
($(#2)+(-\HorizontalOffset,-\VerticalOffset+\SquareBraceVOffset)$)
node [below, midway] {#4} --
($(#2)+(-\HorizontalOffset,\VerticalOffset+\SquareBraceVOffset)$);
\end{tikzpicture}%
}%
\begin{document}
\lipsum[1]
[
\sqrt{\tikzmark{StartBraceA}B\tikzmark{EndBraceA},}
\hspace*{4.0em}
\sqrt{\tikzmark{StartBraceB}B\tikzmark{EndBraceB},}
]
\InsertUnderBrace[draw=red,text=blue]{StartBraceA}{EndBraceA}{$=A$}
\InsertUnderSquareBrace[draw=red,text=blue]{StartBraceB}{EndBraceB}{$=A$}
\lipsum[2]
\end{document}
\documentclass{...}and ending with\end{document}. – May 08 '14 at 17:22\sqrt{\vphantom{B}\smash{\underbrace{=A}{B}}}. – Werner May 08 '14 at 17:30@Hupfter obviously not relevant!
– Noix07 May 08 '14 at 17:52