# Chebyshev approximation - from any equation

So let's say I have a function:

$$f(x) = {e^x}$$

How do I use Chebyshev polynomials up to order 4, to find the corresponding coefficients? how do I make an approximation equation using these 4 coefficients?

I am sorry if this question is basic part, I just don't know how Chebyshev works and how to use it.

I have done taylor/maclaurin expansion before but i cant find any simple material to follow for chebyshev to get an answer.

Hint

To make it simple, remember that Chebyshev polynomials are just ... polynomials $$T_0=1 \qquad T_1=x \qquad T_2=-1+2x^2 \qquad T_3=-3x+4x^3 \qquad T_4=1-8x^2+8x^4$$ So, write $$e^x=\sum_{i=0}^4 a_i Ti$$ Replace the lhs by the usual Taylor expansion and identify the $$a_i$$.

• I think usually people are using Chebyshev polynomials for Chebyshev interpolation, in other words they shift/scale their interval to be $[-1,1]$ and then interpolate at the Chebyshev nodes. – Ian Oct 27 '19 at 4:07
• @Ian. For sure I totally agree with you (what else could I do ?). But the question was such that I proposed this (almost stupid) answer. – Claude Leibovici Oct 27 '19 at 4:12
• Claude, @Ian what do you mean by lhs? ai is the same coeffiecents as the taylor expansion? ive seen different formulas for ai but havent seen taylor expansion coefficents in chebyshev. can you send me the link for this pls? – Questions Oct 27 '19 at 16:34
• @Questions If you were to reconstruct the Taylor polynomial in the Chebyshev basis, you would do what Claude suggested in this answer. But as I said more commonly people use Chebyshev polynomials for interpolation at the Chebyshev nodes. – Ian Oct 27 '19 at 16:49
• i mean the questions asked chebyshev? and i will be comparing this to taylor as part of the next question. i dont know what 'Taylor polynomial in the Chebyshev basis' means. but i simply want to know how to express e^x as a chebyshev series. – Questions Oct 27 '19 at 17:03

how do I make an approximation equation

The way to go is Remez' Algorithm. It starts with an (informed) guess where the maxima of the error (in terms of the maximum norm $$\|\cdot\|_\infty$$) are located, and from there solve a linear system in $$n+2$$ variables for an approx of order $$n$$. One variable is the "expected max error", and $$n+1$$ variables are the coefficients of a polynomial of degree $$n$$. Then iterate that.

The result will depend on the interval over which the function is to be approxed, of course.

Specifically in your case of $$e^x$$ and an approximation of order 4, the results would be something like

$$p_{[-1,1]}(x) = 1.00009 + 0.997309252 x + 0.49883511 x^2 + 0.177345274 x^3 + 0.0441555176 x^4$$

$$p_{[0,1]}(x) = 1.000027162 + 0.9986854006 x + 0.5101394602 x^2 + 0.1396981485 x^3 + 0.06970449423 x^4$$

with absolute errors $$5.46668\cdot10^{-4}$$ resp. $$2.71624\cdot10^{-5}$$ for approximations over the intervals $$[-1,1]$$ and $$[0,1]$$, respectively.

For minimal relative errors however, the results will be

$$q_{[-1,1]}(x) = 0.999627896 + 0.997938729 x + 0.502898651 x^2 + 0.176486232 x^3 + 0.0399629142 x^{4}$$

$$q_{[0,1]}(x) = 1.000016135 + 0.9990684905 x + 0.5081199094 x^2 + 0.1430489414 x^3 + 0.06798449148 x^4$$

with relative errors $$5.03041\cdot10^{-4}$$ and $$1.61353\cdot10^{-5}$$, respectively.

Notice that expressing the Taylor series in terms of Chebyshev polynomials $$T_n$$ will get you nowhere: That's just a change of basis, and all you get is that the resulting expressions will be harder to evaluate.