Why is $\frac {x^2 + 1} {x + 1}$ in $O(x)$?

757 Views Asked by At

For me I $\dfrac {x^2+ 1} {x+1}$ by $x^2$ since that's the term with the highest exponent making it: $\dfrac {1 + \frac 1 {x^2}} {\frac 1 x + \frac 1 {x^2}}$ but I'm not sure where to go from there. I looked at textbook solution and they have: $\dfrac {x^2+1} {x+1} = \dfrac {x-1+2} {x+1}$ but I'm not sure how they came up with that.

2

There are 2 best solutions below

0
On BEST ANSWER

If you copied the textbook's answer accurately, someone made an error in printing the textbook, because

$$\frac{x^2+1}{x+1} \neq (x-1+2)/(x+1) = 1.$$

What the book was probably meant to say was

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

which is a correct statement. For $x > 1$,

$$ x - 1 < (x - 1) + \frac{2}{x+1} < x,$$

so this is certainly $O(x)$.

2
On

For non-negative $x$ $$x^2+1 \le x^2+2x+1$$ so $$\frac{x^2+1}{x+1} \le \frac{x^2+2x+1}{x+1} = \frac {(x+1)^2}{(x+1)} = x+1$$ which is $O(x)$.