Differentiation of Piecewise Functions

EXCEPT that it should be x> 3, not x>= 3. If you want to be technical, the derivative does not exist at x= 3 because the function is not differentiable at x= 3. But you can still write that as f'(x)= 1 when x> 3 and 2x when x< 3. That is, you can write the expression for the derivative, but you can't evaluate it at x= 3. The point is that, while the two parts of the derivative expression are correct, the entire expression is not, because there is no derivative at x= 3. The correct way to write the expression for the derivative is
  • #1
ghostanime2001
256
0
how do you differentiate these equations:

f(x) =
x^2 x < 3
x + 6 x >= 3

2. f(x) = abs(3x^2 - 6)

3. f(x) = abs(abs(x) - 1)

Thank your for your help.
 
Physics news on Phys.org
  • #2
You can rewrite the functions by splitting their domains. Assuming these functions have no restrictions imposed on them, by definition, when their values are negative, they will be multiplied by -1 and will be unaltered for positive values (the abs function). You can find out on what domain the function will have negative values and then multiply it by -1.
 
  • #3
Welcome to PF, ghostanime2001. As you should have read before you signed up for the site, this is first of all, not the correct forum for homework help, and that even if it were, we could not offer you help as you have not shown us a reasonable attempt at the problem - we are here to help, but not to give you the solutions. I will contact one of the mods to move this thread to the homework section for you, and in the mean time you can post up your try.

EDIT: Well, a bit too slow.
 
  • #4
You just go back to the definition of [tex]abs[(f(x)][/tex]

[tex]abs[f(x)] = f(x) \forall f(x) \geq 0[/tex]
[tex]abs[f(x)] = -f(x) \forall f(x) < 0[/tex]

And differentiate separately.

In other words, 'splitting the domains', as someone above said.
 
  • #5
My answer is nearly correct with a few minor errors i cannot quite explain correctly. This is what my worksheet says:

[tex]
f(x)=\left\{\begin{array}{cc}x^2,&\mbox{ if }
x<3\\x+6, & \mbox{ if } x\geq 3\end{array}\right
[/tex]

That was the question in LaTex to make it clear and i differentiated each domain seperately correctly but the sign of the intervals didnt change when i solved it. In my answer sheet the signs of the interval changed. To show you in LaTeX:

[tex]
f'(x) =\left\{\begin{array}{cc}2x,&\mbox{ if }
x<3\\1, & \mbox{ if } x>3\end{array}\right
[/tex]

Why did the sign in [tex]f(x)[/tex] 2nd interval go from [tex]x\geq 3[/tex] to

[tex]
x>3
[/tex]

after it got differentiated ? How and Why did the interval sign get changed ?
 
Last edited:
  • #6
Think about what the derivative is at x=3.

edit added:
It has to do with the definition of the derivative, and the concept of limits.
 
  • #7
Is it because in [tex]f(x)[/tex] 3 is the solution of the second part of the domain and not the solution for the first half of the domain ? So i have to see what happens as x-->3 (the concept of limits) Is that correct ? :S
 
  • #8
So i have to see what happens as x-->3

Yes. What is

lim[h-->0] of

[f(3+h) - f(3)] / h
 
  • #9
[tex]
\lim_{h \to 0} f(x) = \frac{f(3+h) - f(3)}{h} = \frac{[(3+h)+6] - 9}{h} = \frac{[3+h+6]-9}{h} = \frac{3+h+6-9}{h} = \frac{h}{h} = 1
[/tex]


?? Is this correct I am not very sure :S
 
Last edited:
  • #10
f(3+ h) is NOT (3+h)+ 6. That is only true for x>= 3.
What you give is
[tex]\lim_{h\rightarrow 0^+}\frac{f(3+h)- f(3)}{h}[/tex]
What is
[tex]\lim_{h\rightarrow 0^-}\frac{f(3+h)- f(3)}{h}[/tex]
 
Last edited by a moderator:
  • #11
Halls is right. What happens when h is negative?
 
  • #12
okay I am having a lot of trouble right now. How did [tex]x\geq3[/tex] get changed to
[tex]
x>3
[/tex]

Thats pretty much my question.
 
  • #13
The solution is telling you that derivitive expression [ f'(x)=1 ] is not valid at x=3.

Try evaluating, for h = -0.01:
[f(3+h) - f(3)]/h

The answer is not even close to 1.
 
  • #14
Remember the definition of limit?

"[itex]\lim_{x\rightarrow a} f(x)= L[/itex] if and only if, for any [itex]\epsilon> 0[/itex] there exist [itex]\delta> 0[/itex] such that if [itex]0< |x- a|< \delta[/itex] then [itex]|f(x)- L|< \epsilon[/itex]."

Notice that "[itex]0< |x- a|[/itex]"? That means that what happens at x= a is irrelevant to the limit. That mean, in turn, that in the definition of derivative what happens when h= 0 is irrelevant.

By the way, the "[itex]x\rightarrow 3^-[/itex]" and "[itex]x\rightarrow 3^+[/itex]" were errors. I forgot that we were specifically talking about the derivative and not just a limit at x= 3. I corrected that after I read Redbelly98's comment.
 
  • #15
still unclear :( I'm trying my best to understand but my brain is getting fried -_-'
 
  • #16
[tex]f(x)=\left\{\begin{array}{cc}x^2,&\mbox{ if }
x<3\\x+6, & \mbox{ if } \overbrace{x\geq 3}\end{array}\right
[/tex]

I want to know exactly why and HOW (Algebraically) [tex]\overbrace{x\geq3}[/tex] has changed into [tex]\overbrace{x>3}[/tex]


[tex]
f'(x)=\left\{\begin{array}{cc}2x,&\mbox{ if }
x<3\\1, & \mbox{ if } \overbrace{x>3}\end{array}\right
[/tex]
 
  • #17
The derivative is a limit, by definition.

There are right-hand limits, where the parameter is approached from values greater than it.

And there are left-hand limits, where the parameter is approached from values less than it.

(If you're confused by this, review left-hand and right-hand limits in your textbook or class notes.)

The left- and right-hand limits must both exist, and agree with each other, for "the limit" to exist.

By not including x=3 in the solution, that tells us the limit (that defines the derivative, f'(x)) does not exist for x=3.

It has to do with the right-handed and left-handed limits at x=3. I.e., either one of them doesn't exist, or they don't agree with each other.
 
  • #18
[tex]
\[ \lim_{x \to 3^+} f(x) = 3 + 6 = 9 \]

\[ \lim_{x \to 3^-} f(x) = (3)^2 = 9 \]

\[ \lim_{x \to 3^+} f(x) = \lim_{x \to 3^-} f(x) = 9 \]

\[ \lim_{x \to 3} f(x) = 9 \]
[/tex]

It looks like they do agree. So then why did the sign from [tex]x\geq3[/tex] get changed into [tex]x>3[/tex]. 3 was part of the solution but then after differentiating it it is not part of the solution ? that does not make sense to me neither does it explain what's going on. The right and left limits equal 9 that means at x=3 there is a point which makes the f(x) continuous but not necessarily smooth and continuous.
 
  • #19
What you have shown is that the function is continuous at x= 3. The problem, however, asked about the derivative.

[tex]\lim_{h\rightarrow 0^-}\frac{f(3+h)- f(3)}{h}= \lim_{h\rightarrow 0}\frac{(3+h)^2- 9}{h}= \lim_{h\rightarrow 0}\frac{6h+ h^2}{h}= \lim_{h\rightarrow 0}6+ h= 6[/tex]

[tex]\lim_{h\rightarrow 0^+}\frac{f(3+h)- f(3)}{h}= \lim_{h\rightarrow 0}\frac{(3+h+6)- 9}{h}= \lim_{h\rightarrow 0}\frac{h}{h}= 1[/tex]

Since those two are not the same the limit itself does not exist and the function is not differentiable at x= 3.

Notice that if you differentiate the two parts separately you get, as you showed before
[tex]f'(x)=\left\{\begin{array}{cc}2x,&\mbox{ if }x<3\\1, & \mbox{ if } {x>3}\end{array}\right [/tex]


At x= 3, 2x becomes 6 while the other has a limit of 1: exactly the one sided limits above. While the derivative of a function does not have to be continuous, it does satisfy the "intermediate value property": if the two parts of the derivative do not give the same limit, the derivative cannot exist there.
 
Last edited by a moderator:
  • #20
It still doesn't explain why the sign got changed ! I want to know HOW and if so, how did it get changed algebraically :( I already know what u said HillofIvy. I already proved the derivative but how does the SIGN GET CHANGED ! :(:(:( I've been working on this for days and I still can't understand WHY.
 
Last edited:
  • #21
It wasn't algebra that changed the >= into a >, so let me summarize the thought process here.

We have an expression for f(x) valid for x >= 3.

We differentiate that expression to get f'(x), and our initial thought is that the f'(x) expression is valid for x >=3, just like the f(x) expression was.

HOWEVER ... we are able to show the f'(x) expression is not valid at x=3. So we remove x=3 from the set of numbers x>=3, and what remains is x>3.
 
  • #22
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh


OH my god o_O I see it now.

&& another thing. Is it because in F(x) we observed a break in the graph from x<3 into x >=3 that made us conclude that we must take the limit at x=3 after differentiating it ?



So your saying that we must initially "think" that x>=3 after differentiating it. But we must also "check" if it is still valid after differentiating it. Because f(x) is continuous but not necessarily smooth so we must "check" that its still continuous (even though its not) to prove continuity ? I am understanding more and more of this. THank oyu.
 
  • #23
ghostanime2001 said:
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh


OH my god o_O I see it now.

&& another thing. Is it because in F(x) we observed a break in the graph from x<3 into x >=3 that made us conclude that we must take the limit at x=3 after differentiating it ?

Sort of. Differentiating is taking a limit, by definition of what a derivitive is. Observing the change in function definition for f(x), at x=3, made us conclude we need to check both left-side and right-side limits at that point.

So your saying that we must initially "think" that x>=3 after differentiating it. But we must also "check" if it is still valid after differentiating it. Because f(x) is continuous but not necessarily smooth ...

Pretty much, yes.

... so we must "check" that its still continuous (even though its not) to prove continuity ?

We must check whether f'(x) is continuous (even though we already know f(x) is continuous), to prove that f' exists at x=3.

Im understanding more and more of this. THank oyu.

You're welcome.
 
  • #24
hehe so now i can apply this to any piecewise function ? If so, do u have any site where i can do problems specifically like these ? JUst to see if I understand the concept or not.
 
  • #25
can I ?
 
  • #26
Yes, it applies to any piecewise function. Always double-check the endpoints of the intervals where the function is defined.

Sorry, I'm not aware of online practice problems.
 
  • #27
ghostanime2001 said:
hehe so now i can apply this to any piecewise function ? If so, do u have any site where i can do problems specifically like these ? JUst to see if I understand the concept or not.

Although the derivative of a function is not necessarily continuous, it does obey the "intermediate value property". If particular, if a function is differentiable at x= a, then the two one sided limits of the derivative must be equal to the value at that point. So one easy way to see if a piecewise function if differentiable at a "break point" is to look at the derivatives on either side of the point.
 

FAQ: Differentiation of Piecewise Functions

What is the derivative of abs(x)?

The derivative of abs(x) is a piecewise function, with a derivative of -1 when x is negative and a derivative of 1 when x is positive. It does not have a derivative at x = 0.

Why does abs(x) not have a derivative at x = 0?

The graph of abs(x) has a sharp corner at x = 0, making the derivative undefined at this point. This is because the function changes direction abruptly at x = 0, causing the limit of the difference quotient to not exist.

How can I find the derivative of abs(x) using the limit definition?

Using the limit definition of a derivative, the derivative of abs(x) can be found by taking the limit as h approaches 0 of the difference quotient, where h is the change in x. This limit will give the derivative of -1 when x is negative and 1 when x is positive.

What is the second derivative of abs(x)?

The second derivative of abs(x) is a piecewise function, with a second derivative of 0 when x is negative and a second derivative of 0 when x is positive. It does not have a second derivative at x = 0.

Can the derivative of abs(x) be written as a single function?

No, the derivative of abs(x) cannot be written as a single function since it has different values for x < 0 and x > 0. It can only be written as a piecewise function or as a combination of two functions, one for the negative values and one for the positive values of x.

Similar threads

Back
Top