Approximating $\cos\left(\frac{\pi x}{2}\right)$ with $k\sqrt{1-x^2}$.

69 Views Asked by At

I was just messing around on Desmos and wondered how well of an approximation $k\sqrt{1-x^2}$ could be for $\cos\left(\frac{\pi x}{2}\right)$ within the interval $[-1,1]$. That is, what is the smallest value of $d$ such that the absolute difference between both functions is always less than or equal to $d$.

More specifically, (if I'm not wrong) I am trying to find a recursive formula for the value of $$ \inf \left\{ d \in \mathbb{R} \left| \exists k \ \forall x \in [-1,1] , \ \left|k\sqrt{1-x^2} - \cos\left(\frac{\pi x}{2}\right)\right|\leq d \right.\right\}. $$

graph of cos(pi x/2), k sqrt(1-x^2) and their absolute difference

I understand (visually) that making the three 'bumps' have equal heights will minimise $d$. We can start with an initial guess for $k$ to be $k_0 = 0.8$ However, when the value of $k$ changes, the stationary point also changes. I know that once you find the best $k$ you can immediately get $d$, but how do you find the best $k$? Here is my try, but I am stuck:

Let $$ f(x) = k\sqrt{1-x^2} - \cos\left(\frac{\pi x}{2}\right).$$ $|f(0)| = |1-k|$ gives the value of $d$ for the correct of $k$ (when bumps are equal).

Solving (maybe with newton's method) for $$ f'(x) = \frac{\pi}{2}\sin\left(\frac{\pi x}{2}\right) - \frac{kx}{\sqrt{1-x^2}} = 0 $$ will give the coordinates of the stationary point of the other bumps, BUT it relies on $k$... So how do you find better values of $k$ to make the bumps have equal heights? $$ $$

1

There are 1 best solutions below

0
On BEST ANSWER

You're just a step away. The optimal system is $f(x,k)=−f(0,k)$, $f_x'(x,k)=0$, that is $$k=\frac{1+\cos\frac{\pi x}{2}}{1+\sqrt{1−x^2}}=\frac{\pi\sqrt{1−x^2}}{2x}\sin\frac{\pi x}{2}$$ with solutions $x\approx 0.8870023147951932$, $k\approx 0.8048939688678884$.