# Condition for differentiability of a function

1. Jul 29, 2009

### peeyush_ali

given a function F:S-->R such that for every element belonging to "S" has both left hand derivative and right hand derivative and are equal to the derivative at that point.
Can we say that the function is differentiable..?

2. Jul 29, 2009

### g_edgar

Depends what S is. For S a region in the complex plane, it is not enough to to left and right derivatives. For S an interval in the line, it is enough to do left and right derivatives.

3. Jul 29, 2009

### peeyush_ali

dear g_edgar yes, "S" is a set of some real numbers..

4. Jul 29, 2009

### peeyush_ali

If that were true then i have an idea of getting a "discontinuous function" (only few functions) to be differentiable at the point of discontinuity by taking left and right hand derivatives.

For example, say f(x) = cosx is a continuous and differentiable function through out its domain. Consider another function g(x)
such that,
g(x) = cosx ,0=<x<pi/3
= 1+cosx , pi/3=<x<pi/2

I have chosen a function cosx which is very much differentiable and continuous till pi/3 and had defined another function 1+cosx from pi/3. so for g(x) , there is a point of discontinuity at x= pi/3 . graphically 1+cosx is same as cosx except for shifting it up by "1" unit due to which there is a discontinuity yet we can say that the left hand derivative and right hand derivatives are equal to each other and equal to derivative at that point x=pi/3 and hence g(x) is derivable at x=pi/3 provided differentiability has the only condition that left hand and right hand derivatives are equal and equal to the derivative at the point x=pi/3 .

so, the condition "differentiability of a point exists only if left hand derivative is equal to right hand derivative equal to the derivative at that point " is sufficient to say that differentiability exists at that point?

or in addition it have to be "continuous" simultaneously?

in this view can someone say why differentiability is defined as such i mean why is continuity needed for differentiability """in this case """ (my example).

Last edited: Jul 29, 2009
5. Jul 30, 2009

### HallsofIvy

No, this function does not have a right hand derivative at x= $\pi/3$. In order to find the derivative at $\pi/3$ you have to find the limit of the fraction
$$\lim_{h\rightarrow 0}\frac{1+ cos(x+ h)- \frac{1}{2}}{h}$$
That limit does not exist because the numerator does not go to 0. Notice that is different from talking about the derivative of 1+ cos(x) at $\pi/3$ because then you would be subtracting the value of 1+ cos(x) at $\pi/3$ which is 1+ 1/2= 3/2, not the value of g(x)= cos($\pi/3$)= 1/2.

6. Jul 30, 2009

### peeyush_ali

dear halls of ivy, what u wanted to put in the messege is not clear (i.e. some limit)
and the left hand and right hand limits of the derivatives indeed are equal and the value is
d/dx (cosx) = d/dx (1+cosx) = -sinx = -sin (pi/3) = - (root 3) /2

7. Jul 30, 2009

### HallsofIvy

Irrelevant. That "some limit" that I put in the message was the definition of the derivative. If you do not know the definition, it is unlikely you are going to be able to do much with derivatives. You cannot find the derivative at a point by taking the limits of the two derivatives on each side. Use the defining formula for a derivative: the derivative of f(x) at x= a is
$$\lim_{h\rightarrow 0}\frac{f(a+h)- f(a)}{h}$$

The derivative of your f(x) "from the right", at x= a, is
$$\lim_{h\rightarrow 0^+}\frac{f(a+h)- f(a)}{h}$$
For h> 0, $f(\pi/3+h)= 1+ cos(\pi/3+h)$ and that goes to $1+ cos(\pi/3)= 1+ \sqrt{3}/2$. But $f(\pi/3)$ is NOT $1+ cos(\pi/3)$. It is, according to your definition, $cos(\pi/3)= \sqrt{3}/2$. So that, while the demominator goes to 0, the numerator does not- it goes to 1. The limit, from the right, and so the derivative from the right, does not exist at $x= \pi/3$.

Last edited by a moderator: Jul 30, 2009
8. Aug 2, 2009

### peeyush_ali

Right handderivative :
lim h-->0+ (f(x+h)-f(x)) /h = lim h-->0+ (1+cos(pi/3 +h) -1- cos(pi/3) ) /h =

lim h->0+ ((1/2)cos(h) - ((root3)/2) sin(h) -1/2 ) /h
now this is of o/o form so apply "L hospital'srule.. we get,

lim h-->0+ ( (1/2) (-sin (h)) - ((root3)/2) cos(h) ) /1 = - (root3)/2 ...............(1)

Left hand derivative:

lim h-->0- (f(x-h) -f(x)) / h =limh--> 0- (cos(pi/3-h) -cos(pi/3) )/h =

lim h-->0- ((1/2)cos(h) +((root3)/2) sin(h) -(1/2)) /h =>again apply lhospitalsrule..sameasRHD
so WHO SAID THAT DERIVATIVE DOESNT EXIST..??? It exists and verymuch equal to ... ( (-root3)/2)

9. Aug 2, 2009

### peeyush_ali

the function includes the point f(pi/3) hence LHD corresponds to the derivative of "cosx"
RHD corresponds to the derivative of "1+cosx" .and they must be equal to the derivative at x=pi/3 ie at the point (pi/3 , 3/2) WHICH IS INCLUDED IN THE FUNCTION...

10. Aug 2, 2009

### HallsofIvy

I said it didn't! Didn't you notice? And did you not notice that YOU said that
g(x) = cosx ,0=<x<pi/3
= 1+cosx , pi/3=<x<pi/2
so your g(pi/3)= 1+ cos(pi/3)= 1+ 1/2= 3/2 Not the 1/2 you use in
"lim h-->0- ((1/2)cos(h) +((root3)/2) sin(h) -(1/2)) /h "

You can't use two different "f(pi/3)" values in the two limits.

A simpler example: f(x)= 1 if x is not equal to a, f(a)= 2. What is the derivative at x= a? Well, for all x< a or all x> a, it is simply 0. Clearly $\lim_{x\rightarrow a^-}f(x)= \lim_{x\leftarrow a^+}= 0$. Does that mean f'(a)= 0?

No, it does not: the derivative at x= a, if it exists, must be given by
$$\lim_{h\rightarrow 0}\frac{f(a+h)- f(a)}{h}= \lim_{h\rightarrow 0}\frac{1- 2}{h}$$
and that last limit does NOT exist.

(It is true that if a function, f, is differentiable at, say, x= a, then $\lim_{x\rightarrow a^-} f'(x)= \lim_{x\rightarrow a^+}f'(x)= f'(a)$).

Last edited by a moderator: Aug 2, 2009
11. Aug 3, 2009

### peeyush_ali

the definition of the function g(x)
is cosx for x lying between 0 and pi/3 provided pi/3 is excluded and zero is included
and is 1+cosx for x lying between pi/3 and pi/2 provided, pi/3 is included and pi/2 is also included
try to make a graph of it then you will try to understand.. "there is a hole at x=pi/3 in cosx and a dot in 1+cosx ..

I think this should make it..
best regards

12. Aug 3, 2009

### HallsofIvy

I think YOU need to try to understand. If a function is not continuous at a given point, it is not differentiable there. I have tried repeatedly to explain your error in taking the derivative. Either you are being hard headed or simply do not understand the definition of "derivative".

13. Aug 3, 2009

### slider142

Halls has already stated the reason why the derivative does not exist at x = $\frac{\pi}{3}$. The numerator of the difference quotient does not vanish in the left-sided limit for the simple reason that $g(\frac{\pi}{3})$, appearing in the numerator, belongs to the right-hand side of the graph, which is not connected. This makes the numerator approach the value -1, as the denominator vanishes. You can clearly see this in your graph, using your "hole" and "dot" for endpoint exclusion and inclusion, respectively. Draw the successive secants that the difference quotient gives the slope of.