You have already gotten ideas on how to get around it, so let me just elaborate a bit. (This is too long for being a comment.)
This is a nice example where several things coincide.
- The radical come in some different sizes, so there has to be discrete jumps as the content grows.
- The i and the t have slightly different heights. This makes the superscript 2 on the
sin
sit a bit higher than that on the tan
, which in turn sits slighly higher than the one of cos
.
- The effect curiously goes away when the + is removed. I first thought that might be because of the depth of the +, but surprisingly enough it remains if the plus is changed into a minus (that does not have a large depth!). I have no good explanation of that.
- The result differs (in the
tan
part) depending on if amsmath
is loaded or not. I do not know why.
- One could argue (as barbara does in a comment to the other answer) that the square on the b should be at least as high as that on the
sin
, and this is where things start to get interesting. What happens here is that superscripts are done differently depending on if they sit on a character or on some construction. The code path is simply different. To overemphasize this, here are two big squared squares (haha!)
The left square acts as a character, and that puts the 2 on a certain fixed height. The second does not act as a character, and so the 2 is located accordingly. The first model is for characters, the second for large parentheses and such things.
Accidentaly, I got to discuss this with Hans Hagen, and since we are discussing math a lot these days we got curious. It took us a while to get what exactly was the cause of the issue, but once we got it, the fix was pretty close thanks to the opening up of atom classes. We have a specific atom class for functions, and from today there is (in luametatex) a class option single
that tells the atom to behave like a single glyph in this sense. So the two black squares above were set with
$\mathatom single class \mathordinarycode {\vrule height 1cm depth 0pt width 1cm}^2$ \quad
$\mathatom class \mathordinarycode {\vrule height 1cm depth 0pt width 1cm}^2$
At the same time, this new option single
was also added to the specific construction where math functions are defined. This means that when we now type
$\frac{ \sqrt{ a^2 + 4b^2 \sin^2 \alpha} }{2}$\quad
$\frac{ \sqrt{ a^2 + 4b^2 \cos^2 \alpha} }{2}$\quad
$\frac{ \sqrt{ a^2 + 4b^2 \tan^2 \alpha} }{2}$
we get in ConTeXt (in the next release)

=
before the 2amsmath
it seems that the threshold is different, and the radical for tan is also bigger. Maybe some parameter is set differently inamsmath
.\smash
is your friend.