Huge white space in fraction [duplicate]

I'm trying to create an equation in LaTeX, however, there seems to be a gigantic white space that is rather unsightly. Here's the code I'm using:

$x=a\sqrt[n]{1-\left(\dfrac{\sqrt[n]{\dfrac{\sqrt[2-n]{\left(\dfrac{a} {b}\right)^{2n}}}{\dfrac{1}{a^n}+\dfrac{1}{b^n}\left(\sqrt[2-n] {\left(\dfrac{a}{b}\right)^{2n}}\right)}}}{b}\right)^n}$


Is there a way to shorten the braces and root so that they look somewhat closer to this?

• The short answer is that it is the parentheses that are the problem, not the fraction per se: For TeX likes to make parenteses symmetrical about the math axis, which in this case is the main fraction bar. (I think I saw an answer to a related question recently that dealt with this. I'll see if I can manage to find it again …) Oct 24, 2018 at 18:43
• Ah, found it. This answer deals with a somewhat similar problem. You might have a look and see if you can adapt it to your situation. (Or if not, perhaps someone else reading this can step in and help out.) Oct 24, 2018 at 18:53
• moving the parenthesis of the math axis makes rather ugly output, can you not use \left(\frac{1}{b}\sqrt{.....}\right) Oct 24, 2018 at 20:18

I'm not sure such a horrible formula can help the reader.

Anyway it's possible to make it less ugly without guessing dimensions. I added a two-story version, anyhow.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\sbox0{\displaystyle \dfrac{ \sqrt[n]{ \dfrac{ \sqrt[2-n]{\left(\dfrac{a}{b}\right)^{2n}} }{ \dfrac{1}{a^n}+ \dfrac{1}{b^n}\sqrt[2-n]{\left(\dfrac{a}{b}\right)^{2n}} } } }{b} } % x=a\sqrt[n]{ 1- \raisebox{\dimexpr\depth-3\fontdimen22\textfont2}{ \left(\begin{gathered}\usebox{0}\end{gathered}\:\right)^n } }$

$x=a \left(1- \left( \dfrac{1}{b} \sqrt[n]{ \dfrac{ (a/b)^{2n/(2-n)} }{ a^{-n}+b^{-n}(a/b)^{2n/(2-n)} } }\, \right)^{\!\!n}\; \right)^{\!\!1/n}$

\end{document}


I propose this hack, found with trial and error:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

$\raisebox{-4.25ex}{ x=a }\sqrt[n]{\raisebox{-4.25ex}{ 1- {}}\begin{pmatrix}\dfrac{\sqrt[n]{\dfrac{\sqrt[2-n]{\left(\dfrac{a} {b}\right)^{2n}}}{\dfrac{1}{a^n}+\dfrac{1}{b^n}\left(\sqrt[2-n] {\left(\dfrac{a}{b}\right)^{2n}}\right)}}}{\begin{matrix}b \\ \mbox{}\end{matrix}}\end{pmatrix}^n}$

\end{document}