# Why does this square root simplify so much?

I was messing about with a dot product, trying to simplify an expression, when I came across this equality by graphing. Why would these expressions be equal?

$$\cos(2x)+r^2=\sqrt{r^4+\frac{r^2h^2}{2}\cos(2x)+\frac{h^4}{16}}$$

I noticed that:

$$r^4+\frac{r^2h^2}{2}+\frac{h^4}{16}=(r^2+\frac{h^2}{4})^2$$

But the $$\cos(2x)$$ in there really makes it tough. Also, somehow the $$h$$ factors out completely? Very strange! Hope somebody can figure it out!

Edit: Oops! I happened to only be looking at the function for situations where r >> h. When this isn't true, the equations becomes obviously different. The square rooted equation seemed so close to simplifying though :(

For fixed $$r,x$$, the left hand side is constant, but the right hand side varies monotonically with $$h$$. So the equality cannot hold. To illustrate the point further, for very large $$h$$, the RHS is large, $$\sim \frac{h^2}4$$, whereas the LHS doesn't change.
By squaring both sides, we see that your claimed equality implies $$\cos^22x + 2r^2\cos 2x+r^4=r^4+\frac{r^2h^2}2\cos2x+\frac{h^4}{16}$$ or equivalently $$\cos^22x+r^2\left(2-\frac{h^2}2\right)\cos 2x-\frac{h^4}{16}=0.$$ In general, this will be false (just plug in $$x=\frac\pi4$$ and $$h\ne0$$).
Suppose this equation does hold for all $$h$$. Then for $$h=0$$, the equation reduces to $$\cos(2x)=0$$. So the overall equation reduces to $$r^2=\sqrt{r^4+h^4/16}> r^2$$ for general $$h$$. So your equation doesn't hold.