19
$\begingroup$

Please comment on whether the following approximation is well known

$$\cos\frac23x \approx \frac12(1 + \cos x)$$

in the first quadrant, with a maximum error of $0.016$.

fig

$\endgroup$
9
  • $\begingroup$ @Jean Marie Please see edited question with plots $\endgroup$ Commented Jul 27, 2023 at 21:26
  • 1
    $\begingroup$ No, it isn't a known approximation. I thought at first that the explanation was to be found on the side of Fourier series but this doesn't appear to be the case... $\endgroup$
    – Jean Marie
    Commented Jul 27, 2023 at 21:38
  • 4
    $\begingroup$ If you look at the series expansion, $\cos\left(\frac 23 x \right) \approx 1 - \frac 29 x^2$ and $\frac 12 (1 + \cos x) \approx 1 - \frac 14 x^2$ . You can make lots of approximations like this by adjusting the constants. $\endgroup$
    – DanielV
    Commented Jul 27, 2023 at 21:51
  • $\begingroup$ I wonder if there's a nice geometric argument to support this? $\endgroup$ Commented Jul 27, 2023 at 22:01
  • 2
    $\begingroup$ @Chris Lewis Nice geometric interpretation: using this formula, you can (approximately) trisect an acute angle! $\endgroup$ Commented Jul 28, 2023 at 13:38

5 Answers 5

10
$\begingroup$

Suppose that you look for the best $a$ such that $\cos(ax)$ is as close as possible to $\frac{1}{2} (1+\cos (x))$.

Consider the norm $$\Phi(a)=\int_0^{\frac \pi 2} \left(\cos(ax)-\frac{1}{2} (1+\cos (x)) \right)^2\,dx$$ which is $$\Phi(a)=\frac{1}{4} \left(\frac{4 \cos \left(\frac{\pi a}{2}\right)}{a^2-1}+\frac{\sin (\pi a)-4 \sin \left(\frac{\pi a}{2}\right)}{a}+\frac{7 \pi }{4}+2\right)$$ Computing the derivative, we then need to solve for $a$ the equation $$\left(a^2-1\right) \left(\pi a \left(a^2-1\right) \cos (\pi a)-2 \sin \left(\frac{\pi a}{2}\right) \left((\pi -2) a^2+\left(a^2-1\right) \cos \left(\frac{\pi a}{2}\right)+2\right)\right)-2 a \left(\pi a^4-2 (\pi -2) a^2+\pi \right) \cos \left(\frac{\pi a}{2}\right)=0$$ Using any root-finder, the solution is $a=0.6797$.

Considering $\Phi_{\text{min}}=5.59\times 10^{-5}$ while, for $a=\frac 23$, $\Phi=\frac{35 \pi-32-45 \sqrt{3}}{80}=1.68\times 10^{-4} $ which is only three times larger.

Using simple numbers $$\cos \left(\frac{17 }{25}x\right)\approx \frac{1}{2} (1+\cos (x))$$

If you want to minimize the maximum error, consider the less pleasant norm $$\Psi(a)=\int_0^{\frac{\pi }{2}} \left| \cos (a x)-\frac{1}{2} (1+\cos (x))\right| \, dx$$ which is minimum for $a \sim 0.6834$ (maximum error of $0.0073$).

To summarize : "congratulations for your approximation !"

$\endgroup$
4
  • $\begingroup$ This is interesting, however it's unclear to me why the $1$-norm should minimize the maximum error, rather than the natural choice of the $\infty$-norm. $\endgroup$ Commented Jul 28, 2023 at 7:55
  • $\begingroup$ Or you could just say "best" means the $x^2$ coefficients match viz. $a=1/\sqrt{2}$. $\endgroup$
    – J.G.
    Commented Jul 28, 2023 at 8:01
  • $\begingroup$ @J.G. Actually, in terms of sup norm on $[0,\pi/2]$, $\cos(x/\sqrt2)$ is a worse approximation of $\frac{1+\cos x}2$ than $\cos(2x/3)$, because $$\sup_{0\le x\le \pi/2}\left\lvert\cos\frac x{\sqrt2}-\frac{1+\cos x}2\right\rvert\approx 0.056\\ \sup_{0\le x\le \pi/2}\left\lvert\cos\frac {2x}3-\frac{1+\cos x}2\right\rvert\approx 0.016$$ wolframalpha.com/… $\endgroup$ Commented Jul 28, 2023 at 10:39
  • $\begingroup$ @SassatelliGiulio Agreed: there are all sorts of definitions of what makes one $a$ better than another. One could, for example, seek to minimize the supremum, arithmetic mean etc. of the $L^p$ norm for any $p$. $\endgroup$
    – J.G.
    Commented Jul 28, 2023 at 12:23
10
$\begingroup$

Here is a graphical representation that can be considered as a "Proof without words" ; strictly speaking, it isn't a proof of equality but a way to see the "plausability" of the good approximation :

enter image description here


(Added by @Blue)

enter image description here

I've animated @JeanMarie's visualization to show that OP's construction always puts the "upper trisection point" of the blue arc almost onto the perpendicular bisector of the red segment. (We get exactness when the blue arc has measure $90^\circ$ or $0^\circ$.)

If we were to reflect the blue arc in the horizontal radius, the red segment would be the sagitta of the doubled arc, so one might call this construction "approximate arc trisection via sagitta bisection".

$\endgroup$
7
  • 1
    $\begingroup$ +1. ... It's always been awfully convenient that (in the case of $x=\pi/2$ of your diagram) the "upper trisection point" of the right angle lies on the perpendicular bisector of the (horizontal) radius. Your visualization shows that OP's approximation roughly extends this convenience to arbitrary acute angles, using the perpendicular bisector of an appropriate sub-segment of the radius. ... This makes me wonder if the construction is "known" somewhere as a not-unreasonable strategy for approximating trisectors (and/or whether someone has erroneously claimed that the trisection is exact). $\endgroup$
    – Blue
    Commented Jul 28, 2023 at 20:21
  • $\begingroup$ @Blue I hadn't thought to angle trisection... $\endgroup$
    – Jean Marie
    Commented Jul 29, 2023 at 4:58
  • 2
    $\begingroup$ I hope you don't mind that I've taken the liberty of adding an animation. :) $\endgroup$
    – Blue
    Commented Jul 29, 2023 at 6:09
  • 2
    $\begingroup$ @Blue Very nice... Thank you very much ! $\endgroup$
    – Jean Marie
    Commented Jul 29, 2023 at 7:11
  • 1
    $\begingroup$ @Blue. Nice contribution ! Thanks $\endgroup$ Commented Jul 29, 2023 at 7:28
9
$\begingroup$

This approximation is a special case of a general approximation formula of the form $$\cos \alpha x \approx A + B \cos x$$ for $x$ in $J := [-\frac{\pi}{2}, \frac{\pi}{2}]$ good for, say, $|\alpha|$ not too much larger than $1$.

Matching values at $x = 0, \pm \frac{\pi}{2}$ gives $A = \cos \frac{\pi \alpha}{2}, B = 1 - \cos \frac{\pi \alpha}{2}$, hence an approximation $$\boxed{\cos \alpha x \approx \cos \frac{\pi \alpha}{2} + \left(1 - \cos \frac{\pi \alpha}{2}\right) \cos x}.$$

(In fact, a short calculus argument shows that (for $|\alpha| \leq 4$) our approxmation is an inequality (on $J$): $$\cos \alpha x \geq \cos \frac{\pi \alpha}{2} + \left(1 - \cos \frac{\pi \alpha}{2}\right) \cos x .$$ Moreover, provided that $|\alpha| < 1$, equality holds in $J$ only at $0, \pm \frac\pi2$.)

Examples

  • Taking $\alpha = \frac{2}{3}$ recovers the identity $$\cos \frac{2}{3} x = \frac{1}{2} \left(1 + \cos x\right)$$ in the question statement, which has a maximum absolute error of $\frac{-46 + 13 \sqrt{13}}{54} \approx \frac{1}{62}$ on $J$. This special case is characterized by $A = B$.

  • Instead taking $\alpha = \frac{1}{2}$, for example, gives $$\cos \frac{x}{2} \approx \frac{1}{\sqrt{2}} + \left(1 - \frac{1}{\sqrt{2}}\right) \cos x,$$ which has a maximum absolute error of $\frac{10 - 7 \sqrt{2}}{8} \approx \frac{1}{80}$ on $J$.

  • Taking $\alpha = \frac{2}{5}$ gives $$\cos \frac{2 x}{5} \approx \frac{\phi}{2} + \left(1 - \frac{\phi}{2}\right) \cos x,$$ where $\phi := \frac{1 + \sqrt{5}}{2}$ is the Golden Ratio, and this approximation has maximum absolute error $\approx \frac{1}{110}$ on $J$.

For $\alpha \approx 0$, $\cos \alpha x \approx 1 - \frac{1}{2} \alpha^2 x^2$, so the error in the original approximation is maximized near $\pm x_0$, where $x_0 \approx 1.09882$ is the unique solution of $8 x = \pi^2 \sin x$ in $(0, \frac{\pi}{2})$, and the maximum absolute error is $O(\alpha^2)$.

$\endgroup$
2
  • 2
    $\begingroup$ Once more, you have been inspiring me. Thanks & cheers $\endgroup$ Commented Jul 29, 2023 at 5:55
  • $\begingroup$ @ClaudeLeibovici Cheers! $\endgroup$ Commented Jul 29, 2023 at 13:07
5
$\begingroup$

I prefer to add a separate answer since this one is more than much inspired by @Travis Willse's answer.

If we want the best approximation for $$\cos(\alpha x) \approx A + B \cos( x)$$ consider again the infinite norm $$\Phi(\alpha,A,B)=\int_0^{\frac \pi 2}\Big( A + B \cos( x)-\cos(\alpha x) \Big)^2\,dx$$ which is $$\frac{1}{4} \left(\frac{\sin (\pi \alpha )}{\alpha }+2 \pi A^2-\frac{8 A \sin \left(\frac{\pi \alpha }{2}\right)}{\alpha }+8 B \left(\frac{\cos \left(\frac{\pi \alpha }{2}\right)}{\alpha ^2-1}+A\right)+\pi B^2+\pi \right)$$ Computing the partial derivatives, we have $$\frac{\partial \Phi(\alpha,A,B)}{\partial A}=-\frac{2 \sin \left(\frac{\pi \alpha }{2}\right)}{\alpha }+\pi A+2 B$$ $$\frac{\partial \Phi(\alpha,A,B)}{\partial B}=\frac{2 \cos \left(\frac{\pi \alpha }{2}\right)}{\alpha ^2-1}+2 A+\frac{\pi B}{2}$$ Solving $$A=\frac{2 \pi \left(\alpha ^2-1\right) \sin \left(\frac{\pi \alpha }{2}\right)+8 \alpha \cos \left(\frac{\pi \alpha }{2}\right)}{\left(\pi ^2-8\right) \alpha \left(\alpha ^2-1\right)}$$ $$B=\frac{-8 \left(\alpha ^2-1\right) \sin \left(\frac{\pi \alpha }{2}\right)-4 \pi \alpha \cos \left(\frac{\pi \alpha }{2}\right)}{\left(\pi ^2-8\right) \alpha \left(\alpha ^2-1\right)}$$

Computing $$f(x)= A + B \cos( x)-\cos(\alpha x)$$ and assuming $\alpha$ close to $\frac 23$ $$f(0) =\frac{1}{188}-\frac{1}{393}\left(\alpha -\frac{2}{3}\right)+O\left(\left(\alpha -\frac{2}{3}\right)^2\right)$$ $$f\left(\frac{\pi }{2}\right)=\frac{2}{137}+\frac{1}{163}\left(\alpha -\frac{2}{3}\right)+O\left(\left(\alpha -\frac{2}{3}\right)^2\right)$$ $$\Phi(.)=\frac{1}{27087}-\frac{1}{30047}\left(\alpha -\frac{2}{3}\right)+O\left(\left(\alpha -\frac{2}{3}\right)^2\right)$$

None of these values can be very large.

So, for any value of $\alpha$, we have the corresponding $A$ and $B$.

For example, if $ \alpha=\frac 23$ $$ A=\frac{3 \left(5 \sqrt{3} \pi -24\right)}{10 \left(\pi^2-8\right)}=0.514599\qquad B=\frac{6 \left(3 \pi -5 \sqrt{3}\right)}{5 \left(\pi ^2-8\right)}=0.490707$$ For these values $$\Phi(.)=\frac{3 \sqrt{3}}{16}+\frac{\pi }{4}+\frac{27 \left(80 \sqrt{3}-49 \pi \right)}{200 \left(\pi ^2-8\right)}=3.69\times 10^{-5}$$ which is not much better than your $1.68\times 10^{-4}$

If, as in your post, you want $A=B$ regardless of their values, $$\alpha=0.675440 \sim \frac{25}{37}=\frac 23+\frac{1}{111} \quad \implies \quad A=B\sim \frac{69}{137}=\frac 12+\frac{1}{274} $$

Now, if we want the best combination, we need to solve for $\alpha$ the equation $$\frac{\partial \Phi(\alpha,A,B)}{\partial \alpha}=0$$ which is too long to type here but which does not make any problem. The solution is $$\alpha=0.697144\sim \frac 23+\frac 1{32}$$ which, in turn, gives $$A\sim \frac 12-\frac 1{36}\quad\quad \text{and}\quad\quad B\sim \frac 12+\frac 1{30}$$

$\endgroup$
0
$\begingroup$

By using Maclaurin series $$\cos(\frac{2}{3}\arccos x)=\frac12+\frac1{\sqrt3}x-\frac19 x^2+\frac{5}{54\sqrt3}x^3...$$ we have $$\cos\frac23 x\approx\frac12+\frac1a\cos x\left(\frac a{\sqrt3}-\frac a9\cos x \right).$$ Minimizing $|| \frac a{\sqrt3}-\frac a9\cos x-1||_2$ we get $a=\frac{108\sqrt3\pi-72}{110\pi-48\sqrt3}\approx 1.9649.$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .