Prove differentiablity of a piecewise function

200 Views Asked by At

Prove that the following function is differentiable at $x=\frac{\pi}{4}$:

$$f(x) = \begin{cases} -cosx + C_1, & \text{x $\lt \frac{\pi}{4}$ } \\ sinx -\sqrt2 + C_1, & \text{x $\ge \frac{\pi}{4}$ } \end{cases}$$

$C_1 \in \mathbb{R}$

I tried to solve it using definition of sided derivatives but got stuck on the algebra of calculating limits. I would appreciate if anyone could show me how it should be done. Thanks

4

There are 4 best solutions below

5
On

For $x\in \mathbb{R}\setminus\{\frac{\pi}{4}\}$, it is clear that $f$ is continuous and differentiable.

You have to prove, then that $$\lim_{x\rightarrow \frac{\pi}{4}} \frac{f(x)-f(\frac{\pi}{4})}{x-\frac{\pi}{4}}$$ exists and is finite.

From the geometry of this problem, it is convenient to divide in two parts the work : prove that $$\lim_{x\rightarrow \frac{\pi}{4}^+} \frac{f(x)-f(\frac{\pi}{4})}{x-\frac{\pi}{4}} \qquad \text{and} \qquad \lim_{x\rightarrow \frac{\pi}{4}^-} \frac{f(x)-f(\frac{\pi}{4})}{x-\frac{\pi}{4}}$$ exists and are equal.

For the first one : $$\lim_{x\rightarrow \frac{\pi}{4}^+} \frac{\frac{\sqrt{2}}{2}-\cos(x)}{x-\frac{\pi}{4}}=\lim_{x\rightarrow \frac{\pi}{4}^+} \frac{\cos(\frac{\pi}{4})-\cos(x)}{x-\frac{\pi}{4}} =-(\cos')(\frac{\pi}{4})=\sin(\frac{\pi}{4})=\frac{\sqrt{2}}{2}$$

Same method for the second one.

It is differentiable.

7
On

$f\in C^1(\mathbb{R}/{\frac{\pi}{4}})$

In order for f to be in $C^1(\mathbb{R})$, the left and the right of function and derivative must exist and be equal:

$f^+(\frac{\pi}{4})=C_1-\frac{2}{\sqrt{2}}\\ f^-=C_1-\frac{2}{\sqrt{2}}$

$f'^-(\frac{\pi}{4})=\sin(\frac{\pi}{4})=\frac{\sqrt{2}}{2}\\ f'^+(\frac{\pi}{4})=\cos(\frac{\pi}{4})=\frac{\sqrt{2}}{2}$

Thus $f\in C^1(\mathbb{R})$

0
On

This function is clearly continuous, the differentiability mean $$\lim_{x \rightarrow \frac{\pi}{4}} \frac{f(x)- f(\frac{\pi}{4})}{x- \frac{\pi}{4}}=\lim_{x \rightarrow \frac{\pi}{4}} \frac{f(x)+\frac{\sqrt{2}}{2}-C_1}{x- \frac{\pi}{4}} \text{ exist and finite } $$ $$\lim_{x \rightarrow^> \frac{\pi}{4}} \frac{f(x)+\frac{\sqrt{2}}{2}-C_1}{x- \frac{\pi}{4}} =\lim_{x \rightarrow^> \frac{\pi}{4}} \frac{-cos(x)+C_1+\frac{\sqrt{2}}{2}-C_1}{x- \frac{\pi}{4}} = \lim_{x \rightarrow^> \frac{\pi}{4}} \frac{-cos(x)+\frac{\sqrt{2}}{2}}{x- \frac{\pi}{4}}=\frac{\sqrt{2}}{2} $$ from the derivative of $cos(x)$ at $ x=\frac{\pi}{4}$ in the other hand we have

$$\lim_{x \rightarrow^< \frac{\pi}{4}} \frac{f(x)+\frac{\sqrt{2}}{2}-C_1}{x- \frac{\pi}{4}} =\lim_{x \rightarrow^> \frac{\pi}{4}} \frac{sin(x)-\sqrt{2}+C_1+\frac{\sqrt{2}}{2}-C_1}{x- \frac{\pi}{4}} = \lim_{x \rightarrow^> \frac{\pi}{4}} \frac{sin(x)-\frac{\sqrt{2}}{2}}{x- \frac{\pi}{4}}=\frac{\sqrt{2}}{2} $$ by the same reason, is it okay?

0
On

Theorem: Let be $f:(c - h, c + h)\longrightarrow\Bbb R$, $h > 0$ s.t.

  • $f$ is continuous in $(c - h, c + h)$,
  • $f$ is differentiable in $(c - h,c)\cup(c,c + h)$,
  • exists $\lim_{x\to c}f'(x)$.

Then exists $$f'(c) = \lim_{x\to c}f'(x).$$ Proof:

Take $x\in(c,c + h)$. Applying Rolle to $f$ in $[c,x]$, $$\exists c_x\in(c,x):\qquad\frac{f(x) - f(c)}{x - c} = f'(c_x).$$ As $x\to c^+\implies c_x\to c$: $$ f_+'(c) = \lim_{x\to c^+}\frac{f(x) - f(c)}{x - c} = \lim_{x\to c^+}f'(c_x) = \lim_{x\to c}f'(x). $$

Using the same argument in $(c - h,c)$, $$ f_-'(c) = \lim_{x\to c}f'(x). $$