# How do you implicitly differentiate -1=xy^2+x^2y-e^y-sec(xy) ?

May 12, 2016

$- 1 = x {y}^{2} + {x}^{2} y - {e}^{y} - \setminus \sec \left(x y\right)$

Let's replace the secant with a cosine.
$- 1 = x {y}^{2} + {x}^{2} y - {e}^{y} - \frac{1}{\setminus} \cos \left(x y\right)$

Now we take the derivative wrt x on BOTH SIDES!
$\frac{d}{\mathrm{dx}} - 1 = \frac{d}{\mathrm{dx}} \left(x {y}^{2} + {x}^{2} y - {e}^{y} - \frac{1}{\setminus} \cos \left(x y\right)\right)$

The derivative of a constant is zero and the derivative is linear!
$0 = \frac{d}{\mathrm{dx}} \left(x {y}^{2}\right) + \frac{d}{\mathrm{dx}} \left({x}^{2} y\right) - \frac{d}{\mathrm{dx}} \left({e}^{y}\right) - \frac{d}{\mathrm{dx}} \left(\frac{1}{\setminus} \cos \left(x y\right)\right)$

Now using product rule on just the first two terms we get!
$0 = \left\{\frac{d}{\mathrm{dx}} \left(x\right) {y}^{2} + x \frac{d}{\mathrm{dx}} \left({y}^{2}\right)\right\} + \left\{\frac{d}{\mathrm{dx}} \left({x}^{2}\right) y + {x}^{2} \frac{d}{\mathrm{dx}} y\right\} - \frac{d}{\mathrm{dx}} \left({e}^{y}\right) - \frac{d}{\mathrm{dx}} \left(\frac{1}{\setminus} \cos \left(x y\right)\right)$

Next lots and lots of Fun with the chain rule! Watch the last term!
(also doing the simple x derivatives )
 0 = {1* y^2 + x* (d/dy y^2)*dy/dx} + {2x*y + x^2*d/dy y* dy/dx} - {d /dy e^y } {dy/dx}
$- \frac{d}{d \cos \left(x y\right)} {\left(\setminus \cos \left(x y\right)\right)}^{- 1} \cdot \frac{d}{d x y} \cos \left(x y\right) \cdot \frac{d}{\mathrm{dx}} \left\{x y\right\}$

Doing some of those y derivatives, xy derivatives and cos(xy) derivatives also doing the product rule and chain rule one more time on the last part of the last term.
 0 = {y^2 + x*2*y*dy/dx} + {2xy + x^2*1* dy/dx} - e^y {dy/dx}
$- \left(- 1\right) {\left(\setminus \cos \left(x y\right)\right)}^{- 2} \cdot - \sin \left(x y\right) \cdot \left(\frac{\mathrm{dx}}{\mathrm{dx}} y + x \frac{\mathrm{dy}}{\mathrm{dy}} \frac{\mathrm{dy}}{\mathrm{dx}}\right)$

Neaten a bit and finish all the derivatives
$0 = {y}^{2} + 2 x y \frac{\mathrm{dy}}{\mathrm{dx}} + 2 x y + {x}^{2} \frac{\mathrm{dy}}{\mathrm{dx}} - {e}^{y} \frac{\mathrm{dy}}{\mathrm{dx}}$
$- \left(\setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right)\right) \left(y + x \frac{\mathrm{dy}}{\mathrm{dx}}\right)$

Now separate into term with $\frac{\mathrm{dx}}{\mathrm{dy}}$ and without
$0 = {y}^{2} + 2 x y - y \setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right) +$
$2 x y \frac{\mathrm{dy}}{\mathrm{dx}} + {x}^{2} \frac{\mathrm{dy}}{\mathrm{dx}} - {e}^{y} \frac{\mathrm{dy}}{\mathrm{dx}} - x \setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right) \frac{\mathrm{dy}}{\mathrm{dx}}$

Bring everyting without $\frac{\mathrm{dy}}{\mathrm{dx}}$ to one side and collection like terms on the other
$y \setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right) - {y}^{2} - 2 x y =$
$\left(2 x y + {x}^{2} - {e}^{y} - x \setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right)\right) \frac{\mathrm{dy}}{\mathrm{dx}}$

Divide though to find $\frac{\mathrm{dy}}{\mathrm{dx}}$
$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{y \setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right) - {y}^{2} - 2 x y}{2 x y + {x}^{2} - {e}^{y} - x \setminus \sin \frac{x y}{\setminus} {\cos}^{2} \left(x y\right)}$

That was very long!

#### Explanation:

Went with a VERY long explanation with simple example because implicit differentiation can be tricky and the chain rule is very very very important.

You need to use about three BIG Calculus rules to solve this and three specific function derivative.

1) The linearity of the derivative.
$\frac{d}{\mathrm{dx}} \left(A + B + C + D\right) = \frac{d}{\mathrm{dx}} \left(A\right) + \frac{d}{\mathrm{dx}} \left(B\right) + \frac{d}{\mathrm{dx}} \left(C\right) + \frac{d}{\mathrm{dx}} \left(D\right)$

2) The product rule.
$\frac{d}{\mathrm{dx}} \left(f \left(x\right) \cdot g \left(x\right)\right) = \left(f \left(x\right)\right) \cdot \frac{d}{\mathrm{dx}} g \left(x\right) + \left(\frac{d}{\mathrm{dx}} f \left(x\right)\right) \cdot g \left(x\right)$

3) By far, the most important concept in implicit differentiation is
the chain rule. For compound functions, functions of other functions, $f \left(u \left(x\right)\right)$ we have,

$\frac{d}{\mathrm{dx}} \left(f \left(u \left(x\right)\right)\right) = \frac{d}{\mathrm{du}} f \left(u \left(x\right)\right) \frac{\mathrm{du}}{\mathrm{dx}}$ .

You can keep going with this

$\frac{d}{\mathrm{dx}} \left(f \left(u \left(y \left(x\right)\right)\right)\right) = \frac{d}{\mathrm{du}} f \left(u\right) \frac{\mathrm{du}}{\mathrm{dy}} \frac{\mathrm{dy}}{\mathrm{dx}}$ ,

and on and on and on. Note $\frac{\mathrm{dx}}{\mathrm{dx}} = 1$ .

Example: If you have a function of a function $f \left(u\right)$ where $u$ is a funuction of $x$. ie $f \left(x\right) = \sqrt{1 - {x}^{2}}$ (Here $f \left(u\right) = \sqrt{u}$ and $u \left(x\right) = 1 - {x}^{2}$ .

$\frac{d}{\mathrm{dx}} \sqrt{1 - {x}^{2}} = \frac{d}{\mathrm{dx}} {\left(1 - {x}^{2}\right)}^{\frac{1}{2}} = \left(\frac{d}{\mathrm{du}} \left({u}^{\frac{1}{2}}\right)\right) \cdot \left(\frac{d}{\mathrm{dx}} \left(1 - {x}^{2}\right)\right)$

$= \frac{1}{2} \left({u}^{- \frac{1}{2}}\right) \cdot \left(- 2 x\right)$ recall $u = \left(1 - {x}^{2}\right)$

=-x (1-x^2)^{-1/2} = -x /{sqrt(1-x^2}

Expressions for specific functions types.
A) How to take the derivative of power functions, $f \left(x\right) = c {x}^{n}$ .
$\frac{d}{\mathrm{dx}} \left(c \cdot {x}^{n}\right) = c \cdot n \cdot {x}^{n - 1}$

B) How to take the derivative of ${e}^{x}$ .
$\frac{d}{\mathrm{dx}} \left({e}^{x}\right) = {e}^{x}$ <- boring eh?

C) How to take the derivative of $\setminus \cos \left(x\right)$ because $\setminus \sec \left(x\right) = \frac{1}{\setminus \cos \left(x\right)}$.
$\frac{d}{\mathrm{dx}} \left(\setminus \cos x\right) = - \setminus \sin x$

The key to implicit differentiation is to use the chain rule to take the derivative wrt x of and function of both x and y, like a circle.

$9 = {x}^{2} + {y}^{2}$
$\frac{d}{\mathrm{dx}} 9 = \frac{d}{\mathrm{dx}} \left({x}^{2} + {y}^{2}\right) = \frac{d}{\mathrm{dx}} \left({x}^{2}\right) + \frac{d}{\mathrm{dx}} \left({y}^{2}\right)$
$0 = 2 x + \frac{d}{\mathrm{dy}} {y}^{2} \cdot \frac{\mathrm{dy}}{\mathrm{dx}}$
$0 = 2 x + 2 y \cdot \frac{\mathrm{dy}}{\mathrm{dx}}$
$- 2 x = 2 y \cdot \frac{\mathrm{dy}}{\mathrm{dx}}$
$\frac{\mathrm{dy}}{\mathrm{dx}} = - \frac{x}{y}$