Quartic Approximation of f(x) using Chebyshev & Legendre Polynomials

In summary, the author attempted to find a quartic approximation to the function f(x) using different polynomial methods, but the results were not consistent.
  • #1
squenshl
479
4

Homework Statement


Let f(x) = cos(pi*x), 0 < x < 1. Find a quartic approximation to f(x):
By solving the continuous least squares problem using Chebyshev polynomials.
By solving the continuous least squares problem using Legendre polynomials.

Homework Equations


The Attempt at a Solution


For Chebyshev polynomials the interval is [-1,1] but my interval is [0,1]. How do I convert [0,1] to [-1,1] (or the other way around) and where do I go from there.
 
Physics news on Phys.org
  • #2
One thought is to do a change of variables. Change the variable in sin(2 pi x) so its some variable v that goes from -1 to 1. Write the Chebyshev polynomials with the variable v.

Are the Chebyshev polynomials orthogonal "unit vectors"? If so then you just take the inner product of sin(...) on each to get the coefficient. That would be the integral of the product of sin(...) with the polynomial from -1 to 1.

When you get the answer, you revert everything so it is in terms of x instead of u.

I haven't done the problem. This is just my guess.
 
  • #3
Got it. Just used a simple change of variables.
Got f(x) = 19.4073x3 - 29.1109x2 + 8.48488x + 0.609377 using Chebyshev polynimials and got f(x) = 4.498x3 - 6.747x2 + 0.267x + 0.991 using Legendre polynomials.
 
  • #4
it was quartic.. so shud be till power of 4, isn't?
 
  • #5
The 4th coefficient is 0
 
  • #6
squenshl said:
Got it. Just used a simple change of variables.
Got f(x) = 19.4073x3 - 29.1109x2 + 8.48488x + 0.609377 using Chebyshev polynimials and got f(x) = 4.498x3 - 6.747x2 + 0.267x + 0.991 using Legendre polynomials.

I don't think you have the correct answer, first we need to change T(x), second your summation perhaps incorrect.
 
  • #7
Which one is not correct?
 
  • #8
squenshl said:
Which one is not correct?

Both of them, the coefficients appear too large and the polynomials should be up to x^4.
 
Last edited:
  • #9
I got c0 = -0.269628, c1 = -0.654197, c2 = -0.198127, c3 = 0.167396 and c4 = -0.0184982 for the Chebyshev polynomials
 
  • #10
For the Chebyshev polynomials I get -1.88921 x^4+8.0662 x^3-10.0579 x^2+3.1049 x+0.063017 and when I plot the f(x) using Legendre polynomials it looks almost the same as cos (pi*x) on [0,1] (using wolframalpha.com).
 
  • #11
primens123 said:
I don't think you have the correct answer, first we need to change T(x), second your summation perhaps incorrect.

Is the T(x)=cos(nx)
or T(x)=2nx-1?
 
  • #12
I am pretty sure I am correct.
 
  • #13
squenshl said:
I got c0 = -0.269628, c1 = -0.654197, c2 = -0.198127, c3 = 0.167396 and c4 = -0.0184982 for the Chebyshev polynomials

squenshl - I get a different result for the Chebyshev coefficients. After letting [itex]u = 2*x -1[/itex] (so [itex]-1 <= u <= 1 [/itex]), I get:

[tex]c_0 = 0 [/tex]
[tex]c_1 = -2 \cdot J_1(\pi/2) = -1.133648178... [/tex]
[tex]c_2 = 0 [/tex]
[tex]c_3 = 2 \cdot J_3(\pi/2) = 0.138071777... [/tex]
[tex]c_4 = 0 [/tex]

Here, [itex]J_k(\pi/2)[/itex] are the Bessel Functions of first kind, order [itex]k[/itex], evaluated at [itex]\pi/2[/itex].

The resulting Chebyshev approximation polynomial (for a fourth order approx) would be:

[tex] f(T(u)) = c_1 \cdot T_1(u) + c_3 \cdot T_3(u) [/tex]

The coefficients for the polynomial in u would then be:
[tex]b_1 = c_1-3 \cdot c_3 = -1.547863508... [/tex]
[tex]b_3 = 4 \cdot c_3 = 0.552287106... [/tex]

and the coefficients for the polynomial in x would then be:
[tex]a_0 = -(b_3 + b_1) = 0.995576401... [/tex]
[tex]a_1 = 6 \cdot b_3 + 2 \cdot b_1 = 0.217995623...[/tex]
[tex]a_2 = -12 \cdot b_3 = -6.627445276... [/tex]
[tex]a_3 = 8 \cdot b_3 = 4.418296851... [/tex]
[tex]a_4 = 0[/tex]

To have a fourth term in the polynomial of x, we would require another term (T5) in the Chebyshev expansion, which would also introduc a quintic x term.

I can provide more on this later.
 
  • #14
Thanks a lot.
Could you please check my Legendre polynomial question if it is correct?
 
  • #15
squenshl said:
Thanks a lot.
Could you please check my Legendre polynomial question if it is correct?

Your polynomial coefficients from the Legendre analysis are in agreement with mine.
 
  • #16
As for the Chebyshev polynomials question, I have never studied Bessel functions before so I just did same method as for the Legendre polynomials.
 
  • #17
squenshl said:
As for the Chebyshev polynomials question, I have never studied Bessel functions before so I just did same method as for the Legendre polynomials.

Well, what was that method? You should have some integrals to evaluate. You don't need to know about Bessel functions if you numerically evaluated the integrals.
 

1. What is a quartic approximation?

A quartic approximation is a mathematical technique used to approximate a function of the form f(x) using a polynomial of degree 4. This allows for easier evaluation and analysis of the function.

2. What are Chebyshev and Legendre polynomials?

Chebyshev and Legendre polynomials are two types of orthogonal polynomials commonly used in mathematical approximations. Chebyshev polynomials have a specific recurrence relation, while Legendre polynomials are solutions to the Legendre differential equation.

3. How are Chebyshev and Legendre polynomials used in quartic approximation?

Chebyshev and Legendre polynomials are used as basis functions in the quartic approximation of a function. The coefficients of these polynomials are determined through a least squares fit to the function being approximated.

4. What are the advantages of using Chebyshev and Legendre polynomials in quartic approximation?

One advantage is that these polynomials are orthogonal, meaning they are perpendicular to each other. This allows for a more accurate approximation of the function. Additionally, these polynomials have advantageous properties, such as being well-behaved and having fast convergence rates.

5. Are there any limitations to using quartic approximation with Chebyshev and Legendre polynomials?

Yes, there are some limitations. Quartic approximation may not be suitable for functions with singularities or discontinuities. Additionally, the accuracy of the approximation may decrease as the degree of the polynomial increases, so it is important to choose an appropriate degree for the function being approximated.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
888
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
163
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
698
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
633
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
Back
Top