How do I find the limit of this function? This is a question from my calculus text. It says $$\lim\limits_{x\to1}\left(\frac{p}{1-x^p}-\frac{q}{1-x^q}\right)$$ where $p$ and $q$ are natural numbers. I know this is an infinity-infinity indeterminant form which can be converted to a $0/0$ form. I tried substituting $x=1+h$ where $h\to0$. But it is not working. What should I do?
 A: The simplest approach is to use the standard limit $$\lim_{x \to a}\frac{x^{n} - a^{n}}{x - a} = na^{n - 1}\tag{1}$$ We have
\begin{align}
L &= \lim_{x \to 1}\left(\frac{p}{1 - x^{p}} - \frac{q}{1 - x^{q}}\right)\notag\\
&= \lim_{x \to 1}\frac{p - px^{q} - q + qx^{p}}{(1 - x^{p})(1 - x^{q})}\notag\\
&= \lim_{x \to 1}\dfrac{p - px^{q} - q + qx^{p}}{\dfrac{(1 - x^{p})(1 - x^{q})}{(1 - x)(1 - x)}\cdot(1 - x)^{2}}\notag\\
&= \frac{1}{pq}\lim_{x \to 1}\frac{p - q + qx^{p} - px^{q}}{(1 - x)^{2}}\notag\\
&= \frac{1}{pq}\lim_{h \to 0}\frac{p - q + q(1 + h)^{p} - p(1 + h)^{q}}{h^{2}}\notag\\
&= \frac{1}{pq}\lim_{h \to 0}\dfrac{p - q + q\left(1 + ph + \dfrac{p(p - 1)}{2}h^{2} + \cdots\right) - p\left(1 + qh + \dfrac{q(q - 1)}{2}h^{2} + \cdots\right)}{h^{2}}\notag\\
&= \frac{1}{pq}\lim_{h \to 0}\dfrac{\dfrac{pq(p - q)}{2}\cdot h^{2} + \cdots}{h^{2}}\notag\\
&= \frac{p - q}{2}\notag\\
\end{align}
The ellipsis ($\cdots$) used above indicates a finite number of terms (based on positive integers $p, q$) and each term is of the form $c\cdot h^{r}$ where $r > 2$. This is because of the standard binomial theorem for positive integer index. In case numbers $p, q$ are not positive integers then we use the general binomial theorem and the ellipsis $(\cdots)$ needs to be replaced with $o(h^{2})$. 
A: This simply adds a bit of rigor to Claude Leibovici's answer.
Using Landau Big-O notation,
$$
\begin{align}
\frac{a}{1-x^a}
&=\frac{a}{1-(1+h)^a}\\
&=\frac{a}{1-1-ah-\frac{a(a-1)}2h^2+O\!\left(h^3\right)}\\
&=-\frac1h\frac1{1+\frac{a-1}2h+O\!\left(h^2\right)}\\
&=-\frac1h\left(1-\frac{a-1}2h+O\!\left(h^2\right)\right)\\
&=-\frac1h+\frac{a-1}2+O(h)\\
&=-\frac1{x-1}+\frac{a-1}2+O(x-1)\tag{1}
\end{align}
$$
Applying $(1)$ for $a=p$ and $a=q$ gives that
$$
\frac{p}{1-x^p}-\frac{q}{1-x^q}=\frac{p-q}2+O(x-1)\tag{2}
$$
Therefore,
$$
\lim_{x\to1}\left(\frac{p}{1-x^p}-\frac{q}{1-x^q}\right)=\frac{p-q}2\tag{3}
$$
A: You can rewrite the function in the form
$$
\frac{p(1-x^q)-q(1-x^p)}{(1-x^p)(1-x^q)}
$$
We assume $p>q>1$ just to do the next computation.
Consider $f(x)=qx^p-px^q+p-q$, so $f'(x)=pqx^{p-1}-pqx^{q-1}$ and
$$
f''(x)=pq(p-1)x^{p-2}-pq(q-1)x^{q-2}
$$
Hence $f'(1)=0$ and $f''(1)=pq(p-q)$. Observe that the same happens with no condition on $p$ and $q$ (provided they're nonzero). Therefore
$$
f(x)=\frac{pq(p-q)}{2}(x-1)^2+g(x)(x-1)^3
$$
for some polynomial $g$. 
Note also that
$$
x^p-1=p(x-1)+g_p(x)(x-1)^2
$$
for some polynomial $g_p$, so your limit is
$$
\lim_{x\to 1}
\frac{\frac{pq(p-q)}{2}(x-1)^2+g(x)(x-1)^3}
{(p(x-1)+g_p(x)(x-1)^2)(q(x-1)+g_q(x)(x-1)^2)}=\frac{p-q}{2}
$$
Note that actually the hypothesis that $p$ and $q$ are integer is not really used. The above are the Taylor expansions at $1$, where $g$, $g_p$ and $g_q$ are not necessarily polynomials, but the result is the same.
A: Considering $$A=\frac{p}{1-x^p}-\frac{q}{1-x^q}$$ let $x=1+h$ as you did; so $$A=\frac{p}{1-(1+h)^p}-\frac{q}{1-(1+h)^q}$$ Now, using the binomial theorem or Taylor series $$(1+h)^a=1+ah+\frac 12a(a-1)h^2+\cdots$$ $$1-(1+h)^a=-ah-\frac 12a(a-1)h^2+\cdots$$ Replace $$\frac{a}{1-(1+h)^a}=\frac{a}{-ah-\frac 12a(a-1)h^2+\cdots}=-\frac 1{h}\frac 1 {1+\frac 12 (a-1)h+\cdots}$$Now, long division gives $$-\frac 1{h}(1-\frac 12 (a-1)h+\cdots)$$ Now, replacing $a$ by $p$ and then $a$ by $q$ gives $$A\approx-\frac 1{h}(1-\frac 12 (p-1)h+\cdots)+\frac 1{h}(1-\frac 12 (q-1)h+\cdots)=\frac {p-q} 2+\cdots$$
Using one more term in the binomial expansion and doing the same would have given $$A\approx\frac {p-q} 2+\frac{q^2-p^2}{12}h$$ showing the limit and how it is approached.
