Is $\frac {x^2 + 5x}{x} = x+5$? We are graphing functions in class and the function $f(x) = \frac {x^2 + 5x}{x}$, came up and our teacher simplified it to $x+5$ and graphed that with a hole in the function at $x=0$.
I started wondering, how in algebra can we say that $\frac {x^2 + 5x}{x} = x+5$, when the graphs of each function are not equal?
Thanks
 A: The key here is that the domain of the function $f$ is not all real numbers.  It's $\Bbb R \setminus \{0\}$ (meaning all real numbers except $0$).  So once you know that it should be clear that $\frac{x^2+5x}{x}$ is exactly equal to $x+5$ on that domain.
If we wanted to specify that, we'd write $f: \Bbb R \setminus \{0\} \to \Bbb R$ is given by $f(x)=x+5$.  Then we'd immediately see that the domain of $f$ is $\Bbb R \setminus \{0\}$ and the codomain$^\dagger$ is $\Bbb R$.  But often mathematicians and teachers are a little lazy and will just expect you to realize that sometimes when they write $A=B$, they mean $A=B$ on the largest domain where both $A$ and $B$ are defined.
$^\dagger$: If you've never heard of a codomain, don't worry about it exactly.  It's related to the range of the function, but it's not super important to know to understand basic algebra.
A: It is indeed invalid to write "$\frac{x^2+5x}{x} = x+5$". In general, a lot of people are imprecise and never specify properly what objects they are talking about. In this case, what is $x$? Once you answer that question right, you get a true statement:

$\frac{x^2+5x}{x} = x+5$ for any real $x \ne 0$.

This means that you can plot the graph of $y = \frac{x^2+5x}{x}$ by following the graph of $y = x+5$ for all reals $x \ne 0$. For $x = 0$, of course $\frac{x^2+5x}{x}$ is undefined so we leave a hole there.
