Calculate the following indefinite integrals.

[1] $\int (2x+1)\sqrt{x+2}\ dx$

[2] $\int \frac{1+\cos x}{x+\sin x}\ dx$

[3] $\int \sin ^ 5 x \cos ^ 3 x \ dx$

[4] $\int \frac{(x-3)^2}{x^4}\ dx$

[5] $\int \frac{dx}{\tan x}\ dx$
1. To solve the integral $\int (2x+1)\sqrt{x+2}\ dx$, we will use the substitution method.

   Let $u = x + 2$. Then, $du = dx$ and $x = u - 2$.

   Substituting these into the integral, we get:
   \[
   \int (2x+1)\sqrt{x+2}\ dx = \int (2(u-2) + 1)\sqrt{u}\ du
   \]
   Simplifying the integrand:
   \[
   2(u-2) + 1 = 2u - 4 + 1 = 2u - 3
   \]
   So the integral becomes:
   \[
   \int (2u - 3)\sqrt{u}\ du
   \]
   We can split this into two separate integrals:
   \[
   \int (2u - 3)\sqrt{u}\ du = \int 2u\sqrt{u}\ du - \int 3\sqrt{u}\ du
   \]
   Now, we integrate each term separately. For the first term:
   \[
   \int 2u\sqrt{u}\ du = 2 \int u^{3/2}\ du
   \]
   Using the power rule for integration:
   \[
   2 \int u^{3/2}\ du = 2 \cdot \frac{2}{5} u^{5/2} = \frac{4}{5} u^{5/2}
   \]
   For the second term:
   \[
   \int 3\sqrt{u}\ du = 3 \int u^{1/2}\ du
   \]
   Again, using the power rule for integration:
   \[
   3 \int u^{1/2}\ du = 3 \cdot \frac{2}{3} u^{3/2} = 2 u^{3/2}
   \]
   Combining these results, we get:
   \[
   \int (2u - 3)\sqrt{u}\ du = \frac{4}{5} u^{5/2} - 2 u^{3/2} + C
   \]
   Substituting back $u = x + 2$:
   \[
   \frac{4}{5} (x+2)^{5/2} - 2 (x+2)^{3/2} + C
   \]
   Factoring out $(x+2)^{3/2}$:
   \[
   \frac{4}{5} (x+2)^{3/2} (x+2) - 2 (x+2)^{3/2} + C = (x+2)^{3/2} \left( \frac{4}{5} (x+2) - 2 \right) + C
   \]
   Simplifying inside the parentheses:
   \[
   \frac{4}{5} (x+2) - 2 = \frac{4}{5} x + \frac{8}{5} - 2 = \frac{4}{5} x - \frac{2}{5}
   \]
   So the final answer is:
   \[
   \boxed{\frac{2}{5} (x+2) (2x-1) \sqrt{x+2} + C}
   \]