# 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 ?

-
first x and y are base. I don't know . how I can edit here. so I can represent them as base. –  Vivek Goel Apr 14 '11 at 17:40
Ah, I see, so you want $\log_{x}{(x/y)}$? If so, use $\log_x {(x/y)}$ –  t.b. Apr 14 '11 at 17:41
does it really complex like this to edit ? –  Vivek Goel Apr 14 '11 at 17:42
I tried to fix it for you, I hope that's what you intended. Well, it's TeX, so it needs some time to get used to, see here for some info on resources on how to learn it. –  t.b. Apr 14 '11 at 17:48

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.

-

How about $2-\frac{\log y}{\log x} - \frac{\log x}{\log y}$

Which is $2-\frac{(\log x)^2+(\log y)^2}{\log x\log y}$

Not sure if this is simpler, but it gets rid of the different bases.

-
answer option was 2 ,1 ,.5 ,-1 now I am thinking that question is wrong –  Vivek Goel Apr 14 '11 at 18:12
Well, the value is not constant; it is equal to $-(r-1)^2/r$, where $r=\log_xy$. So, for example, if $x=y$, you get $0$, but if $y = x^{-1}$ then you get $4$. –  Arturo Magidin Apr 14 '11 at 18:23