00:01
To find the best uniform approximation to fx is equal to sin 2x in the interval 0 to 2 pi by polynomials of degree at most 2, we can use the method of least squares.
00:19
We want to find a polynomial of the form px is equal to a plus bx plus cx square that minimize the uniform distance between px and sin 2x over the interval 0 to 2 pi.
00:35
The uniform distance between the two function fx and gx over an interval a to b is defined as under d is equal to maximum of mod fx minus gx for x in interval a, b.
01:03
In our case we want to minimize the uniform distance between px and sin 2x over 0 to 2 pi.
01:16
This is equivalent to minimizing the maximum absolute difference between the two functions over the interval.
01:37
Let's set up the least square problem by considering the error function e.
01:47
E is equal to maximum px minus sin 2x for x in interval 0 to 2 pi.
02:03
To minimize e we need to find the coefficients a, b, c that minimize the maximum absolute difference.
02:15
This can be done by solving the optimizing problem.
02:22
Minimize e is equal to maximum px minus sin 2x for x in 0 to 2 pi...