Approximation to $\sqrt{\cos(\theta)}$?

208 Views Asked by At

I have this formula, (it is just the law of cosines angle formula):

$$ d = \sqrt{a^2 + b^2 - 2ab \ cos(\theta)} $$

Here is my issue. I am wondering if there is a way to 'extract' the $cos$ term. My motivation here is because I want to show that $d$ is in fact sinusoidal - or perhaps very close to sinusoidal - as $\theta$ is varied, while $a$ and $b$ are fixed.

So, might there be a way to simplify, or 'extract' the $cos$ term here? What is the approximation to $\sqrt{cos(\theta)}$? Thank you.

4

There are 4 best solutions below

2
On

Well, it's rather simple $$d = \sqrt{a^2 + b^2 - 2ab \ cos(\theta)}$$ $$d^2 = a^2 + b^2 - 2ab \ cos(\theta)$$ $$ d^2 - a^2 - b^2=2ab \ cos(\theta)$$ $$ \frac{d^2 - a^2 - b^2}{2ab} = \ cos(\theta)$$ $$ \frac{d^2}{2ab} - \frac{a^2 + b^2}{2ab} = \ cos(\theta)$$ and since $a$ and $b$ are fixed, $k = \frac{a^2 + b^2}{2ab}$ $$ \ cos(\theta) = \frac{d^2}{2ab} -k$$ with $d\leq a+b$ for the triangle inequality.

Finally $\sqrt{cos(\theta)} = \sqrt{\frac{d^2}{2ab} - \frac{a^2 + b^2}{2ab}}$

Anyway, assuming $a=b$ for simplicity, $$d=a\sqrt{2-2\cos(\theta)}=2|sin(\frac{\theta}{2})|$$ and this shows why $d$ is sinusoidal.

Furthermore, let $a=b+k$, then $$d = \sqrt{a^2 + a^2 +2ak+k^2 - 2a(a+k) \ cos(\theta)}$$ $$ d = \sqrt{2a^2-2a^2\cos\theta+2ak-2ak\cos\theta+k^2} $$ $$ d = \sqrt{2a^2(1-\cos\theta)+2ak(1-\cos\theta)+k^2} $$ $$ d = \sqrt{2a^2(2\sin^2(\frac{\theta}{2})+2ak(2\sin^2(\frac{\theta}{2})+k^2} $$ $$ d = \sqrt{4a^2\sin^2(\frac{\theta}{2})+4ak\sin^2(\frac{\theta}{2})+k^2} $$

which does have a sinusoidal pattern, but it's more difficult to unveil when $k \ne 0$

2
On

Sounds like an approach to your problem is to let $a=b$ for simplicity so $$ d = \sqrt{a^2+b^2-2ab \cos x} = a \sqrt{2-2\cos x} $$ and then just plot the function $f(x) = \sqrt{2-2\cos x}$, getting sqrtPlot

which is clearly a wave, but not sure how sinusoidal it is.

It is, however, similar to a similar transformation of the sine, just off by a horizontal translation, it seems. Here is the plot of $\sqrt{2-2\cos x}, \sqrt{2-2\sin x}$ on the same axis:

2xfrms

3
On

If you want to show that $d(\theta)$ is sinusoidal, just compute its derivative which is $$\frac{a b \sin (\theta)}{\sqrt{a^2+b^2-2 a b \cos (\theta)}}$$ and see how the function behaves (maximum, minimum, symmetry, period,..).

0
On

The function that describes the distance of a fixed point from a point travelling on a circle cannot be perfectly "sinusoidal", since it exhibits discontinuities for the derivatives, as shown by @gt6989b, for instance. However we can state that the coefficients of the Fourier cosine series of $$ f(\theta) = \sqrt{1-\lambda \cos\theta}, $$ where we set $\lambda=\frac{2ab}{a^2+b^2}\leq 1$, decay pretty fast, giving good approximations of $f(\theta)$ in terms of even trigonometric polynomials. The coefficient of $\cos(n\theta)$ in the Fourier cosine series of $f(\theta)$ is: $$ c_n = -2\sqrt{\lambda+1}\left(\frac{\lambda}{1+\lambda}\right)^n\cdot\frac{\binom{2n}{n}}{(2n-1)8^n}\cdot\phantom{}_2 F_1\left(\frac{2n-1}{2},\frac{2n+1}{2};2n+1;\frac{2\lambda}{1+\lambda}\right),$$ and the hypergeometric term can be quite trivially bounded by $\left(\frac{1+\lambda}{1-\lambda}\right)^{n/2}$. This gives reasonable bounds when $a$ and $b$ are pretty different, so $\lambda$ is pretty far from $1$. In the opposite case, it is worth considering that: $$g(a,b,\theta)=\sqrt{a^2+b^2-2ab\cos\theta}=\sqrt{(a-b)^2+4ab\sin^2\frac{\theta}{2}}$$ is always between $2\sqrt{ab}\cdot\left|\sin\frac{\theta}{2}\right|$ and $2\sqrt{ab}\cdot\left|\sin\frac{\theta}{2}\right|+\frac{(a-b)^2}{4\sqrt{ab}\cdot\left|\sin\frac{\theta}{2}\right|}$, and we can refine the upper bound by applying the Newton method to the convex function $x^2-\left((a-b)^2+4ab\sin^2\frac{\theta}{2}\right)$ by choosing the previous upper bound as a starting point. For any $\theta$ far enough from $0$ and $2\pi$, this works just nice. For a uniform bound, we can use a continued fraction, since: $$ \sqrt{x^2+\varepsilon^2} = x + \frac{\varepsilon^2}{x+\sqrt{x^2+\varepsilon^2}}=x+\frac{\varepsilon^2}{2x+\frac{\varepsilon^2}{2x+\frac{\varepsilon^2}{\ldots}}}.$$