Calculate the following indefinite integrals.

[1] $\int \frac{x}{\sqrt{5-x}}dx$

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

[3] $\int (\sin x+\cos x)^2dx$

[4] $\int \frac{x-\cos ^2 x}{x\cos^ 2 x}dx$

[5]$\int (\sin x+\sin 2x)^2 dx$
### Problem 1: 
Evaluate the integral $\int \frac{x}{\sqrt{5-x}} \, dx$.

1. Let $u = 5 - x$. Then, $du = -dx$ and $x = 5 - u$.
2. Substitute $u$ and $du$ into the integral:
   \[
   \int \frac{x}{\sqrt{5-x}} \, dx = \int \frac{5 - u}{\sqrt{u}} \cdot (-du) = -\int \frac{5 - u}{\sqrt{u}} \, du
   \]
3. Split the integral:
   \[
   -\int \frac{5 - u}{\sqrt{u}} \, du = -\int \frac{5}{\sqrt{u}} \, du + \int \frac{u}{\sqrt{u}} \, du
   \]
4. Simplify each term:
   \[
   -\int \frac{5}{\sqrt{u}} \, du + \int \frac{u}{\sqrt{u}} \, du = -5 \int u^{-\frac{1}{2}} \, du + \int u^{\frac{1}{2}} \, du
   \]
5. Integrate each term:
   \[
   -5 \int u^{-\frac{1}{2}} \, du = -5 \cdot 2u^{\frac{1}{2}} = -10u^{\frac{1}{2}}
   \]
   \[
   \int u^{\frac{1}{2}} \, du = \frac{2}{3} u^{\frac{3}{2}}
   \]
6. Combine the results and substitute back $u = 5 - x$:
   \[
   -10u^{\frac{1}{2}} + \frac{2}{3} u^{\frac{3}{2}} = -10(5 - x)^{\frac{1}{2}} + \frac{2}{3} (5 - x)^{\frac{3}{2}}
   \]
7. Therefore, the integral is:
   \[
   \boxed{\frac{2}{3}(5-x)^{\frac{3}{2}} - 10\sqrt{5-x} + C}
   \]

### Problem 2:
Evaluate the integral $\int \frac{\sin x \cos^2 x}{1 + \cos x} \, dx$.

1. Let $u = \cos x$. Then, $du = -\sin x \, dx$.
2. Substitute $u$ and $du$ into the integral:
   \[
   \int \frac{\sin x \cos^2 x}{1 + \cos x} \, dx = -\int \frac{u^2}{1 + u} \, du
   \]
3. Simplify the integrand:
   \[
   -\int \frac{u^2}{1 + u} \, du = -\int \left( u - \frac{u}{1 + u} \right) \, du
   \]
4. Split the integral:
   \[
   -\int u \, du + \int \frac{u}{1 + u} \, du
   \]
5. Integrate each term:
   \[
   -\int u \, du = -\frac{u^2}{2}
   \]
   \[
   \int \frac{u}{1 + u} \, du = \int \left( 1 - \frac{1}{1 + u} \right) \, du = u - \ln|1 + u|
   \]
6. Combine the results and substitute back $u = \cos x$:
   \[
   -\frac{u^2}{2} + u - \ln|1 + u| = -\frac{\cos^2 x}{2} + \cos x - \ln|1 + \cos x|
   \]
7. Therefore, the integral is:
   \[
   \boxed{\cos x - \frac{1}{2} \cos^2 x - \ln|1 + \cos x| + C}
   \]

### Problem 3:
Evaluate the integral $\int (\sin x + \cos x)^2 \, dx$.

1. Expand the integrand:
   \[
   (\sin x + \cos x)^2 = \sin^2 x + 2\sin x \cos x + \cos^2 x
   \]
2. Use the Pythagorean identity $\sin^2 x + \cos^2 x = 1$:
   \[
   \sin^2 x + 2\sin x \cos x + \cos^2 x = 1 + 2\sin x \cos x
   \]
3. Use the double-angle identity $2\sin x \cos x = \sin 2x$:
   \[
   1 + \sin 2x
   \]
4. Integrate each term:
   \[
   \int (1 + \sin 2x) \, dx = \int 1 \, dx + \int \sin 2x \, dx = x - \frac{1}{2} \cos 2x
   \]
5. Therefore, the integral is:
   \[
   \boxed{x - \frac{1}{2} \cos 2x + C}
   \]

### Problem 4:
Evaluate the integral $\int \frac{x - \cos^2 x}{x \cos^2 x} \, dx$.

1. Split the integrand:
   \[
   \frac{x - \cos^2 x}{x \cos^2 x} = \frac{x}{x \cos^2 x} - \frac{\cos^2 x}{x \cos^2 x} = \frac{1}{\cos^2 x} - \frac{1}{x}
   \]
2. Simplify the integrand:
   \[
   \sec^2 x - \frac{1}{x}
   \]
3. Integrate each term:
   \[
   \int \sec^2 x \, dx - \int \frac{1}{x} \, dx = \tan x - \ln|x|
   \]
4. Therefore, the integral is:
   \[
   \boxed{\tan x - \ln|x| + C}
   \]

### Problem 5:
Evaluate the integral $\int (\sin x + \sin 2x)^2 \, dx$.

1. Expand the integrand:
   \[
   (\sin x + \sin 2x)^2 = \sin^2 x + 2\sin x \sin 2x + \sin^2 2x
   \]
2. Use the double-angle identity $\sin 2x = 2\sin x \cos x$:
   \[
   2\sin x \sin 2x = 2\sin x (2\sin x \cos x) = 4\sin^2 x \cos x
   \]
3. Use the identity $\sin^2 2x = \frac{1 - \cos 4x}{2}$:
   \[
   \sin^2 2x = \frac{1 - \cos 4x}{2}
   \]
4. Combine the results:
   \[
   \sin^2 x + 4\sin^2 x \cos x + \frac{1 - \cos 4x}{2}
   \]
5. Integrate each term:
   \[
   \int \sin^2 x \, dx = \int \frac{1 - \cos 2x}{2} \, dx = \frac{x}{2} - \frac{\sin 2x}{4}
   \]
   \[
   \int 4\sin^2 x \cos x \, dx = \int 4\sin^2 x \, d(\sin x) = \frac{4}{3} \sin^3 x
   \]
   \[
   \int \frac{1 - \cos 4x}{2} \, dx = \frac{1}{2} \int 1 \, dx - \frac{1}{2} \int \cos 4x \, dx = \frac{x}{2} - \frac{\sin 4x}{8}
   \]
6. Combine the results:
   \[
   \frac{x}{2} - \frac{\sin 2x}{4} + \frac{4}{3} \sin^3 x + \frac{x}{2} - \frac{\sin 4x}{8}
   \]
7. Therefore, the integral is:
   \[
   \boxed{x - \frac{1}{4} \sin 2x - \frac{1}{8} \sin 4x + \frac{4}{3} \sin^3 x + C}
   \]