#### To determine

**To find:** The number if the function is differentiable and obtain the formula for derivative of the function then sketch the function g(x) and g′(x).

#### Answer

The function is differentiable at x=0 and not differentiable at x=−2.

#### Explanation

**Given:**

The function g(x)={2x if x≤02x−x2 if 0<x<22−x if x≥2.

**Derivative rules:**

(1) Power Rule: ddx(xn)=nxn−1

(2) Difference Rule: ddx[f(x)−g(x)]=ddx(f(x))−ddx(g(x))

(3) Constant multiple Rule: ddx(c⋅f)=cddx(f)

**Calculation:**

Obtain the left hand derivative of g(x) at 0.

That is, compute limh→0−g(0+h)−g(0)h.

limh→0−g(0+h)−g(0)h=limh→0−g(h)−g(0)h

Since g(x)=2x when x≤0 and simplify the terms,

limh→0−g(0+h)−g(0)h=limh→0−2(h)−2(0)h=limh→0−2hh=limh→0−2=2

Thus, the value of the left hand derivative of g(x) at 0 is 2.

Obtain the right hand derivative of g(x) at 0.

That is, compute limh→0+g(0+h)−g(0)h.

limh→0+g(0+h)−g(0)h=limh→0+g(0+h)−g(0)h=limh→0+g(h)−g(0)h

Since g(x)=2x−x2 and simplify the terms,

limh→0+g(0+h)−g(0)h=limh→0+(2(h)−h2)−(2(0)−02)h=limh→0+h(2−h)h=limh→0+(2−h)=2

Thus, the value of the right hand derivative of g(x) at 0 is 2.

Since the value of the left hand derivative of g(x) and the value of the right hand derivative of g(x) are equal, the limit g′(0)=limh→0g(0+h)−g(0)h exists.

Therefore, the function g(x) is differentiable at 0 and g′(0)=2.

Obtain the left hand derivative of g(x) at 2.

That is, compute limh→0−g(2+h)−g(2)h.

Since g(x)=2x−x2 and simplify the terms,

limh→0−g(2+h)−g(2)h=limh→0−[2(2+h)−(2+h)2]−[2(2)−4]h=limh→0−[4+2h−(4+h2+4h)]−0h=limh→0−(4+2h−4−h2−4h)h

Simplify the numerator as follows,

limh→0−g(2+h)−g(2)h=limh→0−(−h2−2h)h=limh→0−h(−h−2)h=limh→0−h−2=−2

Thus, the value of the lift hand derivative of g(x) at 2 is −2.

Obtain the right hand derivative of g(x) at 2.

That is, compute limh→0+g(2+h)−g(2)h.

Since g(x)=2−x and simplify the terms,

limh→0+g(2+h)−g(2)h=limh→0+[2−(2+h)]−(2−2)h=limh→0+−hh=limh→0+(−1)=−1

Thus, the value of the right hand derivative of g(x) at 2 is −1.

Since the value of the left hand derivative of g(x) and the value of the right hand derivative of g(x) are not equal, the limit g′(2)=limh→0g(2+h)−g(2)h does not exist.

Therefore, the function g(x) is not differentiable at 2.

Obtain the derivative of the function at x<0.

g′(x)=ddx(2x)

Apply the constant multiple rule and the power rule stated above,

g′(x)=2ddx(x)=2(1x1−1)=2

Note that, the function g(x) is differentiable at x<0 and x=0.

Thus, the derivative of the function at x≤0 is 2.

Obtain the derivative of the function at 0<x<2.

g′(x)=ddx(2x−x2)

Apply the difference rule (2) and the constant multiple rule (3),

g′(x)=ddx(2x)−ddx(x2)=2ddx(x)−ddx(x2)

Apply the power rule (1) and simplify the expression,

g′(x)=2(1x1−1)−(2x2−1)=2−2x

Thus, the derivative of the function at 0<x<2 is 2−2x.

Obtain the derivative of the function at x>2.

g′(x)=ddx(2−x)

Apply the difference rule (2) and the power rule (1),

g′(x)=ddx(2)−ddx(x)=0−1=−1

Thus, the derivative of the function at x>2 is −1 and not differentiable at x=2.

Therefore, the derivative of the function g(x) is g′(x)={2 if x≤02−2x if 0<x<2−1 if x>2.

**Graphs:**

The graph of the function g(x) is shown below in Figure 1.

From Figure 1, it is observed that the function is straight line when x≤0, parabola when 1<x<2 and again straight line when x>2.

The graph of the function g′(x) is shown below in Figure 2.

From Figure 1, it is observed that the derivative of f(x) does not exist at 2 and. That is, the derivative of f(x) is defined on the real line except at 2.