# Intuition for why the difference between $\frac{2x^2-x}{x^2-x+1}$ and $\frac{x-2}{x^2-x+1}$ is a constant?

Why is the difference between these two functions a constant?

$$f(x)=\frac{2x^2-x}{x^2-x+1}$$ $$g(x)=\frac{x-2}{x^2-x+1}$$

Since the denominators are equal and the numerators differ in degree I would never have thought the difference of these functions would be a constant.

Of course I can calculate it is true: the difference is $2$, but my intuition is still completely off here. So, who can provide some intuitive explanation of what is going on here? Perhaps using a graph of some kind that shows what's special in this particular case?

Thanks!

BACKGROUND: The background of this question is that I tried to find this integral:

$$\int\frac{x dx}{(x^2-x+1)^2}$$

As a solution I found:

$$\frac{2}{3\sqrt{3}}\arctan\left(\frac{2x-1}{\sqrt{3}}\right)+\frac{2x^2-x}{3\left(x^2-x+1\right)}+C$$

Whereas my calculusbook gave as the solution:

$$\frac{2}{3\sqrt{3}}\arctan\left(\frac{2x-1}{\sqrt{3}}\right)+\frac{x-2}{3\left(x^2-x+1\right)}+C$$

I thought I made a mistake but as it turned out, their difference was constant, so both are valid solutions.

• Did you actually graph both functions? That would tell a lot – imranfat May 3 '18 at 14:26
• @imranfat desmos.com/calculator/njhbjs54rv. Looks strangely like $2$ to me. Did you actually graph both functions? – Rhys Hughes May 3 '18 at 14:31
• @Oldboy Actually, it is. – badjohn May 3 '18 at 14:31
• It doesn't matter that the numerators have different degrees. What matters is that their difference is a multiple of the denominator. – user856 May 3 '18 at 16:14
• Fascinating background: at face value, I would wager that a lot of instructors would mark your answer wrong without paying much attention to how you got to it - and that most students wouldn't know to ask for a review. It is not obvious that they are both valid. I'd love to hear from educators here how would they approach this. – Euro Micelli May 4 '18 at 0:23

It is just a bit of clever disguise. Take any polynomial $p(x)$ with leading term $a_n x^n$.

Now consider $$\frac{p(x)}{p(x)}$$ This is clearly the constant $1$ (except at zeroes of $p(x)$).

Now separate the leading term: $$\frac{a_n x^n}{p(x)} + \frac{p(x) - a_n x^n}{p(x)}$$

and re-write to create the difference:

$$\frac{a_n x^n}{p(x)} - \frac{a_n x^n - p(x)}{p(x)}$$

Obviously the same thing and hence obviously still $1$ but the first has a degree $n$ polynomial as its numerator and the second a degree $n - 1$ or less polynomial.

Similarly, you could split $p(x)$ in many other ways.

Would you be surprised that the difference of $\dfrac{2x^2+x+1}{x^2}$ and $\dfrac{x+1}{x^2}$ is $2$?

• Not sure who is responsible for that "from review". This actually provides more of an answer to the question asked than the majority of the posts (though there are others that do better). – Paul Sinclair May 3 '18 at 18:14
• It absolutely does provide an answer to the question, and what's more it's a good answer. It gives a simpler example of the phenomenon which the OP requests intuition for, and the intuition is easier to obtain in this simpler example. – James Martin May 3 '18 at 18:27
• @JamesMartin: Indeed. How about: Would you be surprised that the difference of $\frac{1234}{5}$ and $\frac{234}{5}$ is $200$? – user21820 May 4 '18 at 11:26
• Yes, this is still surprising. It is roughly equally as surprising as the difference in the original question (to me anyways). – Nick Alger May 4 '18 at 21:21
• @Nova Often repeating a question with slightly different values IS the best answer. Countless times I have done this with students with great success, because it can relate a situation that the student already has intuition for to the one that they are stumped on. Maybe this answer doesn’t work for some, but that doesn’t inherently make it a bad answer. – wgrenard May 6 '18 at 7:30

I'm not sure anyone is speaking to your observation that the two numerators have different degrees.

Let's flip this around the other way:

\begin{align*} \frac{x-2}{x^2-x+1} + 2 &= \frac{x-2}{x^2-x+1} + 2\frac{x^2-x+1}{x^2-x+1} \\ &= \frac{2x^2 -x}{x^2-x+1} \text{.} \end{align*} That is, we started with a thing having a linear numerator and added a constant to it. But when we brought the constant to have a common denominator, it picked up a degree two factor. Then the addition was forced to produce a degree two sum.

To sum up, in the context of rational functions, when you add constants, you are adding polynomials having the degree of the denominator to the polynomials in the numerators. So constants effectively have "degree two in the numerator" in your example.

• +1 for this > "Constants effectively have "degree two in the numerator" in your example." – Kartik May 4 '18 at 14:20
• This deserves a lot more upvotes for the "degree two in the numerator" note. It reconciles intuition to the raw result. – Lawrence May 5 '18 at 15:09
• A further +1 for "To sum up". – LSpice May 10 '18 at 5:34

Look at it in reverse:

Take a polynomial fraction and add it to a constant. The result will be a polynomial fraction, with the same denominator and a different polynomial as the numerator.

This belongs to a specific set of questions "you cannot really answer to your students" if you are a teacher.

The difference is $2=\frac{2(x^2-x+1)}{x^2-x+1}$. This is why this seems weird (but true). Even this seems weird: $$\frac{15}{7}-\frac{1}{7}=2$$
The numerators differ by 14 (not 2) but the denominators are equal. The best is to try and explain this to yourself why this perfectly fine.

Note that in general given a rational function

$$f(x)=\frac{p(x)}{q(x)}\implies g(x)=f(x)+c=\frac{p(x)+c\cdot q(x)}{q(x)}$$

and $\deg(p(x)+c\cdot q(x))\le \max\{\deg(p(x)),\deg(q(x))\}$.

• Why? Where is "the difference"? – Rolazaro Azeveires May 5 '18 at 5:59
• @RolazaroAzeveires It is just a generalized way to see that two rational function can differ for a constant c even if denominators are equal and the numerators differ in degree, that's exactly the point of the OP. – user May 5 '18 at 6:44
• I think it is just a matter of preference, from my point of view this observation suffices to answer the OP completely and maybe also the upvoters have the same idea. There are many other answers here with concrete examples and discussion so the asker have a lot of points on view on that and you also are free to add your own answer according to your best interpretation. Thanks anyway for your advice and suggestions on that. Bye! – user May 6 '18 at 11:13

$$(2x^2-x)-(x-2)=2x^2-2x+2$$ Hence$$f(x)-g(x)=2\bigg(\frac{x^2-x+1}{x^2-x+1}\bigg)=2(1)=2$$

In effect, this pair of equations is a very specific case where the numerator and denominator end up lining up, and thus you get a constant for all values.

• What kind of an answer is this? He already knows that. – Aqua May 3 '18 at 14:31

Since the denominators are equal and the numerators differ in degree I would never have thought the difference of these functions would be a constant.

When the numerators differ in degree, the difference between the numerators is a nontrivial polynomial that goes to infinity as $x\to\pm\infty$.

However, nobody says that this polynomial cannot grow at the same rate as the (equal) denominators, in which case the ratio will be bounded (and in particular possibly constant). There's nothing in your observation "the denominators are equal and the numerators differ in degree" that link the denominator to either the numerators or their difference, so you have no reason to think the difference in numerators should dominate the growth of the entire fraction.

• Eactly, i already wanted to provide an answer before seeing this, when $x->\infty$ the first function tends to $2$, the second tends to $0$, which are both constants and give out a cte difference, this doesn't apply when the numerator is bigger than the denom, if the denom is 1 the difference would be diverging but once you divide it by a polynomial of order 2, things change to converge. – Abr001am May 4 '18 at 14:14

Maybe instead of integrating you need just differentiating.

$$\frac{df}{dx}=\frac{(2x^2-x)(2x-1)-(x^2-x+1)(4x-1)}{denom^2}\\ =\frac{x^2-4x+1}{denom^2}$$

In the other hand:

$$\frac{dg}{dx}=\frac{(x-2)(2x-1)-(x^2-x+1)}{denom^2}\\ \ =\frac{x^2-4x+1}{denom^2}=\frac{df}{dx}$$

See that both functions have same derivates, which means they differ by the same value from $x$ to $x'$ , this only means they have a same growth rate and they have same difference all along the range of x axis.

• This is something OP himself did. He was solving an integral and found an alternate answer $g$. Since $f$ and $g$ are solutions to the same integral, they defer by a constant just like you demonstrate here. OP is asking for an intuition why the two rational functions defer by only a constant. – Cyriac Antony May 6 '18 at 6:03
• What do you intend to do with a primitive, why at all one think to ascend to an integral? one function may be integrated in an infinitely many ways but what's the point ? look in the op's post that he already found two functions completely different, you are missing the point. The intuition is clear, you shouldn't compare the numerator unconsiderably of the rest of the function, you should take it all into account, for example $f$ and $g$ are mutually excluding eachother in a derivate of the form $f+g$, but they are mutual-inclusive in $f/g$. Appearence is deceiving. – Abr001am May 6 '18 at 12:46

You can construct a similar puzzle from the (simpler) observation that

$$\frac{x}{x+1} + \frac{1}{x+1} = 1 .$$

Translating, that's the same as $$\frac{u-1}{u} + \frac{1}{u} = 1$$ which isn't surprising at all.

• Yes, but in my example the degrees of the numerators are different, which caught me off guard – GambitSquared May 3 '18 at 14:34
• The degrees are different in my example too. But I agree that yours is at first surprising. Note: this kind of rational function identity is useful sometimes when calculus instructors want to make up problems that look harder than they are. – Ethan Bolker May 3 '18 at 14:35

Another way of stating what everyone has said:

$2x^2 - x= 2(x^2-x+1) + x - 2$

$\Rightarrow 2x^2-x = x-2 \mod x^2-x+1$

Because if $P\ and\ Q\ are\ polynomials$ then, $$\deg \left( P\pm Q \right)\le max\left( \deg \left( P \right),\deg \left( Q \right) \right)$$ where $deg$ is the degree of the polynomial. See this link

Here's another view on the problem:

Let's look at the fraction with the higher degree: $$f(x)=\frac{2x^2-x}{x^2-x+1}$$ We note that the degree of the numerator is the same as the one of the denominator.

Now whenever the numerator's degree is at least as large as the denominator's degree, we can do polynomial division. The result is a polynomial whose degree is the difference between the numerator's and the denominator's degree, and a rest whose degree is less than the denominator's degree.

Now since numerator and denominator have the same degree, the difference of the degrees is zero. But a polynomial of degree zero is a constant. And the division rest will be of lesser degree.

Let's do the polynomial division explicitly: $$\begin{array}{llccl} &(2x^2-\ \ x) & / & (x^2-x+1) &=& 2\\ -&\underline{(2x^2-2x+2)}\\ & \ \ \ \ \ \ \ \ \ \ \ \ \ x \ - 2 \end{array} %\begin{array}{rrrrcccl} %&(2x^2 & -x) & & / & (x^2-x+1) & = & 2\\ %-&(2x^2 & -2x & +2)\\ %\hline % & & x & -2 %\end{array}$$ You surely will recognize the rest as the numerator of $g(x)$

So, whenever you have a rational function whose numerator and denominator, after cancelling out, have the same non-zero degree, it is not only possible, but guaranteed that there exists another rational function with lesser degree in the numerator which differs from the original rational function only by a constant.

• BTW, does anyone know how to make the horizontal line end at the end of the polynomial above? – celtschk May 4 '18 at 5:51
• @farruhota: That first option destroys the alignment between the terms, and therefore is worse than the too-long line. That second option defeats the whole purpose of writing the polynomial division in its standard form. – celtschk May 4 '18 at 6:48
• How about this: $\begin{array}{ll} &(2x^2-x) & / (x^2-x+1) = 2\\ -&\underline{(2x^2-2x+2)}\\ & x-2 \end{array}$ – farruhota May 4 '18 at 7:04
• @farruhota: Still doesn't correctly align the terms. – celtschk May 4 '18 at 7:10
• Oh well, the rest should be adjusted: $\begin{array}{ll} &(2x^2-\ \ x) & / (x^2-x+1) = 2\\ -&\underline{(2x^2-2x+2)}\\ & \ \ \ \ \ \ \ \ \ \ \ \ \ \ x \ - 2 \end{array}$ – farruhota May 4 '18 at 7:16

I feel that it's only natural that intuition would fail you in cases like these. If you wrote the two functions out as $$f(x)=\frac{2\left(x^2-x+1\right)+\left(x-2\right)}{x^2-x+1}$$ $$g(x)=\frac{x-2}{x^2-x+1}$$ it would be obvious that the difference between them was 2. This is the first thing you could trip over, the degree of the numerator don't actually differ by 1, they are the same.

I guess if you made it a rule to divide whenever you have a rational function where the degree of the numerator is greater than or equal to the degree of the denominator until it isn't, you would get consistent results. (Kinda like how you learn waaay back how $\frac{13}{7}$ is an improper fraction, because it's actually bigger than a whole number, and that you should write it as $1\frac{6}{7}$. a function $f(x)=\frac{P(x)}{Q(x)}$ where the degree of $P(x)$ is greater than or equal to the degree of $Q(x)$ is called an improper rational function.)

But, and this might be another thing that's bugging you about this question, you can't just do that! (As my algebra teacher used to exclaim in exasperation.) You introduce a new constraint: $x^2-x+1\neq0$. Which isn't relevant if x is real, but does change things up a bit if it s a complex number.

This is probably what you get when you graph the two functions $f$ and $g$.

But if you allow for complex values of $x$, it can also look like this:

(Sans the vertical line at x=0.5, I don't know why that is happening, probably a limitation in the graphing engine on desmos.)

Not so obvious that the difference between the two is 2 in this case...

Sorry, I just realized this probably doesn't answer your question on how you can reconciliate this apparent discrepancy with your intuition, but I thought explaining why it may not be that clear-cut would help at least a little bit.

Playing with the parameters used in the graph might help further your understanding, here's a link to the interactive graph, with a little more in depth graphical interpretation of why you might doubt what you logically "know" to be true.

As for the equations I used in place of the given ones... You'll just have to trust my algebra (which you shouldn't in critical situations, but I think this is safe enough hehe). I did them on a legal pad, but I'll type them up if anyone insists.

Since the denominator is the same , you subtract one numerator from the other. In this special case you find the resultant numerator is twice the denominator. Feels like that was much simpler than the rest of your background calculus.

It must be very clear to you that $11/3$ and $2/3$ defer by an integer. Why is this so? Because in the world $$modulo 3$"$, 11 and 2 are but the same. In the same vein, we can say that in the world of $$modulo $x^2-x+1"$, $2x^2-x$ and $x-2$ are but the same because $2x^2-x=2(x^2-x+1)+x-2$. When we are in such a world, the same polynomial may appear in different forms with different "degrees". So in a world such as the ideal generated by $x^2-x+1$ (ie $<x^2-x+1>$ ), degree is no longer retained. One's intuition may fail here because one is not familiar with such a world where degree is not so well behaved.
• The question is not about constants; it is about degree. $\frac{x^3+1}{x^2+2}$ and $\frac{-2x+1}{x^2+2}$ also defer by a constant (polynomial) – Cyriac Antony May 6 '18 at 6:11