Question

Finding Absolute Maximums and Absolute Minimums. We are guided here by two theorems about extreme values of functions Theorem
dE (x) diff(f(x), x) explot(dt(x), Ia, b) mysolver(df(x),x) If Matlab cannot find the critical points with the general comman
Finding Absolute Maximums and Absolute Minimums. We are guided here by two theorems about extreme values of functions Theorem 1: Iff(x) is continuous on a closed interval [a, b], then f(x) has both an absolute minimum value, m, and an absolute maximum value, M. This means there are some numbers c and d with m = f(c) and M = f(d) and m s f(x) s M for each x in [a, b]. The theorem does not tell us where to find those numbers c and d. The next theorem takes care of that by limiting the possible locations. Theorem 2: The extreme values of a continuous function f(x) on a closed interval a, b] can only occur at the critical points or end points of the interval. As an example, we will find the absolute maximum and absolute minimums of f(x) = sin x + x cos(H) on the interval [0, π] 1. First use the graph of the function and cursor to approximate values fo the absolute maximum and minima. Record them as M and m in text in your LiveScript. x syms f(x) sin(x)+2*cos ( x^2); hold off ezplot(f(x) , (a,bl) hold on Next, we find the derivative to determine the critical points, the exact locations of the absolute maxima and minima. Since the function is differentiable everywhere the only critical numbers will be solutions to the equation f(x)-0 Page 3
dE (x) diff(f(x), x) explot(dt(x), Ia, b) mysolver(df(x),x) If Matlab cannot find the critical points with the general command, we must resort to the vpasolver. From the graph of the function, it is clear that there are four solutions to f(x)-0. The first is in the interval [0.8,1]. This interval is used in the first of the next 4 commands. Find appropriate intervals for the remaining three intervals. cl=vpasolve{df(x),x,[0.8 1]); d-vpasolve ( df (x),X,[ c4-vpasolve(df (x),x,I ]); Finally, calculate the values of the function at those four critical points and the endpoints, 0 and pi. [f(a) f(c1) f(c2) f(C3) f(C4) f(b)] It shouldn't be too hard to identify the least value (-3.01..) and the greatest (3.100...) of the 5 floating point numbers, but it will be hard to compare them to f(b). Try the following command for that. [f(a) f(cl) f(e2) f(c3) f(c4) vpa ( f (b))] Now we can be sure the absolute maximum is f(c3) 3.100075094, and the absolute minimum is f[c4) -3.015500543. Putting it All Together Use the steps in the section "Finding Absolute Maximums and Minimums" to find the critical numbers for the functions below on the given intervals. Then find the absolute minimum and maximum as well Report your answers as done for the example above just before Putting it All Together started. 1. gx)-3x +x, x in [-1.5, 1.5 2. k(x)-yWt_ sin x + 1/2, x in [0, 2π] Page 4
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a)

%%% Matlab code

clc;
close all;
clear all;
format long
syms x;
f=x^4-3*x^2+x;
a=-1.5;
b=1.5;
figure;
ezplot(f,[a,b]);
grid on;
xlabel('x');
ylabel('f(x)');
df=diff(f,x);
figure
ezplot(df,[a,b]);
grid on
xlabel('x');
ylabel('f''(x)');
disp(' 3 critical point available');
c1=vpasolve(df,x,[-1.5 -1]);
c2=vpasolve(df,x,[-1 0.6]);
c3=vpasolve(df,x,[0.6 1.5]);
f1=[subs(f,a) subs(f,c1) subs(f,c2) subs(f,c3) subs(f,b) ];
fmax=max(f1);
fmin=min(f1);
fprintf('Maximum of function fmax= %f \n',fmax);
fprintf('Minimum of function fmin= %f \n',fmin);

OUTPUT:

x -3 x2+ x* -0.5 -1 -2 2.5 -3 -3.5 -1 0.5 0.5 1.5

0 5 5432-01-23-4

3 critical point available
Maximum of function fmax= 0.084135
Minimum of function fmin= -3.513905

(b)

%% Matlab code %%%

clc;
close all;
clear all;
format long
syms x;
f=x^3/4-sin(x)+1/2;
a=0;
b=2*pi;
figure;
ezplot(f,[a,b]);
grid on;
xlabel('x');
ylabel('f(x)');
df=diff(f,x);
figure
ezplot(df,[a,b]);
grid on
xlabel('x');
ylabel('diff(f(x))');
disp(' only 1 critical point available');
c1=vpasolve(df,x,[0 2]);
f1=[subs(f,a) subs(f,c1) subs(f,b) ];
fmax=max(f1);
fmin=min(f1);
fprintf('Maximum of function fmax= %f \n',fmax);
fprintf('Minimum of function fmin= %f \n',fmin);

OUTPUT:

x314 - sin(x)1/2 60 50 40 ご30 20 10 4 6

(3 x2)/4 - cos(x) 30 25 20 15 10 0 4 6

only 1 critical point available
Maximum of function fmax= 62.512553
Minimum of function fmin= -0.101123

Add a comment
Know the answer?
Add Answer to:
Finding Absolute Maximums and Absolute Minimums. We are guided here by two theorems about extreme...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT