# Find numbers $A,B$ such that the function is differentiable at $x=0$

I have the following function:

And the statement says:

Find $$A,B$$ such that $$f$$ is differentiable at $$x=0$$

My attempt was:

$$f$$ will be differentiable at $$0 \iff \lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$ exists.

Solving the lateral limits, i got:

$$\lim_{h\to 0^+}\frac{f(0+h)-f(0)}{h} = \lim_{h \to 0^+} -A\frac{1-\cos(3h)}{h} +\lim_{h \to 0^+}3A\frac{\sin(h)}{h} + \lim_{h\to 0^+}\frac{Bh}{h} = 3A+B$$

$$\lim_{h\to 0^-} \frac{f(0+h)-f(0)}{h} = \lim_{h\to0} h^4+h = 0$$

So, if $$3A + B = 0$$ holds, the function is differentiable at $$x = 0$$.

However, this doesn't not work. Per example, the values $$A = 2, B = -3$$ holds the condition, but creates a discontinuity at $$x = 0$$. This is weird to me, since the conditions to be differentiable are $$3A +B = 0$$ they should also work for continuity of the function, since differentiability implies continuity.

So, what is wrong?

• You need another condition on A and B that guarantees continuity (i.e. matches the value at 0). These two conditions together completely determines A and B (hopefully, supposing the question is well-designed) Also, the differntialbility condition only involves left- and right-derivatives. A function can clearly have both of these, while also being discontinuous (at a point). (Take a function that is zero on the negative x-axis, and one on the positive x-axis) Jun 17 '20 at 17:22
• So you need to have the condition for continuity $\lim_{x\to 0}f(x)=f(0) \iff 6=A+B$ as well. Jun 17 '20 at 17:22
• @BenjaminWang But, by equating the lateral derivatives $(3A + B = 0)$ I would be assuring that the derivative exists at the point and therefore is continuous at that point, so why i need to guarantee that? Jun 17 '20 at 17:34
• @AnuragA If I ensure differentiability (seeing that there are lateral derivatives and equalizing them), why should I ensure continuity? Continuity is within differentiability. Jun 17 '20 at 17:35
• @EduardoS. When you are just matching the side limits for the derivative, you are basically matching the slope of the tangent line at the left and the right. But the tangent lines could be parallel (so same slope) but with a discontinuity. Just think about $f$ being $0$ on $[0,1)$ and $f(x)=1$ on $[1,2]$. Jun 17 '20 at 17:38

Note that $$f(0)=A+B$$. Therefore$$\lim_{h\to0^-}\frac{f(h)-f(0)}h=\lim_{h\to0^-}\frac{x^5+x^2+6-A-B}h$$and this limit exists if and only if $$A+B=6$$. So, the only solution of your problem is the only pair $$(A,B)$$ such that$$\left\{\begin{array}{l}A+B=6\\3A+B=0.\end{array}\right.$$Can you take it from here?
• The problem is that you did not assure differentiability. When you computed the limit $\lim_{h\to0^-}(f(h)-f(0))/h$, you assumed that $f(0)=6$. But you cannot assume that. What you know about $f(0)$ is that it is equal to $3A+B$ and that is the assumption that you must use. Jun 17 '20 at 17:35
• Ohh, that was my mistake. I use $f(0)$as $x^5 + x^2 +6$ instead of the $A(cos3x + 3sinx) + b(x+1)$, thanks ! Jun 17 '20 at 17:41