# Simplify or bound using Big-O notation

I was following a research paper which have the following equation:

$$\left(1-\frac{1}{K}\right)^{K-i}\left[1-\left(1-\frac{1-p}{K}\right)^{i}\right]=\frac{i(1-p)}{K}+O\left(\left(\frac{i}{K}\right)^{2}\right)$$

Note that the asymptotics are with respect to $$K$$ and $$i$$ can vary from 1 to $$K$$. My understanding of how they obtained it is as follows:

$$\left(1-\frac{1}{K}\right)^{K-i} \leq 1-\frac{k-i}{k}+\frac{(k-i)(k-i-1)}{2k^2} \leq \frac{i}{k}+\frac{(k-i)^2}{2k^2}\leq1+O((\frac{i}{k})^2)$$.

Similarly, $$\left[1-\left(1-\frac{1-p}{K}\right)^{i}\right]\leq \frac{i(1-p)}{K}.$$

Are these steps right? Can someone let me know if there are any mistakes in these steps.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 6, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}