TITLE: How do I find the limit of this function?
QUESTION [8 upvotes]: 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?

REPLY [2 votes]: 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.