1. ## A weird Derivative

I'm trying to find the first and second derivative (at 0) of a rather strange function. Let g(x) = 1 if x is rational, -1 if x is irrational. Let f(x) = x^3* g(x). I convinced myself earlier that the first and second derivative at 0 does not exist as the function is not continuous, but i'm not sure if i'm right. Is there a good way to do this using the definition of a derivative(I can't figure out how), any other help would be great too.

2. ## Re: A weird Derivative

functions must be continuous at a point for any derivatives to exist at that point. Your function is rather discontinuous everywhere.

3. ## Re: A weird Derivative

Originally Posted by glambeth
I'm trying to find the first and second derivative (at 0) of a rather strange function. Let g(x) = 1 if x is rational, -1 if x is irrational. Let f(x) = x^3* g(x). I convinced myself earlier that the first and second derivative at 0 does not exist as the function is not continuous, but i'm not sure if i'm right. Is there a good way to do this using the definition of a derivative(I can't figure out how), any other help would be great too.
Do you understand that $|f(x)|=|x^3||g(x)|\le |x^3|~?$ WHY?

4. ## Re: A weird Derivative

@plato, i do see that as |g(x)| = 1. But, how would that be incorporated into the problem? I'm not sure where you're going with that. Also, i'm pretty sure I just proved the function is continuous at 0.

5. ## Re: A weird Derivative

Plato's point is that this function is continuous at x= 0. [tex]\lim_{x\to 0} f(x)= f(0)= 0[tex].

To find the derivative at x= 0, use the definition: $\lim_{h\to 0} \frac{f(h)}{h}$. But $\frac{f(h)}{h}= \frac{h^3g(h)}{h}= h^2g(h)$. What happens to that as h goes to 0? And, of course, to find the second derivative, do that again.

Do you see why f(x) is defined as $x^3g(x)$? What would be true if f had been defined as $x^2 g(x)$?

6. ## Re: A weird Derivative

ack my bad.. it is continuous at zero. And I answered a similar question to this just the other day. Sloppy.

7. ## Re: A weird Derivative

Originally Posted by glambeth
@plato, i do see that as |g(x)| = 1. But, how would that be incorporated into the problem? I'm not sure where you're going with that. Also, i'm pretty sure I just proved the function is continuous at 0.
Here is what I was asking you: $\frac{{f(0 + h) - f(0)}}{h} = ?$

Can you find ${\lim _{h \to 0}}~=~?$

8. ## Re: A weird Derivative

@HallsOfIvy Okay, that makes sense I just used what plato showed me to show the function is continuous at 0. This makes sense so both the first and second derivative are 0. To compute the second derivative you just do the same thing but set f(x) = x^2g(x), right?

So, if f(x) was defined as x^2 g(x) the second derivative at 0 would just be g(x) = 1, or would it be defined. I guess i'm not sure if lim h-> 0 of g(h) is 1 or undefined. I'm starting to think it is undefined as the rationals are dense in R; hence, its oscillating between -1 and 1. Right?

9. ## Re: A weird Derivative

Originally Posted by glambeth
@HallsOfIvy Okay, that makes sense I just used what plato showed me to show the function is continuous at 0. This makes sense so both the first and second derivative are 0. To compute the second derivative you just do the same thing but set f(x) = x^2g(x), right?

So, if f(x) was defined as x^2 g(x) the second derivative at 0 would just be g(x) = 1, or would it be defined. I guess i'm not sure if lim h-> 0 of g(h) is 1 or undefined. I'm starting to think it is undefined as the rationals are dense in R; hence, its oscillating between -1 and 1. Right?
It breaks down when f(x) = 2x g(x). Let's just look at f(x) = x g(x)

lim (h-->0) ((x+h)g(x+h) - x g(x))/h

Evaluating this at x=0 we get

lim(h-->0) (h g(h) - 0)/h = g(h), and this limit does not exist

you've lost the factor of xn that was causing your xn g(x) to have a limit at 0

so no, your second derivative of x2 g(x) does not equal 2. It doesn't exist.

10. ## Re: A weird Derivative

Ok, that's the point I was raising above in my last post. But wouldnt the derivative of x^2*g(x) just be xg(x) not 2xg(x)?

11. ## Re: A weird Derivative

you're mucking about with the rationals being densely embedded in the reals and you ask if d/dx x2 is x not 2x?

12. ## Re: A weird Derivative

That's clearly true, but (f(x+h) -f(x))/h = h^2 * r(h)/h = hr(h). Right?

13. ## Re: A weird Derivative

Originally Posted by glambeth
That's clearly true, but (f(x+h) -f(x))/h = h^2 * r(h)/h = hr(h). Right?
when you work these limit problems any squared and higher terms of differentials (and h is one even if it isn't labeled so) get tossed.

((x+h)g(x+h))2 - x2 g(x)2 = (x2 + 2xh + h2)*1 - x2*1

now we toss the h2 and get 2xh. Dividing by h you get 2x and at 0 this is 0.

The only effect g(x) has on the problem is to require there be at least a power of x multiplying g(x) in order for it's limit at 0 to converge.