# Graphing rational functions

rational function is any function which can be defined by a rational fraction, a fraction such that both the numerator and the denominator are polynomials. When graphing rational functions there are two main pieces of information which interest us about the given function. The points where the function is not defined and the points where the graph of the given function intersects the axes.

A function $f(x)$ is called a rational function if it can be writen as:

$f(x)=\frac{P(x)}{Q(x)}$,

where $P(x)$ and $Q(x)$ are polynomials in $x$ and $Q(x)$ is not a zero polpolynomial.

Asymptote is a line such that the distance between the curve and the line approaches zero as one or both of the $x$ or $y$ coordinates tends to infinity. Graph of the function approaches the asymptote into infinity, but never intersects it. There are three types of asymptotes: horizontal, vertical and slant asymptotes. For example, function $f(x) = 2^x$ has a horizontal asymptote $y=0$, function $f(x)=\frac{1}{x^2}$ has a vertical asymptote $x=0$, and any kind of hyperbola has slope asymptotes, $y=\pm \frac{b}{a}x$, as shown below, the red curves are asymptotes and blue are graphs.

Horizontal asymptote

Vertical asymptote

Slant asymptote

We say that the line $x = a$ is the vertical asymptote of the function $y=f(x)$ if at least one of the limits $lim_{ x \to a } f ( x )$ or $lim_{ y \to a } + f ( x )$ is equal to $-\infty$ or $+\infty$.

A line is a vertical asymptote $x=a$ where $a \in \mathbb{R}$, if both the left and the right limit of the given function tend to infinity when $x$ approaches $a$.

Example 1. Find a vertical asymptote of the function $f(x)=\frac{1}{(x – 1)^2}$.

First, we need to find the points for which the function $f(x)$ is not defined, which, in this example, is $x=1$. If $lim_{y \to a}+ f ( x )$ is equal to – $\infty$ or +$\infty$, then the graph of $f(x)$ lies on the right side of the asymptote, and if $lim_{x \to a}- f(x)$ is equal to $-\infty$ or $+\infty$ it lies on the left side, and if they are equal, function lies on both sides.

What happens with the graph of the function $f(x)=\frac{1}{(x – 1)^2}$ as we move along the x- axis?

For example, if we take very large negative number for $x$, the square in the denominator will change it into very large positive number, which furthermore means that the value of this function at this particular $x$ will be very close to zero, but always strictly greater than zero. As $x$ moves closer to 1, the values of the function grow. The closer we are to 1, the greater the values.

For $\frac{1}{2}$, $f ( x ) = \frac{1}{(\frac{1}{2} – 1)^2} = 4$.

For $\frac{1}{4}$, $f ( x ) = \frac{1}{(\frac{1}{4} – 1)^2} = \frac{16}{9}\approx 1.778$.

For $\frac{1}{8}$, $f ( x ) = \frac{1}{(\frac{1}{8} – 1)^2} = \frac{64}{49}\approx 1.306$.

For $\frac{1}{10}$, $f ( x ) = \frac{1}{(\frac{1}{10} – 1)^2} = \frac{100}{81}\approx 1.234$.

For a number that is very close to 1, but not 1, this function will tend to $+\infty$.

This means that around 1, graph does reach infinity which means that $x = 1$ is vertical asymptote of function $f(x) = \frac{1}{(x – 1)^2}$.

We say that a line $y = b$ is a horizontal asymptote of a function $y = f(x)$ if $lim_{x \to +\infty} f(x) = b$ or $lim_{x\to -\infty} f(x) = b$.

Example 2. Find asymptotes and draw the graph of the function $f(x) = \frac{x}{x + 1}$.

This graph will have a vertical asymptote $x = – 1$.

To determine horizontal asymptotes we have to find $lim_{x \to \pm \infty} f(x)$.

$lim_{x \to \pm \infty} \frac{x}{x + 1} \setminus \frac{: x}{: x} = lim_{x \to \pm \infty} (\frac{1}{1 + \frac{1}{x}}) = 1$

A line $y = kx + l$  is a slant asymptote of a function $f (x)$  when $x\to \infty$ if $lim_{x \to \infty} ( f ( x ) – (kx + l) ) = 0$.

Coefficients of this line are determined as:

$k = lim_{x \to \infty} (\frac{f(x)}{x})$,

$l = lim_{x \to \infty} ( f(x) – kx)$.

Example 3. Find asymptotes and draw the graph of the function $f(x) = \frac{x^2}{x + 1}$.

Vertical asymptote is $x = – 1$.

Calculate the coefficients for the slant asymptote.

$k = lim_{x \to \infty} (\frac{f(x)}{x})$

$k = lim_{x \to \infty} (\frac{\frac{x^2}{x + 1}}{x}) = lim_{x \to \infty} (\frac{x^2}{x^2 + x}) = 1\to k = 1$

$l = lim_{x \to \infty} (x – kx)$

$l = lim_{x \to \infty} (\frac{x^2}{x + 1} – 1\cdot x) = lim_{x \to\infty} (\frac{x^2 – x^2 – x}{x + 1} )= lim_{x \to \infty} (\frac{- x}{x + 1}) = – 1$

The slant asymptote is the line $y = x – 1$.

The last steps of drawing the graph of the given functions are always the same: first, you draw the asymptotes, second, find few points and fit the graph between the asymptotes.