# Did I take the derivative correctly? $x^y=y^x$

Need to differentiate following equation: $$x^y=y^x$$ My attempt: $$x^y\log(x) \cdot y' = y^x\log(y)\cdot1;$$ $$y'=\frac{y^x\log(y)}{x^y\log(x)}$$ Please tell me if I've made a mistake.

• I think he means "take the derivative." – Thomas Andrews Nov 1 '13 at 20:51
• "$x^y=y^x$ is not an expression, but an equation defining a solution set in the first quadrant of the $(x,y)$-plane. What do you mean by "deriving" this equation? – Christian Blatter Nov 1 '13 at 21:00
• I have suggested the edit. – Ahaan S. Rungta Nov 1 '13 at 21:05
• @ChristianBlatter I really don't know what I mean – k1ber Nov 1 '13 at 21:08

Not quite. The idea is to take the $\log$ of both sides and implicitly differentiate. $$\begin {eqnarray*} x^y &=& y^x \\ y \cdot \log (x) &=& x \cdot \log (y) \\ y' \cdot \log(x) + \dfrac {y}{x} &=& \dfrac {x}{y} \cdot y' + \log (y) \\ y' \cdot \left( \log(x) - \dfrac {x}{y} \right) &=& \log(y) - \dfrac {y}{x} \\ y' &=& \dfrac {\log (y) - \dfrac {y}{x}}{\log (x) - \dfrac {x}{y}}, \end {eqnarray*}$$so our answer is $$y' = \boxed {\dfrac {x \cdot \log (y) - y}{y \cdot \log (x) - x} \cdot \dfrac {y}{x}}.$$

• Answer should be multiplied by y/x, x being the denominator of the numerator and y being the denominator of the denominator in the step leadinf to "so our answer is". – Bernard Massé Nov 21 '14 at 21:23
• @BernardMassé - whoops, you're right - thanks! Fixed. :) – Ahaan S. Rungta Nov 21 '14 at 23:41

Just to let you know where you went wrong: it was in differentiating the right hand side. You're trying to find

$\frac{d}{dx} y^x$

and applying the rule that

$\frac{d}{dx} a^x = a^x \ln (a),$

with $y$ replacing $a$. Unfortunately, that "rule" applies only in the case where $a$ is a constant; in your problem, the base $y$ is actually a function of $x$, and so the rule doesn't apply. Thus to properly compute the derivative, you have to rewrite $y^x = e^{x \ln (y)}$, as others have already shown.

$y^x = x^y$

$\ln y^x = \ln x^y$

$x \ln y = y \ln x$

$\ln y + (x/y)(dy/dx) = (dy/dx)(ln x) + y/x$

$(x/y)(dy/dx) - (dy/dx)(\ln x) = y/x - \ln y$

$(dy/dx)(x/y - \ln x) = y/x - \ln y$

$(dy/dx) = (y/x - \ln y)/(x/y - \ln x)$

$(dy/dx) = (y^2 - xy\ln y)/(x^2 - xy\ln x)$