Determine the derivative of $\arctan$ function Find $f'(x)$ for the function:
$f(x)= \arctan(\frac{a+x}{1-ax}))$ , $a\in R$
So this is what I've done:
$f(x) = \arctan x$
$f'(x) = \frac{1}{1+x^2}$
$x= \frac{a+x}{1-ax}$
$f'(x) =  \frac{1}{1+\frac{(a+x)^2}{(1-ax)^2}}$
$f'(x) = \frac{(1-ax)^2}{(1-ax)^2+(a+x)^2}$
Is this correct?
 A: Hint:
$$\dfrac{d}{dx}f=\dfrac{d}{d \frac{a+x}{1-ax}}\left[\arctan\frac{a+x}{1-ax}\right]\dfrac{d}{dx}\left[\frac{a+x}{1-ax}\right]=\dfrac{d}{d u}\left[\arctan u\right]\bigg|_{u=\frac{a+x}{1-ax}}\dfrac{d}{dx}\left[\frac{a+x}{1-ax}\right]$$
$$=\frac{1}{1+\left(\frac{a+x}{1-ax} \right)^2}\dfrac{d}{dx}\left[\frac{a+x}{1-ax}\right]$$
EDIT1: Explaining the derivative
$$=\frac{1}{1+\left(\frac{a+x}{1-ax} \right)^2}\frac{1\cdot(1-ax)-(a+x)(-a)}{(1-ax)^2}=\frac{1+a^2}{(1-ax)^2+(a+x)^2}$$
$$=\frac{1+a^2}{(1+a^2)(1+x^2)}=\frac{1}{1+x^2}$$ 
EDIT2: Explaining $(1-ax)^2+(a+x)^2=(1+x^2)(1+a^2)$
$$(1-ax)^2+(a+x)^2=1-2ax+a^2x^2+a^2+2ax+x^2$$
$$=1+a^2x^2+a^2+x^2=(1+x^2)+a^2(1+x^2)=(1+x^2)(1+a^2)$$
A: $$\arctan\left(\frac{x+a}{1-ax}\right)=\arctan x+\arctan a$$
(give or take a multiple of $\pi$), so
$$\frac d{dx}\arctan\left(\frac{x+a}{1-ax}\right)=\frac1{1+x^2}.$$
A: you must use the chain rule: $${1 \left(  \left( -ax+1 \right) ^{-1}+{\frac { \left( a+x \right) a}{
 \left( -ax+1 \right) ^{2}}} \right)  \left( {\frac { \left( a+x
 \right) ^{2}}{ \left( -ax+1 \right) ^{2}}}+1 \right) ^{-1}}
$$
simplified to
$$\frac{1}{1+x^2}$$
