<s>[INST] What will the value of following log expression What will be the value of the expression 
$$\log_x \frac{x}{y} + \log_y \frac{y}{x}?$$
I tried: 
$$\log_x x - \log_x y + \log_y y - \log_y x = 1 - \log_x y + 1 - \log_y x
= 2 - \log_x y - \log_y x.$$
Now what after this ?
 [/INST] If $\log_a b = r$, this means that $a^r = b$, so $b = e^{\ln(a^r)} = e^{r\ln(a)}$. Therefore, $\ln(b) = r\ln (a)$, or 
$$\log_a b = \frac{\ln(b)}{\ln a}.$$
Thus, for 
$$\log_x y = \frac{\ln y}{\ln x}\quad\text{and}\quad \log_y x = \frac{\ln x}{\ln y},$$
so
$$\log_x y = \frac{1}{\log_y x}.$$
So:
$$\begin{align*}
\log_x\frac{x}{y} +\log_y\frac{y}{x} &= 1-\log_x y + 1 - \log_y x\\
&= 2 - \log_x y - \frac{1}{\log_x y}\\
&= 2 - \left(\log_x y + \frac{1}{\log_x y}\right)\\
&= 2 - \left(\frac{(\log_x y)^2 + 1}{\log_x y}\right)\\
&= -\frac{(\log_x y)^2 - 2\log_x(y) + 1}{\log_x y}\\
&= - \frac{(\log_x y - 1)^2}{\log_x y}.
\end{align*}$$
So for $r=\log_x y$, you get $-\frac{(r-1)^2}{r}$. The value will depend on $r$; if, for example, $y=x$, then you get $0$; if $y=x^2$, then you get $-\frac{1}{2}$; if $y=x^{-1}$, then you get $4$, etc. 
</s>