<s>[INST] Solve definite integral: $\int_{-1}^{1}\arctan(\sqrt{x+2})\ dx$ I need to solve:
$$\int_{-1}^{1}\arctan(\sqrt{x+2})\ dx$$
Here is my steps, first of all consider just the indefinite integral:
$$\int \arctan(\sqrt{x+2})dx = \int \arctan(\sqrt{x+2}) \cdot 1\ dx$$
$$f(x) = \arctan(\sqrt{x+2})$$
$$f'(x) = \frac{1}{1+x+2} \cdot \frac{1}{2\sqrt{x+2}} = \frac{1}{(2x+6)\sqrt{x+2}}$$
$$g'(x) = 1$$
$$g(x) = x$$
So:
$$\bigg[\arctan(\sqrt{x+2}) \cdot x\bigg]_{-1}^{1} - \int_{-1}^{1} \frac{x}{(2x-6)\sqrt{x+2}}\ dx$$
How should I proceed with the new integral?
 [/INST] You can set $t=\sqrt{x+2}$. For $x=-1$ we have $t=1$, for $x=1$ we have $t=\sqrt{3}$. Moreover $x=t^2-2$, so $dx=2t\,dt$. Therefore the integral is
$$
\int_{1}^{\sqrt{3}}2t\arctan t\,dt=
\underbrace{\Bigl[t^2\arctan t\Bigr]_1^{\sqrt{3}}}_A-
\underbrace{\int_{1}^{\sqrt{3}}\frac{t^2}{1+t^2}\,dt}_B
$$
(by parts). Then
$$
A=3\cdot\frac{\pi}{3}-\frac{\pi}{4}
$$
Let's examine $B$:
$$
B=\int_{1}^{\sqrt{3}}\frac{1+t^2-1}{1+t^2}\,dt=
\Bigl[t-\arctan t\Bigr]_{1}^{\sqrt{3}}=
\left(\sqrt{3}-\frac{\pi}{3}\right)-\left(1-\frac{\pi}{4}\right)
$$
</s>