Doubts in equations involving inverse tangent and inverse sine My textbook solves the equation $\arctan x + \arcsin \frac{x}{\sqrt{x^2+9/4}}=\frac{\pi}{4}$ by taking the tangent both sides and using the identity $\tan(\alpha+\beta)=\frac{\tan \alpha + \tan \beta}{1-\tan \alpha \tan \beta}$; that approach leads to the solutions $x=-3 \vee x=1/2$, but $x=-3$ is not a solution since $\arctan(-3)+\arcsin \frac{-3}{\sqrt{(-3)^2+9/4}}=-3\displaystyle\frac\pi4 \ne \displaystyle\frac\pi4$.
My questions are:
i) I believe that the reason why there is a mistake (the extra wrong solution $x=-3$) is when the author takes the tangent both sides of the equation: the range of the function $f:\mathbb{R} \to \mathbb{R}$ defined by $f(x)=\arctan x +\arcsin \frac{x}{\sqrt{x^2+9/4}}$ is $(-\pi, \pi)$, so there are values of $f$ where $\tan f$ is not injective, that is for $x\in (-\pi,-\displaystyle\frac\pi2]\cup[\displaystyle\frac\pi2,\pi)$, and thus, if I'm not wrong, the equation is not equivalent to the one that is obtained by taking tangent both sides because the implication $\tan(r)=\tan(s) \implies r=s$ is valid only where the tangent is injective. Maybe this can be solved by considering the two intervals $(-\pi,-\displaystyle\frac\pi2]\cup[\displaystyle\frac\pi2,\pi)$, use the periodicity of the tangent to shift $x$ in an interval where the tangent is injective (for example, using $\tan(x+\pi)=\tan x$ for $x\in(-\pi,-\displaystyle\frac\pi2)$, so that $\tan(x+\pi)$ is now injective for $x\in(-\pi,-\displaystyle\frac\pi2)$) and now use again the injectivity to apply tangent both sides. Is this the correct way to solve the equation? Using the injectivity in $(-\displaystyle\frac\pi2,\displaystyle\frac\pi2)$ and then consider other two cases for $(-\pi,-\displaystyle\frac\pi2]$ and $[\displaystyle\frac\pi2,\pi)$ to use again injectivity and consider the union of all the solutions set?
ii) The identity $\tan(\alpha+\beta)=\frac{\tan \alpha + \tan \beta}{1-\tan \alpha \tan \beta}$ holds for $\alpha, \beta, \alpha+\beta \ne \displaystyle\frac\pi2+k\pi$  with $k\in\mathbb{Z}$; shouldn't I check that $\arctan x=\displaystyle\frac\pi2+k\pi$, $\arcsin \frac{x}{\sqrt{x^2+9/4}}=\displaystyle\frac\pi2+k\pi$ and $f(x)=\displaystyle\frac\pi2+k\pi$ aren't solutions as well to not lose solutions after using the identity? Of course is obvious that $\arctan x \ne \displaystyle\frac\pi2+k\pi$ and $\arcsin \frac{x}{\sqrt{x^2+9/4}} \ne \displaystyle\frac\pi2+k\pi$ because they are bounded for values in $(-\displaystyle\frac\pi2,\displaystyle\frac\pi2)$ and $[-1,1]$ respectively, to me is not obvious to show that $f(x) \ne \displaystyle\frac\pi2+k\pi$.
Actually, I believe it is not always true: since $f$ is continuous and has image $(-\pi,\pi)$, it follows that there exist $x_0,x_1$ such that $f(x_0)=\displaystyle\frac\pi2$ and $f(x_1)=-\displaystyle\frac\pi2$ (which are the only two values to check, because for $k \notin \{-1,0\}$ it is $\displaystyle\frac\pi2+k\pi \notin (-\pi,\pi)$); however, these are not solutions of $f(x)=\displaystyle\frac\pi4$ and so the equation is equivalent to the one obtained using the trigonometric identity for the angles sum of the tangent. Is this correct?
 A: 
i) I believe that the reason there is a mistake (the extra wrong
solution $x=-3$) is when the author takes tangent on both sides of the
equation: the implication $$\tan(r)=\tan(s) \implies r=s$$ is valid only
where the tangent is injective.

Don't you mean that the book did this instead of what you wrote above: $$r=s \implies \tan(r)=\tan(s)? $$
You are correct that taking $\tan$ on both sides of the equation created that extraneous solution due to $\tan$'s lack of injectivity.
Such a step is actually valid even though it potentially creates extraneous solutions; importantly, it never discards solutions. Extraneous solutions aren't a big deal: when solving equations, unless every single step has actually been a $\iff$ step instead of a $\implies$ step, what is obtained are merely candidate solutions that need to be filtered enroute to being actual solutions.

shouldn't I check
that $\arctan x,\arcsin \frac{x}{\sqrt{x^2+9/4}},f(x)=\frac\pi2+k\pi$
aren't solutions as well to not lose solutions after using the
identity?

$$\tan(\alpha+\beta)=\frac{\tan \alpha + \tan \beta}{1-\tan \alpha \tan \beta}$$ is an identity, so its two sides correspond identically/universally to each other; in other words, if one side breaks down (is undefined), so will the other side. There's no need to check any of those three conditions for the sake of applying this identity.
Furthermore, applying an identity is an $\iff$ step, so neither discards solutions nor creates extraneous ones.
