To evaluate the integral
\[
\int \left( \log(\log x) + \frac{1}{(\log x)^2} \right) dx,
\]
we can break it down into two separate integrals:
\[
\int \log(\log x) \, dx + \int \frac{1}{(\log x)^2} \, dx.
\]
### Step 1: Evaluate \(\int \log(\log x) \, dx\)
We will use integration by parts for this integral. Let:
- \( u = \log(\log x) \) (First function)
- \( dv = dx \) (Second function)
Then, we differentiate \( u \) and integrate \( dv \):
- \( du = \frac{1}{\log x} \cdot \frac{1}{x} \, dx = \frac{1}{x \log x} \, dx \)
- \( v = x \)
Using the integration by parts formula \(\int u \, dv = uv - \int v \, du\), we have:
\[
\int \log(\log x) \, dx = x \log(\log x) - \int x \cdot \frac{1}{x \log x} \, dx.
\]
The integral simplifies to:
\[
\int \log(\log x) \, dx = x \log(\log x) - \int \frac{1}{\log x} \, dx.
\]
### Step 2: Evaluate \(\int \frac{1}{\log x} \, dx\)
We will again use integration by parts. Let:
- \( u = \frac{1}{\log x} \)
- \( dv = dx \)
Then, we differentiate \( u \) and integrate \( dv \):
- \( du = -\frac{1}{(\log x)^2} \cdot \frac{1}{x} \, dx = -\frac{1}{x (\log x)^2} \, dx \)
- \( v = x \)
Using the integration by parts formula, we have:
\[
\int \frac{1}{\log x} \, dx = x \cdot \frac{1}{\log x} - \int x \cdot \left(-\frac{1}{x (\log x)^2}\right) \, dx.
\]
This simplifies to:
\[
\int \frac{1}{\log x} \, dx = \frac{x}{\log x} + \int \frac{1}{(\log x)^2} \, dx.
\]
### Step 3: Substitute back
Now substituting back into our original integral:
\[
\int \log(\log x) \, dx = x \log(\log x) - \left( \frac{x}{\log x} + \int \frac{1}{(\log x)^2} \, dx \right).
\]
Combining everything, we have:
\[
\int \left( \log(\log x) + \frac{1}{(\log x)^2} \right) dx = x \log(\log x) - \frac{x}{\log x} + \int \frac{1}{(\log x)^2} \, dx + \int \frac{1}{(\log x)^2} \, dx.
\]
The two integrals of \(\frac{1}{(\log x)^2}\) cancel each other out, leaving us with:
\[
\int \left( \log(\log x) + \frac{1}{(\log x)^2} \right) dx = x \log(\log x) - \frac{x}{\log x} + C,
\]
where \(C\) is the constant of integration.
### Final Answer:
\[
\int \left( \log(\log x) + \frac{1}{(\log x)^2} \right) dx = x \log(\log x) - \frac{x}{\log x} + C.
\]