# Limit right hand side at 0 and derivative

Suppose $$f: (0,1) \to \mathbb R$$ differentiable such that $$\lim_{x\to0^+}f(x) = A$$ and $$\lim_{x\to0^+}xf'(x)=B.$$ Find the value of B.

My attempt:

We have $$(xf(x))' = f(x) + xf'(x) \ \ \ \ \ (1)$$ But $$(xf(x))'$$, in the limit $$x\to0^+$$, is $$\lim_{x\to0^+}\frac{xf(x)}{x} = A$$ So taking limits on both sides of $$(1)$$, we have $$B = 0$$.

Is my approach correct?

If it isn't correct, how to solve this?

• You are assuming that $xf'(x)$ is continuous at $0$. This is not given. Commented May 8, 2023 at 11:33
• What justifies your claim $\lim_{x\to0^+}(xf(x))'=\lim_{x\to0^+}\frac{xf(x)}{x}?$ Commented May 8, 2023 at 11:35
• @AnneBauval The definition of derivative Commented May 8, 2023 at 11:44
• @geetha290krm but I just know the continuity at right hand side, and I only used this Commented May 8, 2023 at 11:45
• @KennyWong OP's solution is nowhere near being correct. Commented May 8, 2023 at 11:49

Note that the limit $$\lim_{x\rightarrow 0^+}xf'(x)$$ may not exist. For a counterexample, consider the function $$f(x) = x\sin(1/x)$$. However, if we are given that the limit exists then we may use L'Hopital's rule: $$A = \lim_{x\rightarrow 0^+}\frac{xf(x)}{x} = \lim_{x\rightarrow 0^{+}}\frac{xf'(x)+f(x)}{1} = A+B\implies B = 0.$$
Let us prove by contradiction that $$B=0.$$ Assume wlog $$B>0,$$ and let $$\epsilon:=\frac B2.$$ For every positive $$x$$ sufficiently close to $$0,$$ we have both $$f(x)-A<\epsilon$$and (by the MVT)$$\frac{f(x)-A}x=f'(c_x)>\frac{B-\epsilon}{c_x}>\frac{B-\epsilon}x=\frac\epsilon x.$$ Whence the contradiction $$\epsilon<\epsilon.$$
Your approach is essentially correct. But we need to address some fine points. Let's define a funtion $$g$$ such that $$g(0)=0$$ and $$g(x) =xf(x)$$ if $$x\in(0,1)$$. Then $$g$$ is continuous on $$[0,1)$$ based on hypotheses in question.
Now right derivative of $$g$$ at $$0$$ is $$\lim_{x\to 0^+}g(x)/x=A$$. Further we have $$g'(x) =xf'(x) +f(x)$$ for all $$x\in(0,1)$$ and hence $$g'(x) \to A+B$$ when $$x\to 0^+$$. It is standard result that derivatives can't have jump discontinuity and hence the right limit of $$g'(x)$$ must match the right derivative of $$g$$ at $$0$$. Hence $$A=A+B$$ ie $$B=0$$.