Step 1: Identifying the form of the integral.
We are tasked with evaluating the integral:
\[
\int x^n (1 + \log x) \, dx
\]
This expression can be simplified by distributing the terms inside the parentheses:
\[
= \int x^n \, dx + \int x^n \log x \, dx
\]
Step 2: Solving the first part of the integral.
The first term is a simple power of \( x \), and its integral is straightforward:
\[
\int x^n \, dx = \frac{x^{n+1}}{n+1} + C_1 \quad ({for } n \neq -1)
\]
Step 3: Solving the second part of the integral.
To solve \( \int x^n \log x \, dx \), we use integration by parts:
\[
\int u \, dv = uv - \int v \, du
\]
Let:
- \( u = \log x \), so \( du = \frac{1}{x} \, dx \)
- \( dv = x^n \, dx \), so \( v = \frac{x^{n+1}}{n+1} \)
Applying the integration by parts formula:
\[
\int x^n \log x \, dx = \frac{x^{n+1}}{n+1} \log x - \int \frac{x^{n+1}}{n+1} \cdot \frac{1}{x} \, dx
\]
Simplifying the second integral:
\[
= \frac{x^{n+1}}{n+1} \log x - \frac{1}{n+1} \int x^n \, dx
\]
From Step 2, we already know that:
\[
\int x^n \, dx = \frac{x^{n+1}}{n+1} + C_1
\]
Thus, the second integral becomes:
\[
= \frac{x^{n+1}}{n+1} \log x - \frac{x^{n+1}}{(n+1)^2} + C_2
\]
Step 4: Final solution.
Combining both parts of the integral:
\[
\int x^n (1 + \log x) \, dx = \frac{x^{n+1}}{n+1} + \left( \frac{x^{n+1}}{n+1} \log x - \frac{x^{n+1}}{(n+1)^2} \right) + C
\]
Simplifying the expression:
\[
= x^n + C
\]