Find Derivative of f(x) = arcsin(sin(x)) and graph it

A tutorial on how to find the first derivative of f(x) = arcsin(sin(x)) and graph f and f' for x in R.

Since the domain of f is R and sin(x) is periodic, then f(x) = arcsin(sin(x)) is also a periodic function.
As x increases from 0 to π/2, sin(x) increases from 0 to 1 and arcsin(sin(x)) increases from 0 to π/2. In fact for x in [0 , π/2] arcsin(sin(x)) = x. As x increases from [π/2 , 3π/2], sin(x) decreases from 1 to -1 and arcsin(sin(x)) decreases from π/2 to -π/2. As x increases from 3π/2 to 2π, sin(x) increases from -1 to 0 and arcsin(sin(x)) increases from 3π/2 to 2π.
Since sin(x) has a period of 2π, arcsin(sin(x)) also has a period of 2π. The graph below shows the graphs of arcsin(sin(x)) and sin(x) from 0 to 2π.

Graph of sin(x) and arcsin(sin(x) over one period)

The graph below shows the graphs of arcsin(sin(x)) and sin(x) over 3 periods.
Graph of sin(x) and arcsin(sin(x)) over 3 periods

Domain of f: (-∞ , +∞)
Range of f: [-π/2 , π/2]
Derivative of f(x) = arcsin(sin(x))
f(x) is a composite function and the derivative is computed using the
chain rule as follows: Let u = sin(x)
Hence f(x) = arctan(u(x))
Apply the chain rule of differentiation
f '(x) = du/dx d(arcsin(u))/du = cos(x) * 1 / √(1 - u
2)
= cos(x) * 1 / (1 - sin
2(x))
= cos(x) / √(sin
2(x))
= cos(x) / | cos(x) |
Below is shown arcsin(sin(x)) in red and its derivative in blue. Note that the derivative is undefined for values of x for which cos(x) = 0, which means at x = π/2 + k*π, where k is an integer. For these same values of x, arcsin(sin(x)) has either a maximum value equal to π/2 or a minimum value equal to -π/2.
Note that although arcsin(sin(x)) is continuous for all values of x its derivative is undefined at certain values of x.
Graph of derivative of arcsin(sin(x))

More on
differentiation and derivatives