Download MuPAD from SciFace

MuPAD Pro Computing Essentials - Examples 

Example 12.3 - Plotting Asymptotes of Functions  

This is another typical problem from undergraduate mathematics. There is given function

and we need to plot its asymptotes.  We will start our solution by plotting the graph of the function and we will look for coefficients of asymptotes. Finally, we will plot the function and its asymptotes on the same picture.

   

  • h := x -> (x^2-1)/abs(x-2):
     
    export(plot, Function2d):
    R := 20:
    U := Function2d(h(x), x=-R..R, y=-R..R):
    plot(U)

	
  • a1 := limit(h(x)/x, x=+infinity):
    b1 := limit(h(x) - a1*x, x=+infinity):
    a2 := limit(h(x)/x, x=-infinity):
    b2 := limit(h(x) - a2*x, x=-infinity):

  • asymptote1 := Function2d(a1*x + b1, x=-R..R,
       Color=RGB::Blue
    ):
     
    asymptote2 := Function2d(a2*x + b2, x=-R..R,
       Color=RGB::Black
    ):
     
    asymptote3 := plot::implicit(x=2, x=0..3, y=-R..R):

  • plot(U,
       asymptote1,
       asymptote2,
       asymptote3,
       Scaling=UnConstrained
    )

NOTE: Here is enclosed a complete  MuPAD notebook.  Load it to MuPAD and then execute all commands. 

TOP