Question

1 Approximation of functions by polynomials

Let the function f(x) be given by the following:

f(x) = 1/ 1 + x^2

Use polyfit to approximate f(x) by polynomials of degree k = 2, 4, and 6. Plot the approximating polynomials and f(x) on the same plot over an appropriate domain. Also, plot the approximation error for each case. Note that you also will need polyval to evaluate the approximating polynomial.

Submit your code and both plots. Make sure each of these plots is distinguishable and that a legend is included.

Answer #1

**MATLAB
Code:**

close all

clear

clc

x = 0:0.1:10;

y = 1./(1 + x.^2);

p2 = polyfit(x, y, 2);

p4 = polyfit(x, y, 4);

p6 = polyfit(x, y, 6);

plot(x, y, x, polyval(p2, x), x, polyval(p4, x), x, polyval(p6,
x)), xlabel('x')

legend('f(x)', 'Degree 2 Polynomial', 'Degree 4 Polynomial',
'Degree 6 Polynomial')

xlabel('x'), title('Function Plots')

figure, plot(x, abs(y - polyval(p2, x)), x, abs(y - polyval(p4,
x)), x, abs(y - polyval(p6, x)))

legend('Degree 2 Polynomial', 'Degree 4 Polynomial', 'Degree 6
Polynomial')

xlabel('x'), title('Error Plots')

**Plots:**

for the given functions f(x), let x0=1, x1=1.25, x2=1.6.
Construct interpolation polynomials of degree at most one and at
most two to approximate f(1.4), and find the absolute error. a.
f(x)=sin (pi x)

Let
F be a field and let a(x), b(x) be polynomials in F[x]. Let S be
the set of all linear combinations of a(x) and b(x). Let d(x) be
the monic polynomial of smallest degree in S. Prove that d(x)
divides a(x).

Fourier Series Approximation Matlab HW1:
You are given a finite function xt={-1 0≤t≤5; 1
5<t≤10 .
Hand calculate the FS coefficients of x(t) by assuming half-
range expansion, for each case below.
Modify the code below to approximate x(t) by cosine series only
(This is even-half range expansion). Modify the below code and plot
the approximation showing its steps changing by included number of
FS terms in the approximation.
Modify the code below to approximate x(t) by sine...

Let f(x) be a cubic polynomial of the form x^3 +ax^2 +bx+c with
real coefficients.
1. Deduce that either f(x) factors in R[x] as the product of
three degree-one
polynomials, or f(x) factors in R[x] as the product of a
degree-one
polynomial and an irreducible degree-two polynomial.
2.Deduce that either f(x) has three real roots (counting
multiplicities) or
f(x) has one real root and two non-real (complex) roots that are
complex
conjugates of each other.

Curve-Fit Function USING MATLAB
Using the top-down design approach, develop a MATLAB function
A8P2RAlastname.m that reads data from a file and performs
regression analysis using polyfit and polyval. The function shall
have the following features:
The input arguments shall include the file name (string), a
vector of integers for the degrees of polynomial fits to be
determined, and an optional plot type specifier (‘m’ for multiple
plots, ‘s’ for a single plot - default).
The data files will be text...

approximate the function f(x)= 1/sqrt(x) by a taylor polynomial
with degree 2 and center a=4. how accurate is this approximation on
the interval 3.5<x<4.5?

1.
Find the Taylor polynomial, degree 4, T4, about 1/2 for f (x) = tan-inv (x) and use it to approximate tan-inv (1/16).
2.
Find the taylor polynomial, degree 4, S4, about 0 for f (x) = tan-inv (x) and use it to approximate tan-inv (1/16).
3.
who provides the best approximation, S4 or T4? Prove it.

Consider the following function.
f(x) = ln(1 + 2x), a =
1, n = 3, 0.8 ≤ x ≤
1.2
(a) Approximate f by a Taylor polynomial with degree
n at the number a.
T3(x) =
(b) Use Taylor's Inequality to estimate the accuracy of the
approximation
f(x) ≈ Tn(x) when x lies in the given
interval. (Round your answer to six decimal places.)
|R3(x)| ≤
(c) Check your result in part (b) by graphing
|Rn(x)|.

a.)Consider the function f (x) = 3x/ x^2 +1
i) Evaluate f (x+1), and f (x)+1. Explain the difference. Do the
same for f (2x) and 2f (x).
ii) Sketch y = f (x) on the interval [−2, 2].
iii) Solve the equations f (x) = 1.2 and f (x) = 2. In each
case, if a solution does not exist, explain.
iv) What is the domain of f (x)?
b.)Let f (x) = √x −1 and g (x) =...

let p(x) and Q(x) be two polynomials and consider the following
two cases:
case1:p(x) x Q(x)
case2: 3 Q (x)
for each case, find the following:
a) the number of terms
b) the degree

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 1 minute ago

asked 11 minutes ago

asked 16 minutes ago

asked 24 minutes ago

asked 32 minutes ago

asked 53 minutes ago

asked 57 minutes ago

asked 59 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago