Question: I was trying to find the smallest solution for $k$ to the following equation.
$ a^k = b\bmod c$. The problem is, the $'k'$ I get may not be the smallest. To find the smallest such $k$, I need to compute $O\_c(a)$. I was only able to find resources that say that $O\_c(a)|\phi(c)\ or \ \lambda(c)$ when $a$ and $c$ are coprime. Is there any such relation when $a$ and $c$ are non-coprime?

Answer: 
Considering $y=f(x)$, you get:
$$(x)'\_x=(e^{xy})'\_x \Rightarrow \\
1=e^{xy}\cdot (y+xy')\Rightarrow \\
y'=\frac{1-ye^{xy}}{xe^{xy}}$$
Wolfram [answer](https://www.wolframalpha.com/input/?i=derivative%20x%3De%5Exy).

Alternatively:
$$ F(x,y)=x-e^{xy}=0\\
\frac{dy}{dx}=-\frac{F\_x}{F\_y}=-\frac{1-ye^{xy}}{-xe^{xy}}=\frac{1-ye^{xy}}{xe^{xy}}$$
If you want to use partial derivatives, that is an option

$1 = \frac{\partial}{\partial x}(e^{xy}) + \frac{\partial}{\partial y}(e^{xy})\frac{dy}{dx}$

$1 = ye^{xy} + (xe^{xy})\frac{dy}{dx}\\
\frac {1-ye^{xy}}{xe^{xy}} = \frac{dy}{dx}\\
\frac {e^{-xy} -y}{x} = \frac{dy}{dx}\\
$