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}}$$
Let $u=xy$, then taking the derivative of both sides,
$$\frac{dx}{dx}=\frac{de^u}{du}\frac{du}{dx}$$
where the second expression follows by the chain rule. It follows
$$1=e^u\frac{d(xy)}{dx}$$

and using product rule,
$$1=e^{xy}\left(1\cdot y+x\cdot\frac{dy}{dx}\right)\implies 1=e^{xy}\left( y+xy'\right)$$

Solve for $y'$.