First you use product rule for `xtan^(-1)x`

`(xtan^(-1)x)'=tan^(-1)x+x(tan^(-1)x)'=`

Now you use chain rule for ` (tan^(-1)x)'`

`=tan^(-1)x+x((-1)tan^(-2)xcdotcos^(-2)x)=tan^(-1)x-x((cos^2x)/(sin^2x)cdot1/cos^2x) `

`tan^(-1)x-x/(sin^2x) `

Now we only need to differentiate second part `-1/2ln(1+x^2) ` For this we, again use chain rule.

`(-1/2ln(1+x^2))'=-1/2cdot1/(1+x^2)cdot2x=-x/(1+x^2)`

And since derivative is linear (derivative of sum is equal to sum of derivatives) we get

`q'(x)=tan^(-1)x-x/(sin^2x)-x/(1+x^2)`

` ` ` `

`q(x)= xtan^(-1) (x) - (1/2)ln(1+x^2)`

Using function of function or chain rule you can solve this.

`(dtan(-1)x)/dx = 1/(1+x^2)`

`(dq(x))/dx = (d(xtan^(-1)x))/dx-1/2(d(log(1+x^2)))/dx`

`(dq(x))/dx = x*1/(1+x^2)+tan^(-1) (x)*1-1/2*1/(1+x^2)*2x`

`(dq(x))/dx = x/(1+x^2)+tan^(-1) (x)-x/(1+x^2)`

`(dq(x))/dx = tan^(-1)x`

**So the answer is;**

`(dq(x))/dx = tan^(-1)x`