How do you differentiate e^y cos(x) = 8 + sin(xy)?

Jul 22, 2015

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{y \cos \left(x y\right) + {e}^{y} \sin \left(x\right)}{{e}^{y} \cos \left(x\right) - x \cos \left(x y\right)}$

Explanation:

Start by making the assumption that this equation "implicitly defines" $y$ as a function of $x$ (more on this later). Once you've made this assumption, then differentiate both sides of the equation with respect to $x$, using the Chain Rule and Product Rule, to get:

${e}^{y} \cdot \frac{\mathrm{dy}}{\mathrm{dx}} \cdot \cos \left(x\right) - {e}^{y} \cdot \sin \left(x\right) = \cos \left(x y\right) \cdot \left(x \cdot \frac{\mathrm{dy}}{\mathrm{dx}} + y\right)$

(If you prefer, you could write this as: ${e}^{f \left(x\right)} f ' \left(x\right) \cos \left(x\right) - {e}^{f \left(x\right)} \sin \left(x\right) = \cos \left(x f \left(x\right)\right) \left(x f ' \left(x\right) + f \left(x\right)\right)$ )

This equation, complicated as it looks, can be solved for $\frac{\mathrm{dy}}{\mathrm{dx}}$. First, use the distributive property on the right-hand side to get:

${e}^{y} \frac{\mathrm{dy}}{\mathrm{dx}} \cos \left(x\right) - {e}^{y} \sin \left(x\right) = x \cos \left(x y\right) \frac{\mathrm{dy}}{\mathrm{dx}} + y \cos \left(x y\right)$

Now get the terms involving $\frac{\mathrm{dy}}{\mathrm{dx}}$ on one side and the other terms on the other side (and do a bit of factoring):

$\left({e}^{y} \cos \left(x\right) - x \cos \left(x y\right)\right) \frac{\mathrm{dy}}{\mathrm{dx}} = y \cos \left(x y\right) + {e}^{y} \sin \left(x\right)$

Now divide both sides by $\left({e}^{y} \cos \left(x\right) - x \cos \left(x y\right)\right)$ to get the final answer:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{y \cos \left(x y\right) + {e}^{y} \sin \left(x\right)}{{e}^{y} \cos \left(x\right) - x \cos \left(x y\right)}$

(alternatively, $f ' \left(x\right) = \frac{f \left(x\right) \cos \left(x f \left(x\right)\right) + {e}^{f \left(x\right)} \sin \left(x\right)}{{e}^{f \left(x\right)} \cos \left(x\right) - x \cos \left(x f \left(x\right)\right)}$)

But what does this mean? The original equation ${e}^{y} \cos \left(x\right) = 8 + \sin \left(x y\right)$ cannot be "explicitly" solved for $y$ as a function of $x$. However, if you use technology to make a graph of this equation, you will see that there are many pieces of this graph that pass the vertical line test, and therefore each of those pieces can be thought of as defining $y$ as a function of $x$ (avoid pieces where the vertical line test fails). This means the original equation defines $y$ "implicitly" as a function of $x$ on pieces that pass the vertical line test (essentially you want to avoid places where the tangent line is vertical).

I graphed this equation using ContourPlot on Mathematica (Wolfram Alpha gave me trouble with it) and got the following picture, which seems to pass the vertical line test when $x$ is close to zero but have "more difficulty" passing it as $x$ gets further from zero (pieces will still pass it though).

The derivative we found, $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{y \cos \left(x y\right) + {e}^{y} \sin \left(x\right)}{{e}^{y} \cos \left(x\right) - x \cos \left(x y\right)}$, will give you slopes of tangent lines at known points $\left(x , y\right)$ on exactly on the graph above.

What's an example of a known point? The simplest one I could think of is $\left(x , y\right) = \left(0 , \ln \left(8\right)\right) \setminus \approx \left(0 , 2.08\right)$ (go back to the original equation to see this). The slope at this point is therefore

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\ln \left(8\right) \cos \left(0\right) + {e}^{\ln \left(8\right)} \sin \left(0\right)}{{e}^{\ln \left(8\right)} \cos \left(0\right) - 0 \cdot \cos \left(0\right)} = \ln \frac{8}{8} \setminus \approx 0.26$