Find f'(0) from a piecewise function

In summary: Yes, that's correct. When $x \neq 0$, $f(x) = \frac{g(x)}{x}$ and when $x = 0$, $f(x) = 0$. So, $f(x)$ is continuous at $0$ since $\lim_{x \to 0} f(x) = 0 = f(0)$. But $f'(0)$ is not simply 0 because the limit definition $\displaystyle f'(0) = \lim_{x \to 0} \frac{f(x) - f(0)}{x}$ has an indeterminate form $\frac{0}{0}$, and we must use L'hospital's rule
  • #1
Dethrone
717
0
Find $f'(0)$ if:
$$f(x)=\begin{cases}\frac{g(x)}{x}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$$
where $g(0)=g'(0)=0$, $g''(x)=17$ and $g''(x)$ is continuous at $0$.

Progress:
First,

$$f'(x)=\begin{cases}\frac{xg'(x)-g(x)}{x^2}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$$

Wouldn't $f'(0)$ simply be 0, from above, or is there a flaw in my logic? I mean, I could probably prove that the function is continuous at 0 from the left and right side by l'hopital's rule...tell me if I'm right so far.

EDIT: I think I determined that $\lim_{{x}\to{0^{+/-}}}\frac{xg'(x)-g(x)}{x^2}=\frac{17}{2}$, but why is it not equal to $0$?
 
Last edited:
Physics news on Phys.org
  • #2
Rido12 said:
Find $f'(0)$ if:
$$f(x)=\begin{cases}\frac{g(x)}{x}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$$
where $g(0)=g'(0)=0$, $g''(x)=17$ and $g''(x)$ is continuous at $0$.

Progress:
First,

$$f'(x)=\begin{cases}\frac{xg'(x)-g(x)}{x^2}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$$

Wouldn't $f'(0)$ simply be 0, from above, or is there a flaw in my logic? I mean, I could probably prove that the function is continuous at 0 from the left and right side by l'hopital's rule...tell me if I'm right so far.

EDIT: I think I determined that $\lim_{{x}\to{0^{+/-}}}\frac{xg'(x)-g(x)}{x^2}=\frac{17}{2}$, but why is it not equal to $0$?

Hi Rido12,

I can see where you're having trouble. Let's start from the top. To find $f'(0)$, use the limit definition

$\displaystyle f'(0) = \lim_{x \to 0} \frac{f(x) - f(0)}{x}$.

Since $f(0) = 0$ and $f(x) = \frac{g(x)}{x}$ for $x \neq 0$,

$\displaystyle f'(0) = \lim_{x \to 0} \frac{g(x)}{x^2}$.

This limit has indeterminate form $\frac{0}{0}$ since $g(0) = 0$. To proceed, use L'hospital's rule (as you've suggested) to get

$\displaystyle f'(0) = \lim_{x \to 0} \frac{g'(x)}{2x}$.

Since $g'(0) = 0$, the above limit has indeterminate form $\frac{0}{0}$. Apply L'hospital's rule once more to obtain

$\displaystyle f'(0) = \lim_{x \to 0} \frac{g''(x)}{2} = \frac{17}{2}$.

The last equality follows from continuity of $g''$ at 0 with $g''(0) = 17$.

Note that it wasn't necessary to compute $f'(x)$ for $x \neq 0$ to get $f'(0)$.
 
Last edited:
  • #3
Rido12 said:
, but why is it not equal to $0$?

Consider the special case g(x) = (17/2)x2
When x>0
Then
f(x) = (17/2)x
and
f'(x) = 17/2
 
  • #4
Euge said:
Hi Rido12,

I can see where you're having trouble. Let's start from the top. To find $f'(0)$, use the limit definition

$\displaystyle f'(0) = \lim_{x \to 0} \frac{f(x) - f(0)}{x}$.

Since $f(0) = 0$ and $f(x) = \frac{g(x)}{x}$ for $x \neq 0$,

$\displaystyle f'(0) = \lim_{x \to 0} \frac{g(x)}{x^2}$.

This limit has indeterminate form $\frac{0}{0}$ since $g(0) = 0$. To proceed, use L'hospital's rule (as you've suggested) to get

$\displaystyle f'(0) = \lim_{x \to 0} \frac{g'(x)}{2x}$.

Since $g'(0) = 0$, the above limit has indeterminate form $\frac{0}{0}$. Apply L'hospital's rule once more to obtain

$\displaystyle f'(0) = \lim_{x \to 0} \frac{g''(x)}{2} = \frac{17}{2}$.

The last equality follows from continuity of $g''$ at 0 with $g''(0) = 17$.

Note that it wasn't necessary to compute $f'(x)$ for $x \neq 0$ to get $f'(0)$.

Hi Euge! (Wave)

I can follow all your steps, and that at the end, $\displaystyle f'(0) = \lim_{x \to 0} \frac{g''(x)}{2}$ is equal to $\frac{17}{2}$ because $g''(x)$ is continuous at $0$.

However, when I differentiated the piece-wise function $f$ at the beginning, I got:

$f'(x)=\begin{cases}\frac{xg'(x)-g(x)}{x^2}, & x\ne 0 \\[3pt] 0, & x=0 \\ \end{cases}$
The question gives us $f(0)=0$ when $x=0$, so it follows that $f'(0)=0$ when $x=0$ because the derivative of $0$ is $0$. I have also determined that $f$ is continuous.

In the above, when $x=0$, then $f'(0)=0$. What's wrong with that conclusion?
 
  • #5
Rido12 said:
The question gives us $f(0)=0$ when $x=0$, so it follows that $f'(0)=0$ when $x=0$ because the derivative of $0$ is $0$. I have also determined that $f$ is continuous.

In the above, when $x=0$, then $f'(0)=0$. What's wrong with that conclusion?

Let $h(x)=x$.
Since we have $h(0)=0$ when $x=0$, does it follow that $h'(0)=0$? (Wondering)
 
  • #6
That's true, but I'm getting tangled up here.

Isn't the way I'm getting $f'(x)$ analogous to what you would do with an absolute value function?

$$f(x)=|x|=\begin{cases}x, & x>0 \\[3pt] -x, & x<0 \\ \end{cases}$$

Differentiating both parts of the piecewise function:

$$f'(x)=\begin{cases}1, & x>0 \\[3pt] -1, & x<0 \\ \end{cases}$$

Differentiating yet again:

$$f''(x)=\begin{cases}0, & x>0 \\[3pt] 0, & x<0 \\ \end{cases}$$

I'm aware that we can also redefine $|x|$ as $\sqrt{x^2}$, but I've seen this method used to differentiate $|x|$

Why does this work or not work? Is it because the piecewise function has its domain separated by inequalities ($x<0$ or $x>0$) whereas if there was an equality ($x=0$), this method fails?
 
  • #7
Hi again Rido12,

The major issue in your argument is the statement "The question gives us $f(0) = 0$ when $x = 0$, so it follows that $f'(0) = 0$ when $x = 0$ because the derivative of $0$ is $0$". What does the derivative of $0$ being $0$ have to do with the value of $f'(0)$?

There's something else I need to add. Even before calculating $f'(0)$ you must check that $f$ is continuous at $0$. I assumed you already did this, but in case you haven't, use L'hospital's rule and continuity of $g'$ with $g'(0) = 0$ to get

$\displaystyle \lim_{x\to 0} f(x) = \lim_{x\to 0} \frac{g(x)}{x} = \lim_{x \to 0} g'(x) = g'(0) = 0 = f(0)$.

Thus, f is continuous at $0$.
 
  • #8
Rido12 said:
That's true, but I'm getting tangled up here.

Isn't the way I'm getting $f'(x)$ analogous to what you would do with an absolute value function?

Not quite.
The absolute value function is not differentiable at 0, while it turns out that your function is.

$$f(x)=|x|=\begin{cases}x, & x>0 \\[3pt] -x, & x<0 \\ \end{cases}$$

Differentiating both parts of the piecewise function:

$$f'(x)=\begin{cases}1, & x>0 \\[3pt] -1, & x<0 \\ \end{cases}$$

Differentiating yet again:

$$f''(x)=\begin{cases}0, & x>0 \\[3pt] 0, & x<0 \\ \end{cases}$$

I'm aware that we can also redefine $|x|$ as $\sqrt{x^2}$, but I've seen this method used to differentiate $|x|$

Why does this work or not work? Is it because the piecewise function has its domain separated by inequalities ($x<0$ or $x>0$) whereas if there was an equality ($x=0$), this method fails?

All true.
However, in this case both $f'(0)$ and $f''(0)$ are undefined.
Euge said:
There's something else I need to add. Even before calculating $f'(0)$ you must check that $f$ is continuous at $0$.

Indeed, I wondered about this at first.
But doesn't the fact that $f'(0)$ turns out to exist, imply that $f$ is continuous at $0$?
 
  • #9
Going back to the original, I read the piecewise function as the following:

When $x$ is any value but $0$, the function becomes $\frac {g(x)}{x}$. When $x$ is $0$, the function is $f(x)=0$.

The function $f(x)=0$, it is a constant function, where $f'(x)=0$. That is where I'm coming from. This is true for a general function where $f(x)=0$ is everywhere or for all $x$, but not true for a piecewise function where that is true only when $x=0$.
 
  • #10
Rido12 said:
Going back to the original, I read the piecewise function as the following:

When $x$ is any value but $0$, the function becomes $\frac {g(x)}{x}$. When $x$ is $0$, the function is $f(x)=0$.

The function $f(x)=0$, it is a constant function, where $f'(x)=0$. That is where I'm coming from. This is true for a general function where $f(x)=0$ is everywhere or for all $x$, but not true for a piecewise function where that is true only when $x=0$.

If a function is only $0$ at $x=0$, it is not a constant function.

Suppose we define:
$$h(x) = \begin{cases} x & \text{if } x \ne 0 \\ 0 & \text{if } x = 0 \end{cases}$$
Then we still have that:
$$h'(0)=1 \ne 0$$

That is because $h'(0)$ is actually defined as:
$$h'(0) = \lim_{h\to 0} \frac{f(h) - f(0)}{h}$$
where $h\ne 0$. $h$ only approaches $0$. (Nerd)
 
  • #11
Alright! It all makes sense now :D
Thanks everyone (Nod)
 
  • #12
I like Serena said:
Indeed, I wondered about this at first.
But doesn't the fact that $f'(0)$ turns out to exist, imply that $f$ is continuous at $0$?

I meant to say "you should check" rather than "you must check". Sometimes I do that check when dealing with more complicated functions.
 

1. What is a piecewise function?

A piecewise function is a function that is defined by different mathematical rules or equations for different intervals or domains of the independent variable. In other words, the function has different "pieces" that are defined by different equations.

2. How do you find the derivative of a piecewise function?

To find the derivative of a piecewise function, you need to find the derivative of each piece separately and then combine them using the appropriate rules for derivatives. You may also need to use the limit definition of the derivative if the function is not continuous at the point you are evaluating.

3. Why is it important to find f'(0) from a piecewise function?

Finding the derivative at a specific point, in this case f'(0), can tell us important information about the behavior of the function at that point. It can also help us determine the slope of the tangent line to the graph of the function at that point, which can be useful in applications such as optimization problems.

4. Can you provide an example of finding f'(0) from a piecewise function?

Yes, for example, if we have the piecewise function f(x) = {x^2, if x < 0; x + 1, if x ≥ 0}, we can find f'(0) by first finding the derivatives of each piece: f'(x) = {2x, if x < 0; 1, if x ≥ 0}. Then, we can evaluate each derivative at x = 0 to get f'(0) = {0, if x < 0; 1, if x ≥ 0}. Since f'(0) is different depending on which piece we are considering, we can conclude that the function is not differentiable at x = 0.

5. What if the piecewise function is not continuous at x = 0?

If the function is not continuous at x = 0, we will need to use the limit definition of the derivative to find f'(0). This means taking the limit as x approaches 0 from both the left and the right sides of the function and seeing if they are equal. If they are not equal, then the derivative at x = 0 does not exist.

Similar threads

  • Calculus
Replies
9
Views
2K
  • Calculus
Replies
3
Views
747
Replies
3
Views
2K
Replies
5
Views
1K
Replies
1
Views
950
Replies
1
Views
1K
  • Calculus
Replies
6
Views
1K
  • Calculus
Replies
25
Views
1K
Replies
1
Views
1K
Replies
1
Views
965
Back
Top