Graphing Algebraic Rational Functions

Robin Sitton
133 Parkway Drive
Chatham, IL 62629
217-483-6636
January 1999

Description:  This project is designed as an introduction to graphing of rational functions for my average to lower level Algebra 2 students.  My goal is for my students to use this guided exploration to try and find the patterns that result in vertical and horizontal asymptotes.  I intentionally did not cover asymptotes that are not vertical or horizontal.
			
In my design of this project, I tried to pick clear examples that would be easy for my students to see a pattern.  I also tried to use several different methods of graphing in Mathematica in the hopes that my students might see these graphs in a different view.  I think that the animated graphs will certainly allow them to see what happens to functions as the values of "a" changes. 

I tried to implement lots of color just for fun and also tried to give the necessary directions for executing cells and animating.

st := 
      ListPlot[{{3, 3}}, PlotStyle -> {Yellow, PointSize[0.6]}, 
        PlotRange -> {{0, 7}, {-30, 40}}, Axes -> False, 
        DisplayFunction -> Identity]nd := 
      ListPlot[{{2.3, 7.5}, {3.7, 7.5}}, 
        PlotStyle -> {Black, PointSize[0.04]}, 
        PlotRange -> {{0, 7}, {-30, 20}}, 
        DisplayFunction -> Identity]\(rd := 
      Plot[\(1\/ .1\) \((x - 3)\)\^2 - 12, {x, 2.2, 3.8}, 
        PlotStyle -> {Black, Thickness[0.015]}, Axes -> False, 
        DisplayFunction -> Identity]\)Show[st, nd, rd, DisplayFunction -> $DisplayFunction]

We have to remember that a rational function is a function that can be represented as the quotient of 2 polynomials.  The denominator must have a degree greater than or equal to 1.

Vertical Asymptotes

\(TextForm
    \`Before\ we\ look\ at\ graphs\ we\ first\ have\ to\ remember\ what\ a\ 
          domain\ is\ with\ respect\ to\ functions . \ \ The\ domain\ of\ a\ 
          function\ is\ the\ set\ of\ x - 
        coordinates . \ \ If\ we\ look\ at\ the\ function\ f \((x)\) = 1\/x, 
    \ what\ can\ x\ be?\ \ 
		What\ happens\ when\ x = 
      \(5\ or\ x = 
        \(4. \ \ Can\ x = 
          \(3\ or\ x = 
            \(2?\ \ Can\ we\ ever\ have\ x = 
              0?\ \ Remember\ with\ rational\ functions\ that\ denominators\ 
                can\ not\ be\ equal\ to\ 0. \ \ So\ this\ would\ give\ us\ the
                \ domain\)\)\)\)\ \ \)\(TextForm\`						
    D = {x : x ≠ 0} . \ \ \ Is\ this\ something\ that\ can\ be\ 
        identified\ from\ a\ graph?\ \ What\ would\ the\ graph\ look\ like, \ 
    specifically\ when\ x = 
      0?
			
			Please\ execute\ the\ following\ cells\ by\ clicking\ 
        on\ the\ bracket\ to\ the\ right\ and\ pressing\ \(enter . \)
	
    \)

<< "Graphics`Colors`"

\(\(Plot[1\/x, {x, \(-4\), 4}, 
      PlotStyle -> {ForestGreen, Thickness[0.01]}, 
      PlotRange -> {\(-2\), 2}, 
      PlotLabel -> \*""f(x)=\!\(1\/x\)""]; \)\)

Do you notice a correlation between the graph and the domain?  Does the graph show a value at x=0?

Where would f(x) = (1/(x + 5)) be undefined at?

Please execute the following cell.

\(\(Plot[1\/\(x + 5\), {x, \(-8\), 1}, 
      PlotStyle -> {PrussianBlue, Thickness[0.01]}, 
      PlotRange -> {\(-4\), 4}, 
      PlotLabel -> \*""f(x)=\!\(1\/\(x + 5\)\)""]; \)\)

The above graph has a domain of D={x:x≠ -5}. Does this agree with what you predicted before you looked at the graph?  Do you notice how the graph does not have a value at x=-5?

Where will f(x) = (2/(x - 4)) be defined at?  
      Please execute the following graph.

\(\(Plot[2\/\(x - 4\), {x, \(-1\), 8}, 
      PlotStyle -> {Purple, Thickness[0.01]}, 
      PlotRange -> {\(-4\), 4}, 
      PlotLabel -> \*""f(x)=\!\(2\/\(x - 4\)\)""]; \)\)

Notice that this graph does not have values when x = 
      4.    (Which does correspond to the domain . )\(		What\ you\ are\ seeing\ are\ the\ restrictions\ on\ the\ 
      domain . \ \ The\ graph\ represents\ this\ restriction\ with\ a\ 
      vertical\ asymptote, \ in\ this\ case, \ x = 4. 
\)

Vertical asymptotes are lines that a graph approaches but does not cross.  So if a function, \(TraditionalForm
      \`f(x) = 1\/\(x - a\)\ is\ not\ defined\ for\ a\ value\ of\ a, \ 
      the\ vertical\ asymptote\ is\ at\ x = \(a . \)\)

What happens as the value of "a" changes?  To see this, please execute the following cell and double-click on a single graph.

\(Clear[g, x, a]; 
g[x_, a_] := 1\/\(x - a\); 

    Table[Plot[g[x, a], {x, \(-6\), 6}, PlotRange -> {\(-6\), 6}, 
        PlotStyle -> {SlateBlue, Thickness[0.01]}], {a, \(-6\), 6, 1}]; 
    \)

Please notice that as the value of "a" changes, the vertical asymptote changes accordingly.

Horizontal Asymptotes

Just as the domain can be used to locate vertical asymptotes, the range can be used to determine where horizontal asymptotes will be.  The problem is that finding the range of a rational function is not always as easy at it looks.  In this section we will look at these from a graphic approach as well.

CASE 1-What if n=m?

Looking at the function f(x) = ((x - 1)/(3  x)),  we know that x≠0.  Please make note of the leading coefficients and execute the following cells.

\(firstplot = 
      Plot[\(x - 1\)\/\(3  x\), {x, \(-4\), 4}, 
        PlotStyle -> {MediumVioletRed, Thickness[0.01]}, 
        PlotLabel -> \*""f(x)=\!\(\(x - 1\)\/\(3  x\)\)"", 
        PlotRange -> {\(-3\), 3}, DisplayFunction -> Identity]; 

    secondplot = 
      Plot[\ 1\/3, {x, \(-4\), 4}, PlotStyle -> {Navy, Thickness[0.02]}, 
        DisplayFunction -> Identity]; 

    Show[firstplot, secondplot, DisplayFunction -> $DisplayFunction]; 
    \)

Do you notice that the graph does not cross the line \(TraditionalForm
      \`y = \(1\/3\) . \ \ How\ does\ this\ correspond\ the\ the\ leading\ 
          coefficents\ of\ this\ \(function?\)\)

\(\(Clear[g, x, a]; 
g[x_, a_] := x\/\(x - a\); 

    Plot[Evaluate[Table[g[x, a], {a, \(-2\), 2, 1}], {x, \(-8\), 10}, 
        PlotRange -> {\(-4\), 4}, 
        PlotStyle -> {DeepPink, Thickness[0.01]}]]; 
\)\)

Notice that all of the graphs seem to converge at one horizontal line, namely, y=1.  With this you might note that the degree of the numerator and the denominator will be equal and both will have the same leading coefficient.  

Please execute the following.\(\(

\)\)

\(firstplot = 
      Plot[\(3  x\)\/\(4  x - 1\), {x, \(-4\), 4}, 
        PlotStyle -> {Navy, Thickness[0.02]}, 
        PlotLabel -> \*""f(x)=\!\(\(3  x\)\/\(4  x - 1\)\)"", 
        DisplayFunction -> Identity]; 

    secondplot = 
      Plot[\  .75, {x, \(-4\), 4}, 
        PlotStyle -> {MediumSeaGreen, Thickness[0.01]}, 
        DisplayFunction -> Identity]; 

    Show[firstplot, secondplot, DisplayFunction -> $DisplayFunction]; 
    \)

Notice that the graph has a horizontal asymptote at \(TraditionalForm
      \`y = \(3\/4\) . \ \ Compare\ this\ to\ the\ leading\ coefficients\ of\ 
          this\ \(function . \)\)

\(In\ general, \ 
        if\ we\ have\ a\ rational\ function\ 
	f \((x)\) = 
          \(\(bx\^n + \((polynomial\ of\ a\ lower\ degree)\)\)\/\(cx\^m + 
                  \((polynomial\ of\ a\ lower\ degree)\)\)
we\ can\ conclude
              \ that\ if\ n = m\), \ 
        then\ there\ will\ exist\ a\ horizontal\ asymptote\ at\ y = 
          \(b\/c\ where\ b\ &\)\ c\ are\ the\ leading\ coefficients\ of\ the\ 
            numerator\ and\ the\ denominator\ \(respectively . \)\)

CASE 2-What if n<m?

So, what if n≠m?  Let's first look at cases where n<m.

Looking back again at the function f(x) = (1/x),  
      what happens to the value of f(x) as x changes?  
      We know that x≠0 from earlier.  What happens with x=3 or x=4?  Notice that as x increases, the value of f(x) decreases.  Since the denominator of this fraction can never be 0, where can we get a value of 0 for this function at?  Logically, it would be from the numerator.  Can this numerator be 0?  Can f(x)=0?  
Please execute the following cells.

\(\(Plot[1\/x, {x, \(-4\), 4}, 
      PlotStyle -> {ForestGreen, Thickness[0.01]}, 
      PlotRange -> {\(-2\), 2}, 
      PlotLabel -> \*""f(x)=\!\(1\/x\)""]; \)\)

Looking at the graph of \(TraditionalForm
      \`\(f(x) = 
        \(1\/x\) again\ leads\ us\ to\ believe\ that\ the\ graph\ does\ not\ 
      \)\)cross the x-axis or y=0.  I guess that f(x)≠ 0 after all.  Is there a pattern here?

\(\(firstplot = 
      Plot[\(5  x + 2\)\/\(3  x\^2\), {x, \(-4\), 4}, 
        PlotStyle -> {Plum, Thickness[0.01]}, 
        PlotLabel -> 
          \*""f(x)=\!\(\(5  x + 2\)\/\(3  x\^\(2\\ \)\)\)"", 
        PlotRange -> {\(-5\), 5}, DisplayFunction -> Identity]; 

    secondplot = 
      Plot[\ 0, {x, \(-4\), 4}, 
        PlotStyle -> {CadetBlue, Thickness[0.02]}, 
        PlotRange -> {\(-5\), 5}, DisplayFunction -> Identity]; 

    Show[firstplot, secondplot, DisplayFunction -> $DisplayFunction]; 

    
\)\)

Notice that x=0 is a vertical asymptote because of the domain D={x:x≠0}.    Where does the horizontal asymptote appear?  We can not have 0 in the denominator, so the only place for this function to be equal to 0 will be at values we can determine from the numerator.  The numerator will be 0 when \(TraditionalForm
      \`x = \(\(\(-5\)\/2\) . \ \ Where\ else\ could\ \(f(x)\)\  = 
          0\ \(at?\)\)\)  This will not happen anywhere else. This is why the graph crosses the x-axis only one time.  We will consider the horizontal asymptote to be at y=0 if you look at what is happening at the extreme sides of the graph.

\(\(firstplot = 
      Plot[\(7  x\^2 + 4  x\)\/\(8  x\^3\), {x, \(-4\), 4}, 
        PlotStyle -> {DarkSlateBlue, Thickness[0.01]}, 
        PlotLabel -> 
          \*""f(x)=\!\(\(7  x\^2 + 4  x\)\/\(8  x\^3\)\)"", 
        PlotRange -> {\(-5\), 5}, DisplayFunction -> Identity]; 

    secondplot = 
      Plot[\ 0, {x, \(-4\), 4}, 
        PlotStyle -> {GeraniumLake, Thickness[0.02]}, 
        PlotRange -> {\(-5\), 5}, DisplayFunction -> Identity]; 

    Show[firstplot, secondplot, DisplayFunction -> $DisplayFunction]; 

    
\)\)

Notice again that y=0 is the horizontal asymptote.

What if we look at several functions where the leading coefficents vary, but n<m?  Please execute the following cell and double-click on one of the graphs.

\(Clear[g, x, a]; 
g[x_, a_] := \(a \((x\^2 + 1)\)\)\/x\^3; 

    Table[Plot[g[x, a], {x, \(-8\), 8}, PlotRange -> {\(-8\), 8}, 
        PlotStyle -> {SlateBlue, Thickness[0.01]}], {a, \(-8\), 8, 2}]; 
    \)

Notice that once again, the graph does not cross the x-axis or y=0.

\(In\ general, \ 
        if\ we\ have\ a\ rational\ function\ 
	f \((x)\) = 
          \(bx\^n + \((polynomial\ of\ a\ lower\ degree)\)\)\/\(cx\^m + 
                  \((polynomial\ of\ a\ lower\ degree)\)\)
we\ can\ conclude
              \ that\ if\ n < m, \ 
        then\ there\ will\ exist\ a\ horizontal\ asymptote\ at\ y = 
          \(0\  . \)\)

CASE 3-What if n>m?

\(\(Plot[x\^3\/\(2  x\^2 + 1\), {x, \(-4\), 4}, 
      PlotStyle -> {Indigo, Thickness[0.01]}, 
      PlotRange -> {\(-2\), 2}, 
      PlotLabel -> \*""f(x)=\!\(x\^3\/\(2  x\^2 + 1\)\)""]; \)\)

Notice that this graph does not appear to approach any specific value for a horizontal asymptote.

Please execute the following cell.  If you wish to resize the graph, click and drag at any corner.

\(\(firstplot = 
      Plot[x\^2\/\(x - 1\), {x, \(-1.5\), 3}, 
        PlotStyle -> {MediumSeaGreen, Thickness[0.01]}, 
        PlotLabel -> \*""f(x)=\!\(x\^2\/\(x - 1\)\)"", 
        PlotRange -> {\(-2\), 6}, DisplayFunction -> Identity]; 

    secondplot = 
      Plot[\ \(x\^2 + 5\)\/\(x - 2\), {x, \(-4\), 12}, 
        PlotStyle -> {Turquoise, Thickness[0.01]}, 
        PlotLabel -> \*""f(x)=\!\(\(x\^2 + 5\)\/\(x - 2\)\)"", 
        PlotRange -> {\(-5\), 12}, DisplayFunction -> Identity]; 

    Show[GraphicsArray[{firstplot, secondplot}], 
      DisplayFunction -> $DisplayFunction]; 

\)\)

Notice that neither of these graphs appears to have a horizontal asymptote either.

\(In\ general, \ 
        if\ we\ have\ a\ rational\ function\ 
	f \((x)\) = 
          \(bx\^n + \((polynomial\ of\ a\ lower\ degree)\)\)\/\(cx\^m + 
                  \((polynomial\ of\ a\ lower\ degree)\)\)
we\ can\ conclude
              \ that\ if\ n > m, \ 
        then\ there\ will\ not\ exist\ a\ horizontal\ \(asymptote\  . \)\)