Download MuPAD from SciFace

MuPAD Pro Computing Essentials - Examples 

Example 12.2 - Local minimum and maximum values  

A typical undergraduate mathematics problem is to obtain the plot of a function and its derivative or derivatives on the same graph and investigate the existence of local minimum and maximum values. In this example, we will produce a graph of the function: 

We will start by declaring our function and its derivative. Then we will get a plot of both of them. 

  

  • z := t -> (1 - t^3)/(1 + t^4);

	
  • u := t -> diff(z(t), t);
	
  • export(plot, Function2d):

    z1 := Function2d(z(t), t=-5..5,
       Color=RGB::Blue,
       LineWidth=15
    ):
      
    u1 := Function2d(u(t), t=-5..5):
      
    plot(z1, u1)

  • solutions := solve(u(t)=0, t);

	
  • solutions := float(solutions);

	{1.784357981, - 0.5459265692 + 1.45937795 I,
	- 0.5459265692 - 1.45937795 I, -0.6925048426, 0.0}
  • rsol := solutions intersect Dom::Interval(-5,5)

	
  • rsol:= [op(rsol)]

	
  • Z1 := [rsol[1], subs(z(t), t=rsol[1])];
    Z2 := [rsol[2], subs(z(t), t=rsol[2])];
    Z3 := [rsol[3], subs(z(t), t=rsol[3])];

	
	
	
  • export(plot, Point):
       
    P1 := Point(Z1):
    P2 := Point(Z2):
    P3 := Point(Z3):
      
    plot(z1, u1, P1, P2, P3,
       PointWidth=60,
       PointStyle=FilledCircles
    )

 NOTE: this example is quite complicated to copy it into your notebook. For this purpose I included here a complete  MuPAD notebook.  Download it, open in MuPAD and then execute all commands. 

TOP