i have an assignement in which the whole point was to approximate $\cos$ function using 2 methods :

  1. Using series expansion
  2. using a more algebric method with a linear system

The teacher also defined 2 way of estimating errors in the approximation : be $f$ a function defined on [a,b] and $P(x)$ the polynom approaching $f$

the maximal error rate is : $e_{max} = \max |f(x) - P(x)|$

we also have $e_{avg}$ which uses integrals but she's not relevant in this part of the problem. The system is defined as follows $$\begin{eqnarray} ax_{1}^{2}+bx_{1}^{2} + c &=& \cos x_{1} \\ ax_{2}^{2}+bx_{2}^{2} + c &=& \cos x_{2} \\ ax_{3}^{2}+bx_{3}^{2} + c &=& \cos x_{3} \end{eqnarray}$$ with $ I = [0,\frac{\pi}{2}]$ and $x_1,x_2,x_3 \in I $

All the questions were asked to be solved with $x_1 = 0, x_2 = \frac{\pi}{3}$ and $x_3 = \frac{\pi}{2}$ so the values of $\cos x$ are simple.

I managed to get to the last 2 questions which asks me the method to choose the $x_1,x_2,x_3$ so that the function approximation is more precise and to give him a polynomial approximation with $e_{max} < 0.002$

the teacher recommends us to use maxima and gnu plot to find them. the most "evident" way seems to loop through the values in $I$ with a 0.001 incrementation and test them but maybe i can use a dichotomic search-like approach ?

if anyone could confirm my instincts or give me search leads i'd be really grateful

thank you by advance and i'm sorry if my post is a little messy

  • $\begingroup$ I don't understand the role of $b$ $\endgroup$ – Damien Dec 3 '18 at 8:59
  • $\begingroup$ Please have a look at Remez algorithm $\endgroup$ – Damien Dec 3 '18 at 9:08

So far I understand, you know how to solve for $a, b, c$ and how to get the values of $e_{\rm max}$. My suggestion is to keep $x_1 = 0$, $x_3 = \pi/2$ and let $x_2$ change. For each $x_2$ calculate $e_{\rm max}$ and make a plot of the results, this is what you should get

enter image description here

  • $\begingroup$ Perfect, i didn't think of letting x1 and x3 and just change x2 thank you very much $\endgroup$ – Edo Youss Dec 3 '18 at 9:17
  • $\begingroup$ i'm sorry i'm asking you another question,how did you compute this e_{max} because i tried in python and in maple and i couldn't get it like you did $\endgroup$ – Edo Youss Dec 6 '18 at 18:12
  • $\begingroup$ @EdoYouss Sorry, I was making a very dumb mistake. Do your results agree now? $\endgroup$ – caverac Dec 6 '18 at 23:43
  • $\begingroup$ Yeah, this is more like it thank you very much for your edit $\endgroup$ – Edo Youss Dec 6 '18 at 23:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.