# Why do $f(x)= \frac {{x²-1}}{{x-1} }$ and $g(x)=x+1$ not have the same domain of definition, but are the same? [closed]

Let $f(x)= \frac {{x²-1}}{{x-1} }$ and $g(x)=x+1$.

It is clear that $f(x)=g(x)$ for all real numbers $x$.

My question: Why do $f$ and $g$ not have the same domain of definition, however $f(x)=g(x)$?

Note: I know only that $f$ extended by continuity at $x=1$ as a reason, I hope to know more reasons if it is possible.

• What is $f(1)$ and $g(1)$? Sep 28 '15 at 21:16
• I'm truly baffled by what you want to know. Why we don't say "Aw heck, go ahead and divide by $0$, but just this once" ? Sep 29 '15 at 2:01
• Voted to reopen, because this question has 6 upvoted and 1 downvoted answers. This is a pretty strong indication that the question itself is not really unclear. Partially undefined operations are indeed annoying, but it's no solution to pretend that questions about them are invalid or unclear. (The solution motivated by category theory to always specify domain and codomain and only consider total function is indeed quite powerful, but it is not the only possible solution. In the context of (complex) function theory, other solutions are more appropriate.) Oct 10 '15 at 11:38
• Who says that they are the same? They aren't, precisely because they do not have the same domain of definition. The title of your question contains the answer. This is a non-question. Oct 10 '15 at 14:13

The two functions are not the same because $f(x)$ is not defined for $x=1$, so its graph is a stright line that has a ''hole''.

The Domain of definition is the subset of $\mathbb{R}$ where the function is defined and this means that has values in the codomain. Division by $0$ is not defined so the function $f(x)$ cannot be defined for $x=1$. You can extend it by continuity but this means that you have a new function $f_1(x)$ that coincide with $f(x)$ for $x \ne 1$ and is defined also in this point in such a way that $$f_1(1)=\lim_{x\rightarrow 1} f(x)$$ and, in this case, you really have $f_1 =g$.

• this is the main problem :Domain of definition !!!!! Sep 28 '15 at 21:09
• I've added something to my answer. I hope its usefull :) Sep 28 '15 at 21:17
• Thank you for your answer however it is cited in my note !! Sep 28 '15 at 21:24
• To the OP: The point is that f(x) is not extendable to g(x) when x=1. Say you are writing a program and you store the value of 1 in x. You can't evaluate g(1) but you can evaluate g(0). See the difference? Sep 28 '15 at 22:38

it is clear that $f(x)=g(x)$ for all real numbers

is wrong. In particular, $f(1)$ is undefined, and that's why $D_f = \mathbb{R}\backslash\{1\}$ and $D_g = \mathbb{R}$.

• f(0)=1 my friend , i think you are new here Sep 28 '15 at 21:11
• @zeraouliarafik sorry for the typo, I've amended the answer. Sep 28 '15 at 21:13
• The question is not to give me the domain of definition but to give a reason why they are not have the same domain of definition however they r the same ? Sep 28 '15 at 21:14
• @zeraouliarafik you are, again, wrongly assuming that they are "the same". They are not. If you could explain why you think they are "the same", maybe we can go from there. Sep 28 '15 at 21:16
• @zeraouliarafik either you are making a hard attempt at trolling, or you are making a totally pointless assertion in an attempt to justify your flawed reasoning... Sep 28 '15 at 21:19

Zero is a funny thing. When analyzing functions you need to establish the domain as it was originally stated; this is because of the possibility you might divide by zero, which is not defined. Rules like this are in place because math would fall apart without them.

If you have never seen it, here is the "Don't drink and derive" t-shirt: it's silly, but it's an example of not respecting the "divide by zero" rules.

The whole purpose of going through exercises like this is to get you to start noticing zero in functions. While it might be algebraically possible to simplify a function you have to respect its original domain, otherwise strange things can happen.

Here are some good and similar examples:

Why does simplifying a function change its domain?

Functions - finding the domain

The point is that when you write $g(x)=x+1$ or some other expression you're not really defining a function. A function $f$ is determined when you specify its domain $A$, its codomain $B$ and a subset $E\subseteq A\times B$ with the property that $\forall a\in A\,\exists!\,b\in B\,s.t.\,(a,b)\in E$ (and you write $b=f(a)$. )

Usually, in the first courses of analysis, it's introduced the ( rather artificial ) concept of domain of definition: given a certain expression [usually a finite composition of "elementary" real functions, (exponential, logarithm, sine, cosine, with their natural domains) and field operations over $\mathbb{R}$ (sum, difference, product, division) ], we assigns to it as domain the subset of $\mathbb{R}$ of all numbers $x$ such that the expression is "computable over $\mathbb{R}$" when calculated in $x$, i.e. $x$ must belong to the intersection of the natural domains of all the elementary functions in the expressions, and is such that you never make a division by zero when "computing" the expressions in $x$.

Now, with the domain specified in this way, you have really defined a real function (the codomain is $\mathbb{R}$).

In your case, the expressions $(x^2-1)/(x-1)$, is computable for every $x\neq 1$, for $x=1$ you get $0/0$ instead. So you defines a function $f$ with domain $D=\mathbb{R}\backslash \{1\}$, and given $x\in D$, $y\in\mathbb{R}$, you write $y=f(x)$ if $y=(x^2-1)/(x+1)$, that is $y=x+1$.

In the second case, the domain of $g$ becames $\mathbb{R}$, and you write $y=g(x)$ if $y=x+1$.

Since $f$ and $g$ have different domain, they are not the same function. But if you restrict the domain of $g$ to $\mathbb{R}\backslash \{1\}$, you get exactly $f$.

This has been implied by the other answers, but I'd like to mention a rather technical point. What one should not forget is that a function really is a relation between two sets: If $X$ and $Y$ are nonempty sets, then we say $f$ is a function, and we write $f:X\to Y$, if $f$ is a relation from $X$ to $Y$ such that $\forall x\in X,\exists! y\in Y: (x,y)\in f$ (or $xfy$ in another popular notation for relations). As a remark note that we can actually get rid of "$!$" in the expense of one extra statement (which one?).

In other words, a function is a triplet of two sets and one relation between them, i.e. $f:X\to Y$ is just a more intuitive and convenient way of writing $(X,Y,f)$.

As an exercise, argue why a function is not equal to any of its (proper) restrictions. To be formal, if $f:X\to Y$ is a function and $A\subset X$ is a proper subset of $X$, then $f\neq\left.f\right|_A$ (even when $f(X)=f(A)$).

At the end of page 49 in "A Course of Pure Mathematics", G. H. Hardy mentions

In order to calculate the value of a function for a given value of $x$ we must substitute the value for $x$ in the function in the form in which it is given.

Hence the function $f(x) = (x^{2} - 1)/(x - 1)$ is not defined for $x = 1$ and the function $g(x) = x + 1$ is defined for all $x$. Thus they have both have different domains and hence represent different function. Two (different) functions may take same values for some common points in their domain. Here $f, g$ take same values for all points in the domain of $f$.

I personally think it's silly to say that $$f(x) = \frac{x^{2}-1}{x+1}$$ at $$x = 1$$ is undefined. I've been giving this some thought lately. It's like saying that $$f(x) = x$$ is undefined at $$x = 0$$ just because it's equal to $$\frac{x^{2}}{x}$$ (multiply $$\frac{x}{1}$$ by $$\frac{x}{x}$$; if you don't agree that they're equal then you also don't agree that $$x \times 1 = x$$).

I completely agree that $$\frac{1}{x}$$ at $$x = 0$$ is undefined, but this is a different scanario. Just look at the graphs:

With $$\frac{1}{x}$$, the line completely swerves off into positive and negative infinity. $$\frac{x^2}{x}$$ looks completely identical to $$f(x) = x$$. With $$\frac{x^2}{x}$$ you can approach $$0$$ from both directions and both limits will be $$0$$. The notion of discontinuity doesn't seem particularly useful in this case.

Just my opinion, though. Clearly $$\frac{x^2}{0}$$ is undefined, which definitely indicates something strange about notation.

• The only reason you can 'cancel' the $x-1$ is because you assume that $x-1$ is not zero. for any number $a$, $a/a=1$ only if a is not zero otherwise it is 0/0, which is undefined.
– Jay
Sep 28 '15 at 23:54
• $x^2/x$ and $x$ are different functions in the sense that the former is undefined at $x=0$ while the latter is not. Sep 29 '15 at 16:12