EXTREMES Investigating Extreme Values of Function Combinations BRIEF ABSTRACT Sometimes functions don't always look the way we expect them to. This short classroom exploration helps students understand the effects of adding functions together and parameter dependence. GENERAL INFORMATION FileName: EXTREMES Full title: Investigating Extreme Values of Function Combinations Last Update: 5/30/96 Developers: Sandra K. Dawson, Glenbrook South High School, Glenview, IL. Aaron Klebanoff, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN. Contact: Aaron Klebanoff, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Phone: 812-877-8151. Email: Aaron.Klebanoff@rose-hulman.edu. FAX: 812-877-3198. Support: The production of this material is supported by the National Science Foundation under Division of Undergraduate Education grant DUE-9352849: Development Site for Complex, Technology-Based Problems in Calculus with Applications in Science and Engineering and the Arvin Foundation of Columbus IN. STATEMENT OF PROBLEM We are going to investigate the relative extreme values of the sum of two functions: x^2 and A Cos[x], where the parameter A will vary. 1. Plot the graph of f[x] = x^2 on [-10,10]. 2. Plot the graph of g[x] = Cos[x] on [-2 Pi, 2 Pi]. 3. Predict and sketch the shape of the graph of h[x]=x^2 + Cos[x] on [-10,10]. 4. Plot the graph of h on [-10,10] to verify your conjecture. What do you observe? 5. Find all values of x for which h has relative maximum or minimum values. Explain your results. 6. Predict the shape of the graph of h7[x]=x^2 + 7 Cos[x] on [-10,10]. 7. Plot the graph of h7 on [-10,10] to verify your conjecture. What do you observe? 8. Find all values of x on [-10,10] for which h7 has relative maximum or minimum values. 9. Consider the function hA[x]=x^2 + A cos x on [-10,10] where A is a constant. For what values of A will hA have relative extreme values? How many relative extreme values can we expect? Justify your answer. KEYWORDS Visualization, plotting, optimization, derivative, trigonometric function, parameter dependence. TEACHER NOTES ISSUES RELATED TO THE PROBLEM Summing functions does not always produce an obvious result, and by adding parameter dependence, interesting mathematical questions can arise. Prerequisites Plotting, maximization, derivative, trigonometric functions. Time allotment - time management This investigation can be done with Mathematica in 30 minutes. Expectations Future payoffs Students will become more aware with the effects of varying parameters in functions. The last problem leads nicely into bifurcation theory which is important to understand if interested in studying chaotic dynamical systems. Extensions The following questions turn a once easy problem into a full-blown project. For A = 20, there are two local minima on x > 0. Is there an A value so that there are three local minima on x > 0? How about 4? 5? n? Create a method for finding the critical values of A for which extreme values arise and use it. Apply your method to other similar functions and see how robust it is. References and Sources POSSIBLE SOLUTION(S) 1. Plot the graph of f[x] = x^2 on [-10,10]. In[2]:= f[x_] = x^2; Plot[f[x], {x,-10,10}] Out[3]= -Graphics- 2. Plot the graph of g[x] = Cos[x] on [-2 Pi, 2 Pi]. In[4]:= g[x_] = Cos[x]; Plot[g[x], {x, -2 Pi, 2 Pi}] Out[5]= -Graphics- 3. Predict and sketch the shape of the graph of h[x]=x^2 + Cos[x] on [-10,10]. Many students may not take into consideration the different scales on the graph when they draw their sketches. Their conjectures may look like the following plot.: In[6]:= Plot[x^2 + 20 Cos[x], {x, -10, 10}, PlotRange -> {-20,100}] Out[6]= -Graphics- 4. Plot the graph of h on [-10,10] to verify your conjecture. What do you observe? The graph suggests that the function has no oscillations at all. Further investigations will verify that this is indeed the case. In[7]:= h[x_] = f[x] + g[x]; Plot[h[x], {x, -10, 10}] Out[8]= -Graphics- 5. Find all values of x for which h has relative maximum or minimum values. Explain your results. Students may investigate extreme values by plotting the derivative of the function. Since the function is smooth, its extreme values occur when the derivative is zero. In[9]:= Plot[h'[x], {x, -10, 10}] Out[9]= -Graphics- From the graph of f'[x] it appears that the only root is at x = 0. Due to the nature of the function, we must use Find Root rather that the Solve command. In[10]:= FindRoot[h'[x]==0, {x, 0}] Out[10]= {x -> 0.} 6. Predict the shape of the graph of h7[x] = x^2 + 7 Cos[x] on [-10, 10]. Having seen that the graph may not oscillate, students should be more careful to ask themselves if the amplitude of the cosine curve is great enough to result in local minima. Careful students should offer a graph that looks quite close to the real thing. 7. Plot the graph of h7 on [-10,10] to verify your conjecture. What do you observe? Due to the symmetry in both x^2 and Cos[x], the symmetry is retained about the y-axis. On each side, we see a local maximum at the axis followed by a local minimum between 2 and 3, followed by a couple of inflection points but not other extreme values. In[11]:= h7[x_] = f[x] + 7 g[x]; In[12]:= Plot[h7[x], {x, -10, 10}, PlotRange -> {0, 100}] Out[12]= -Graphics- 8. Find all values of x on [-10,10] for which h7 has relative maximum or minimum values. We'll do this graphically (by looking for where the derivative of h7 crosses the x-axis): In[13]:= Plot[h7'[x], {x, -10, 10}] Out[13]= -Graphics- and numerically (we cannot do it analytically due to the complicated non-linear equation that must be solved): In[14]:= FindRoot[h7'[x] == 0, {x, 2}] FindRoot[h7'[x] == 0, {x, 0}] FindRoot[h7'[x] == 0, {x, -2}] Out[14]= {x -> 2.38995} Out[15]= {x -> 0.} Out[16]= {x -> -2.38995} The relative maximum occurs at x = 0 and the relative minima occur at x = 2.38995 and x = -2.38995. 9. Consider the function hA[x]=x^2 + A cos x on [-10,10] where A is a constant. For what values of A will hA have relative extreme values? How many relative extreme values can we expect? Justify your answer. We may investigate this analytically by plotting hA[x] and hA'[x] for different values of A. We may do this by plotting individual examples or by using the following Do[] statement which will allow students to produce an animation which demonstrates the behavior of hA[x] as "A" grows from 1 to 20 . Please note that the PlotRange must be fixed in order for the animation to proceed smoothly. Below are a few cases to give the idea. In[17]:= hA[x_] = f[x] + A g[x]; In[30]:= Do[Plot[hA[x], {x, -10, 10}, PlotRange -> {-20, 80}, PlotLabel -> {A}], {A, 1, 20, 6}] The following code will generate side-by-side graphics of the function y = x^2 + A cos x and its derivative as A goes from one to twenty. You can then animate these graphics to see the effect of changing the parameter A. In[31]:= p1[A_] := Plot[hA[x], {x, -10, 10}, PlotRange -> {-20,80}, PlotLabel -> {A}, DisplayFunction -> Identity]; In[32]:= p2[A_] := Plot[hA'[x], {x, -10, 10}, PlotRange -> {-30,30}, PlotLabel -> {A}, DisplayFunction -> Identity]; In[33]:= array = Table[{p1[A], p2[A]}, {A, 1, 20}]; In[34]:= Do[Show[GraphicsArray[array[[n]]]], {n, 1, 20}] From the animations, we can see that as early as A = 4 there are local minima. We can determine the A-value at which we first obtain local minima by looking at the graph of the curve hA'[x]==0 in the Ax-plane. In[29]:= ImplicitPlot[hA'[x]==0, {x, -10, 10}, {A, 1, 20}, AxesLabel -> {"x", "A"}, PlotPoints -> 50, PlotStyle -> AbsoluteThickness[2]] Out[29]= -ContourGraphics- From the graph, we see that x= 0 is always an extremum. A is about 2 when the a branch of local minima arise. We also see new branches of extrema arising when A is about 15.6 which concurs with what we saw in the animations. ISSUES IN SOLUTION Student's will not be fast to come up with a method for numerically determining the A-values for which the extrema arise (in Problem 9.) However, by guessing and checking graphs, they should be able to get good estimates on the critical A-values. The implicit plot in the solution of the last problem is actually a bifurcation diagram, and the analysis done here is similar to the analysis that one does when studying dynamical systems.