0% found this document useful (0 votes)
53 views6 pages

Orthogonal Polynomials Extra Problems

The document discusses solving problems related to orthogonal least squares approximations. It includes finding polynomial approximations for given functions over specified ranges, deriving Legendre and Chebyshev polynomials, approximating functions using orthogonal polynomials, and evaluating polynomials at given points.

Uploaded by

Mahmoud El-Mahdy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views6 pages

Orthogonal Polynomials Extra Problems

The document discusses solving problems related to orthogonal least squares approximations. It includes finding polynomial approximations for given functions over specified ranges, deriving Legendre and Chebyshev polynomials, approximating functions using orthogonal polynomials, and evaluating polynomials at given points.

Uploaded by

Mahmoud El-Mahdy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Orthogonal Least Squares: Revision Problems

Problems
Problem 1
Given the function f (x) = log(x + 2). Find a polynomial approximation for this function in the range x e [1, 2] of order 3.
Estimate the maximal error made in your calculations if you replace f (x) by p
3
(x). Use for the maximum estimation the formula
max
asxsb
( f (x) p
3
(x)) s
ba
n+1
(n+1)!
max
asxsb
f
n+1
(x) .
Compare this error with the integral error
2
=
]
1
2
( f (x) p
3
(x))
2
d x.
Problem 2
Derive the first 6 Legendre polynomials, P
0
(x), P
1
(x), P
2
(x), P
3
(x), P
4
(x), P
5
(x), using the recurrence formula given in the
lecture. Start with P
0
(x) = 1 and P
1
(x) = x. Show that the polynomials are orthogonal.
Problem 3
Give a graphical representation of the first three Chebyshev polynomials T
n
(x), where n = 0, 1, 2.
Problem 4
Approximate f (x) =
1
1x
2
on the interval [-1,1] by a polynomial of degree 2, using the least square method with orthogonal
polynomials.
Problem 5
Find a second degree polynomial for f (x) = :
(x1)
2
on [-1,1], using weighted least square approximation with
w(x) = 1 1 x
2
. Choose the appropriate orthogonal ploynomials.
Problem 6
a) Find the sum of the first 5 Laguerre polynomials defined by the recursion
b) Evaluate the resulting polynomial at x = 2.5 using Horners rule symbolically and in tabular form. Show all your steps in detail.
Solutions
Problem 1
f (x) = log(x + 2), x e [1,2]. Then f (x) is approximately equal to P
3
(x) = a
0
+ a
1
x + a
2
x
2
+ a
3
x
3
. Try to solve it on your own,
this problem is exactly like Problem 15 in Classwork 003.
Problem 2
You are given the first 2 Legendre polynomials, use them in the recurrence formula to get the other ones needed. The recurrence
formula given in the lecture is
and the first 6 polynomials are
Problem 3
Plot]]1, x, 2 x
2
1), {x, 1.5, 1.5}
1.5 1.0 0.5 0.5 1.0 1.5
1
1
2
3
Problem 4
2 Orthogonal_Polynomials_extra_problems.nb
Problem 4
We have the following function
(0.1) f (x) =
1
1 x
2
and we need to get a 2
nd
degree polynomial that approximates it on the interval [-1, 1]. The weighting function is not given, so we
assume it to be w(x) = 1. Thus, Legendre's polynomials will be used.
In[8]:= p0 1; p1 x; p2
1
2
[3 x
2
1|; w 1;
Then, the form of the required polynomial is
(0.2) P
2
= a
0
p
0
+ a
1
p
1
+ a
2
p
2
Now, we simply need to find the coeffecients a0, a1 and a2. These are found using the following expression
(0.3) a
i
=
]
a
b
f (x) p
i
(x) w(x) d x
]
a
b
f (x) p
i
(x) w(x) d x
Substituting in this expression with i = 0, we get the first coefficient, a0
In[9]:= a0
]
1
1
f p0 w x
]
1
1
p0 p0 w x
Integrate::idiv : Integral of
1
1x
2
does not converge on 1, 1. >
This is problematic, as it leads to a singularity. Which means that our initial choice of the weighting function was not a good one.
Since our interval is [-1,1], we still have 2 more options to choose from. We can either work with the Chebyshev polynomials of
the first or the second kind. Lets use the second kind which has a the weighting function w(x) = 1 x
2
. Substituting with this
w(x) in equation (0.3) we get the coefficients a
i
.
In[16]:= a0
]
1
1
f p0 w x
]
1
1
p0 p0 w x
Out[16]= 2
Orthogonal_Polynomials_extra_problems.nb 3
In[18]:= a1
]
1
1
f p1 w x
]
1
1
p1 p1 w x
Out[18]= 0
In[19]:= a2
]
1
1
f p2 w x
]
1
1
p2 p2 w x
Out[19]=
16
5
Now that we have the coeffients, we just multiply them by the Chebyshev polynomials of the second kind, given next
In[20]:= U0 1; U1 2 x; U2 4 x
2
1;
In[24]:= P
2
a0 U0 a1 U1 a2 U2 // Expand
Out[24]=
6
5

64 x
2
5
Which is the polynomail we are looking for. This can also be written as P
2
(x) = 1.2 + 12.8 x
2
. Now, to calculate the error, we
use the formula
(0.4) Error
2
=
_
a
b
[ f (x) P
n
(x) ]
2
w(x) d x
Problem 5
We have the following function
(0.5) f (x) = :
(x1)
2
and we need to get a 2
nd
degree polynomial that approximates it on the interval [-1, 1]. The given weighting function is
w(x) = 1 1 x
2
. Thus, Chebyshevs polynomials of the first kind will be used
4 Orthogonal_Polynomials_extra_problems.nb
In[25]:= T0 1; T1 2 x; T2 4 x
2
1; w
1
1 x
2
;
Then, the form of the required polynomial is
(0.6) P
2
= a
0
U
0
+ a
1
U
1
+ a
2
U
2
and the coefficients are
In[28]:= a0
]
1
1
f T0 w x
]
1
1
T0 T0 w x
// N
Out[28]= 12.4721
In[29]:= a1
]
1
1
f T1 w x
]
1
1
T1 T1 w x
// N
Out[29]= 9.69759
In[30]:= a2
]
1
1
f T2 w x
]
1
1
T2 T2 w x
// N
Out[30]= 8.20829
Finally, the polynomial we are looking for is
In[32]:= P
2
a0 T0 a1 T1 a2 T2 // Expand
Out[32]= 4.26379 19.3952 x 32.8332 x
2
Problem 6
Using Laguerres recurrence relation given, we get the first 5 polynomials
Then, we get their sum as
L0 1; L1 1 x; L2
1
2
[x
2
4 x 2|;
L3
1
6
[x
3
9 x
2
18 x 6|; L4
1
24
[x
4
16 x
3
72 x
2
96 x 24|;
P
4
L0 L1 L2 L3 L4 // Expand
5 10 x 5 x
2

5 x
3
6

x
4
24
Now, we use Horners rule as follows
Orthogonal_Polynomials_extra_problems.nb 5
6 Orthogonal_Polynomials_extra_problems.nb

You might also like