Solving integral $\int \frac{\ln x-1}{\ln^2x}dx$ How to solve this integral: 
$$
\int \frac{\ln x-1}{\ln^2x}dx
$$
It doesn't really work by parts, neither by substitution $x=e^t$. How shall I proceed?
 A: If you look at the integrand and remember the quotient rule for derivatives,
\begin{align*}
(f/g)'= \frac{f'g-fg'}{g^2},
\end{align*}
you should try to look for an antiderivative of the form $h(x)/\log x$. Differentiating this, you get
\begin{align*}
\frac{d}{dx} \frac{h(x)}{\log x} = \frac{h'(x) \log x - h(x)/x}{(\log x)^2},
\end{align*}
so if $h'(x) = 1$ and $h(x)/x = 1$, you have your antiderivative. But with $h(x)=x$, this is precisely the case. Hence
\begin{align*}
\int \frac{\log x -1}{(\log x)^2} \hspace{0.1cm} dx = \frac{x}{\log x} + C.
\end{align*}
A: As an alternative:
$$
{\ln x-1\over \ln^2x} = {1\over \ln x} - {1\over \ln^2x}
$$
So you have:
$$
\begin{align}
I &= \int \left({1\over \ln x} - {1\over \ln^2x}\right)dx \\
&= \int \left({1\over \ln x}\right)dx - \int\left({1\over \ln^2x}\right)dx \\
&= \text{li}(x) - \int\left({1\over \ln^2x}\right)dx
\end{align}
$$
Where $\text{li}(x)$ is the logarithmic integral. Now let's solve the second integral:
$$
J = \int {dx\over \ln^2x}
$$
Let:
$$
u = \ln x\\ 
du = {dx\over x}\\
x = e^u
$$
Then:
$$
J = \int {e^u\over u^2}du
$$
Apply integration by parts:
$$
f = e^u\\
dg = {1\over u^2}du\\
f' = e^u\\
g = -{1\over u}
$$
Hence:
$$
J = - {e^u\over u} - \int -{e^u \over u} du = -{e^u\over u} + \text{Ei}(u)\\
= \text{Ei}(\ln x) - {e^u\over u} \stackrel{\text{Ei}(\ln x) = \text{li}(x)}{=} \text{li}(x) - {x\over \ln x}
$$
Here $\text{Ei}(x)$ is the exponential integral.
Using $J$ in $I$:
$$
I = \text{li}(x) - \left(\text{li}(x) - {x\over \ln x}\right) + C =  {x\over \ln x} + C
$$
A: Let $\ln x=y,x=e^y, dx=e^y dy$
$$ \int \frac{\ln x-1}{\ln^2x}dx =\int e^y\left(\dfrac1y-\dfrac1{y^2}\right)dy$$
Method$\#1:$
$$\dfrac{d\left(e^yf(y)\right)}{dy}=e^y(f(y)+f'(y))$$
$$\int e^y\left(\dfrac1y-\dfrac1{y^2}\right)dy=\int\dfrac{d\left(\dfrac{e^y}y\right)}{dy}\cdot dy=\dfrac{e^y}y+K$$
Method$\#2:$
Integrate by parts $$\int\dfrac{e^y}{y^2}dy=e^y\int\dfrac{dy}{y^2}-\int\left(\dfrac{d(e^y)}{dy}\int\dfrac{dy}{y^2}\right)dy=-\dfrac{e^y}y+\int\dfrac{e^y}ydy$$
$$\implies\int\dfrac{e^y}ydy-\int\dfrac{e^y}{y^2}dy=\dfrac{e^y}y+K$$
