# How to differentiate $\arctan(\frac{\cos x-\sin x}{\cos x+\sin x})$?

Problem:

Differentiate with respect to $$x$$: $$\arctan(\frac{\cos x-\sin x}{\cos x+\sin x})$$

My attempt:

Let, $$y=\arctan(\frac{\cos x-\sin x}{\cos x+\sin x})$$

$$y=\arctan(\frac{\cos x-\sin x}{\cos x+\sin x})$$

$$y=\arctan\frac{(\cos x-\sin x)^2}{2\cos2x}$$

$$y=\arctan\frac{1-\sin2x}{2\cos2x}$$

$$y=\arctan(\frac{1}{2\cos2x}-\frac{\sin2x}{2\cos2x})$$

$$y=\arctan\frac{1}{2}(\frac{1}{\cos2x}-\frac{\sin2x}{\cos2x})$$

$$y=\arctan\frac{1}{2}(\sec2x-\tan2x)$$

My observations:

Now, I could find the derivative using the brute force of chain rule, but the derivative of the above graph is $$-1$$, so I think a much easier way to find the derivative might exist.

Question:

1. Is there a way to find the derivative of the above graph very easily, which is not that tedious?
• Do you now how to caclculate the derivative of inverse functions? Oct 21 '21 at 8:07
• yes, $\frac{d}{dx}\arctan(x)=\frac{1}{1+x^2}$ Oct 21 '21 at 8:08
• Btw how did the factor 2 appeared in you denominator? Oct 21 '21 at 8:08
• If you know the derivative of arctan, then you can simply use the chain rule. Oct 21 '21 at 8:10
• @GáborPálovics I edited the question; I know, but it seems tedious. The derivative of the above graph is a constant (-1), so I thought that there might be a really easy way to find the derivative then. Oct 21 '21 at 8:13

We have \begin{align*}\frac{\cos x-\sin x}{\cos x+\sin x}&=\frac{\frac{\cos x-\sin x}{\sqrt2}}{\frac{\cos x+\sin x}{\sqrt2}} \\&=\frac{\sin{(\frac{\pi}4}-x)}{\cos{(\frac{\pi}4}-x)} \\&=\tan{(\frac{\pi}4}-x)\end{align*} Can you proceed form here?