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?

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)$$
