# Math Help - [help checking]Find a such that f'(0) exists:

1. ## [help checking]Find a such that f'(0) exists:

I'm not sure if i got this right since instead of using the limit definition i just differentiated, but...

Given the piecewise function: f(x) = sin(x) , x<= 0 ; f(x) = ax - x^2 , x>0
find the value a such that f'(0) exists.

What I did:
(sinx)' = cosx and (ax-x^2)' = a-2x ; then i set them equal and solve for f'(0) to get a=1

and that's my answer, which i think makes sense since when i graph it there doesn't seem to be any corners.

2. That looks good to me.

3. Originally Posted by Arturo_026
I'm not sure if i got this right since instead of using the limit definition i just differentiated, but...

Given the piecewise function: f(x) = sin(x) , x<= 0 ; f(x) = ax - x^2 , x>0
find the value a such that f'(0) exists.

What I did:
(sinx)' = cosx and (ax-x^2)' = a-2x ; then i set them equal and solve for f'(0) to get a=1

and that's my answer, which i think makes sense since when i graph it there doesn't seem to be any corners.

Well, yes: that's the correct answer, but the reason why it is so is not so clear: the derivative f'(0) exists iff both one-sided derivatives (the left one and the right one) exist finitely and they're the same, and that's why you "can" calculate the left and the right derivatives as you did and equal them.
But EVEN this is wrong since you're assuming by the above that the derivative not only exists but MUST be continuous at x = 0, which by no means must be so! So you've better to use the definition of the derivative f'(0) from the left (i.e., lim [f(x) - f(0)]/x, with x --> 0 from the left), then the same for the right derivative, and them equal them.
Since your function is a nice one you''ll get the same answer as you got at the beginning (i.e., because f'(x) does happen to be continous), but this time you'll do it "by the book"

Tonio