<s>[INST] $ \lim_{x \to 0}x \tan (xa+ \arctan \frac{b}{x})$ I have to evaluate the following limit
$$ \lim_{x \to  0}x \tan (xa+ \arctan \frac{b}{x})$$
I tried to divide tan in $\frac{sin}{cos}$ or with Hopital but I can't understand where I'm making mistakes.
The final result is:
$\frac{b}{1-ab}$ if $ab \ne 1$
$- \infty$ if $ab=1$ and $a>0$
$+ \infty$ if $ab=1$ and $a<0$
 [/INST] We have that by $\arctan x+\arctan \frac 1x= \pm \frac \pi 2$
$$x \tan \left(xa+ \arctan \frac{b}{x}\right)=x \tan \left(\pm\frac\pi 2+xa-\arctan \frac{x}{b}\right)=$$
$$=-\frac{x}{ \tan \left(xa-\arctan \frac{x}{b}\right)}=-\frac{x}{ xa-\arctan \frac{x}{b}} \frac{xa-\arctan \frac{x}{b}}{ \tan \left(xa-\arctan \frac{x}{b}\right)}$$
and since by standard limits
$$\frac{xa-\arctan \frac{x}{b}}{ \tan \left(xa-\arctan \frac{x}{b}\right)} \to 1$$
we only need to consider the first term that is for $ab\ne -1$
$$-\frac{x}{ xa-\arctan \frac{x}{b}}=-\frac{1}{ a-\frac1b\frac{\arctan \frac{x}{b}}{\frac x b}} \to\frac{b}{1-ab}$$
by standard limits  and for $ab= 1$ by Taylor's expansion $\arctan (x)=x-\frac13x^3+o(x^3)$
$$-\frac{x}{ xa-\arctan \frac{x}{b}}=-\frac{x}{ xa-\arctan (xa)}=-\frac{x}{ xa-xa+\frac13 (xa)^3+o(x^3)}=$$
$$=-\frac{1}{ \frac13 x^2a^3+o(x^2)}\to -\operatorname{sign}(a) \cdot \infty$$
</s>