To evaluate the integral \( \int (\log_e x)^2 \, dx \), we will use integration by parts. Let's denote the integral as \( I \).
### Step 1: Set up the integration by parts
We will use the formula for integration by parts:
\[
\int u \, dv = uv - \int v \, du
\]
Let's choose:
- \( u = (\log_e x)^2 \) (first function)
- \( dv = dx \) (second function)
Now, we need to find \( du \) and \( v \):
- Differentiate \( u \):
\[
du = 2 \log_e x \cdot \frac{1}{x} \, dx = \frac{2 \log_e x}{x} \, dx
\]
- Integrate \( dv \):
\[
v = x
\]
### Step 2: Apply integration by parts
Now substituting into the integration by parts formula:
\[
I = x (\log_e x)^2 - \int x \cdot \frac{2 \log_e x}{x} \, dx
\]
This simplifies to:
\[
I = x (\log_e x)^2 - 2 \int \log_e x \, dx
\]
### Step 3: Evaluate \( \int \log_e x \, dx \)
We will again use integration by parts for \( \int \log_e x \, dx \):
- Let \( u = \log_e x \) and \( dv = dx \).
- Then, \( du = \frac{1}{x} \, dx \) and \( v = x \).
Applying integration by parts again:
\[
\int \log_e x \, dx = x \log_e x - \int x \cdot \frac{1}{x} \, dx
\]
This simplifies to:
\[
\int \log_e x \, dx = x \log_e x - \int 1 \, dx = x \log_e x - x + C
\]
### Step 4: Substitute back into the original integral
Now substitute \( \int \log_e x \, dx \) back into the expression for \( I \):
\[
I = x (\log_e x)^2 - 2 \left( x \log_e x - x \right)
\]
Distributing the -2:
\[
I = x (\log_e x)^2 - 2x \log_e x + 2x
\]
### Step 5: Final expression
Factoring out \( x \):
\[
I = x \left( (\log_e x)^2 - 2 \log_e x + 2 \right) + C
\]
Thus, the final result is:
\[
\int (\log_e x)^2 \, dx = x \left( (\log_e x)^2 - 2 \log_e x + 2 \right) + C
\]