Find Derivative of f(x) = arctan(tan(x)) and graph it
A calculus tutorial on how to find the first derivative of f(x) = arctan(tan(x)) and graph f and f ' in its natural domain.
f(x) is defined for all values x in R except x = pi/2 + k * Pi, where k is an integer.
Since tan(x) is periodic, then f(x) = arctan(tan(x)) is also a periodic function.
As x increases from pi/2 to Pi/2 exclusive, tan(x) increases from infinitely small values ( infinity) to infinitely large values (+ infinity) and arctan(tan(x)) increases from pi/2 to Pi/2 exclusive since tan(x) is undefined at pi/2 and + pi/2. In fact for x in (pi/2 , pi/2) arctan(tan(x)) = x.
Since tan(x) has a period of Pi, arctan(tan(x)) also has a period of Pi. The graph below shows the graphs of arctan(tan(x)) and tan(x) from pi/2 to 3Pi/2.
Domain of f: R  {pi + k*pi/2 , k integer}
Range of f: (pi/2 , pi/2)
The graph below shows the graphs of arctan(tan(x)).
Derivative of f(x) = arctan(tan(x))
f(x) is a composite function and the derivative is computed using the chain ruleas follows: Let u = tan(x)
Hence f(x) = arctan(u(x))
Apply the chain rule of differentiation
f '(x) = du/dx d(arctan(u))/du = (1 / cos(x)^{2}) * 1 / (u^{2}) + 1)
= (1 / cos(x)^{2}) * 1 / (tan(x)^{2}(x) + 1)
= 1 , for x not equal to pi/2 + k*pi/2 where k is an integer.
Below is shown arctan(tan(x)) in red and its derivative in blue. Note that the derivative is undefined for values of x for which cos(x) is equal to 0, which means at x = pi/2 + k * pi, where k is an integer. Note that f(x) is undefined for these same values of x.
More on differentiation and derivatives 
