
\chapter{\index{ Implicit Functions} Implicit Functions and \index{ Implicit Differentiation} Implicit Differentiation }

\section{Implicit Functions}
We have seen that not all functions $y=f(x)$ are given by formulas.
Sometimes a function is determined by interpolating a table of experimentally
determined data (drawing a smooth curve between the points).
Another way a function can be determined is {\it implicitly}.  That means
that we have a formula which $x$ and $y$ together must satisfy.  The
equation may take the form $F(x,y)=$constant, or perhaps $F(x,y)=G(x,y)$.


\medskip
%Example 1.
\begin{example}

 (a) The circle can be written $x^2+y^2=r^2$, which is actually the
\index{ implicit equation} implicit equation of two functions at the same time: the upper semicircle
function $y=\sqrt{r^2-x^2}$ and the lower \index{ semicircle function} semicircle function 
$y=-\sqrt{r^2-x^2}$.  

(b) We can avoid \index{ fractional powers} fractional powers $y=x^{l/m}$ by
raising both sides to the $m$-th power and writing the implicit equation
$y^m=x^l$.  

(c) We can avoid \index{ negative powers} negative powers by writing $y=x^{-l/m}$ in the
form $y^mx^l=1$.  

(d) The points $(x,y)$ on an \index{ ellipse} ellipse with \index{focii} focii at $(x_1,y_1)$ and
$(x_2,y_2)$ and \index{ semimajor axis} semimajor axis $a$ satisfy the geometrical property:
\[
  (\text{ distance~from~}(x,y)~\text{ to~}(x_1,y_1))+
  (\text{ distance~from~}(x,y)~\text{ to~}(x_2,y_2))=2a,
\]
which leads to the following implicit equation for the ellipse:
\[
   \sqrt{(x-x_1)^2+(y-y_1)^2}+\sqrt{(x-x_2)^2+(y-y_2)^2}=2a.
\]

(e) In the case when the ellipse's axes of symmetry are parallel to the
$x$- and $y$-axes, a simpler implicit equation can be given, namely
$(x-h)^2/a^2+(y-k)^2/b^2=1$.

\end{example}


With many implicit equations, it is possible to solve for
$y$ in terms of $x$.  For example, we can do this for the circle
(Example 7.1(a)).  In that case we have the choice of whether to use
the {\bf \index{ explicit form} explicit form } $y=f(x)$ or the {\bf \index{ implicit  form} implicit  form }$F(x,y)=$constant.
However, there are other examples where it is impossible to solve algebraically
for $y$ in terms of $x$, and we have no choice but to work with the
implicit equation.

\medskip

\section{\index{ Implicit Differentiation} Implicit Differentiation }  

Suppose we want to find the derivative $y'$ at a point $(x,y)$ of an
implicitly defined curve.  What you do is: (1) take $d/dx$ of both sides of
the equation; (2) separate the terms involving $y'$ to one side of the
equation and the terms without $y'$ to the other side; and (3) solve for
$y'$.  In step (1), it is important to remember that you are
differentiating with respect to $x$ (or whatever letter is playing the role
of the $x$-variable), and so the chain rule must be used for expressions
like $y^2$.  In other words, the letter $y$ stands for a certain function
of $x$, and so taking $d/dx$ of $y^2$ is just like taking $d/dx$ of
$u(x)^2$: $\frac{d}{ dx}y^2=2y\frac{dy}{ dx}=2y\,y'.$

\medskip

%Example 2
\begin{example}
Find $y'$ at the point $(x,y)$ for each implicitly defined function in
Example 7.1.

\smallskip

(a) When we take $d/dx$ of both sides of $x^2+y^2=r^2$, remember that
(1) the derivative of $y^2$ is {\it not} $2y$ but rather $2yy'$, and 
(2) the derivative of $r^2$ is {\it not} $2r$ but rather $2rr'=0$, since
$r'=0$ as $r$ is a constant.

Thus, taking $d/dx$ of both sides gives:
$2x+2yy'=0$.  We next move the $2x$ to the right, and divide both sides
by $2y$ to solve for $y'$: $y'=-2x/(2y)=-x/y$.  This answer agrees with
our earlier formula for the derivative of $y=\sqrt{r^2-x^2}$, namely,
$y'=-x/\sqrt{r^2-x^2}$, since $y$ and $\sqrt{r^2-x^2}$ are the same.
Notice that when you differentiate an explicit function $y=f(x)$ your
answer is a formula in terms of $x$, whereas \index{ implicit differentiation} implicit differentiation 
generally leads to a formula involving {\it both $y$ and $x$}.

Note that if we take the \index{ lower semicircle function} lower semicircle function $y=-\sqrt{r^2-x^2}$, the
expression for $y'$ becomes $-\frac{x}{\sqrt{r^2-x^2}}$ which is a different 
formula. However, the formula $y'=-x/y$ is still the same! Thus the implicit
differentiation not only avoids the solution process for $y$ in terms of $x$,
but also gives the right answer for all possible solutions at once.

\smallskip

Parts (b) and (c) of this example will show us how to derive the
$nx^{n-1}$ rule when the power of $x$ is a fraction $n=l/m$ or $n=-l/m$,
where $l$ and $m$ are positive integers.  (In the section on the product
rule, we already saw how to get the $nx^{n-1}$ rule for any positive
integer $n$.)

\smallskip

(b) We take $d/dx$ of both sides of $y^m=x^l$, and then solve for $y'$:
\[
   my^{m-1}y'=lx^{l-1},
\qquad\text{so~that}\qquad 
   y'=\frac{l}{ m}\frac{x^{l-1}}{ y^{m-1}}.
\]
The last ratio simplifies algebraically, if we use the fact that
$y^{m-1}=y^m/y=x^l/x^{l/m}$.  That is,
\[
  y'=\frac{l}{ m}\frac{x^{l-1}}{ x^l/x^{l/m}}
    =\frac{l}{ m}x^{{l/m}-1}=nx^{n-1}
\qquad (\text{here~}n=\frac{l}{ m}).
\]

\smallskip

(c) We take $d/dx$ of both sides of $y^mx^l=1$ (using the product rule),
and then solve for $y'$: 
\[
  y^m\left(lx^{l-1}\right)+my^{m-1}y'x^l=0,\qquad
  \text{so~that}\qquad y'=-\frac{l y^m x^{l-1}}{ my^{m-1}x^l}.
\]
Canceling $y^mx^l$ from the numerator and denominator in the last expression,
we obtain:
\[
  -\frac{l}{ m} \frac{x^{-1}}{y^{-1}}
 =-\frac{l}{ m}\,\frac{y}{ x}=-\frac{l}{ m}\,\frac{x^{-l/m}}{x}
 =-\frac{l}{ m}x^{-\frac{l}{ m}-1}=nx^{n-1},
  \qquad\text{where}\qquad n=-\frac{l}{ m}.
\]

\smallskip

(d) When we take $d/dx$ of both sides, we must use the \index{ chain rule} chain rule several
times, first with the square root as the outside function and then when we
find the derivative of $(x-x_1)^2$, $(y-y_2)^2$, etc.  The result is:
\[
\frac{(x-x_1)+(y-y_1)y'}{\sqrt{(x-x_1)^2+(y-y_1)^2}}+
\frac{(x-x_2)+(y-y_2)y'}{\sqrt{(x-x_2)^2+(y-y_2)^2}}=0.
\]
Solving for $y'$ is
not difficult, but the expression we end up with is rather messy, so we
shall omit it.  If we had specific values for the foci $(x_1,y_1)$ and
$(x_2,y_2)$, and if we wanted to find the slope $y'$ at a particular point
$(x,y)$, then we could substitute all of these numerical values in place of
$x,y,x_1,y_1,x_2,y_2$, ending up with an equation of the form $\alpha+\beta
y'=0$ (where $\beta$ comes from bringing together all of the terms with
$y'$ and $\alpha$ comes from bringing together all the terms without $y'$).
Such an equation has solution simply $y'=-\alpha/\beta$.  We will see such
situations later in the story problems.


%%% To update! Give a good exercise for the ellipse derivative.

\smallskip

(e) Here we get: $2(x-h)/a^2+2(y-k)y'/b^2=0$.  Solving for $y'$, we obtain
\[
     y'=-\frac{b^2}{ a^2}\,\frac{x-h}{ y-k}.
\]


\end{example}



%Example 3
\begin{example}
If you know that the curve $(xy)^4+x^{-2}+y^{-1}=C$ (where $C$ is a
constant) passes through the point $(1,2)$, find the $y$-coordinate of the
point $(1.01,?)$ on the curve near $(1,2)$.  Use the tangent line
approximation.

\smallskip
({\bf Note:} 
The constant $C$ is not given.  We could easily compute it from
the fact that the point $(1,2)$ satisfies the equation.  However, we will
never need to know the value of $C$, so we won't bother to compute it.)

\smallskip
In this problem there is no way you can find an exact expression for the
$y$-coordinate corresponding to $x=1.01$, because when you substitute
$x=1.01$ you get an equation for $y$ that cannot be solved algebraically.
The equation for $y$ could be solved by an approximation method that we'll
learn later (\index{ Newton's method} Newton's method).  In the meantime, the best we can do is to
use the \index{ tangent line approximation} tangent line approximation to find the $y$-coordinate.  In this
problem we know that the implicitly defined $y=f(x)$ has value 2 when $x=1$
(this is what it means to say that the curve passes through the point
(1,2)).  We want to know $f(1.01)$.  According to the tangent line
approximation, $f(1.01)\approx f(1)+0.01 f'(1)=2+0.01y'$, where $y'$
denotes the derivative at the point $(1,2)$.  To find that derivative we
first take $d/dx$ of both sides of our \index{ implicit equation} implicit equation.  We use the chain
rule and the product rule to find $\frac{d}{ dx}(xy)^4$, and on the right we
get 0 (the derivative of any constant is 0): 
\[
  4(xy)^3(xy'+1\cdot y)+(-2x^{-3})+(-y^{-2}y')=0.
\]
Once we've taken $d/dx$ we can substitute
the particular $x$ and $y$ values of the point where we want the
derivative.  After that our equation will look a lot simpler --- just some
numbers together with the unknown $y'$: 
\begin{align*}
  &4(1\cdot 2)^3(y'+2)+(-2\cdot 1)+(-2^{-2}y')=0,\\
\text{i.e., }\quad &y'(32-0.25)+64-2=0, \\
\text{i.e., }\quad &y'=-62/31.75=-1.953. 
\end{align*}
Finally,
substituting this value of $y'=f'(1)$ in the tangent line approximation
gives the $y$-coodinate as $2+0.01\cdot(-1.953)=1.98047$.

\end{example}



%%Example 4
\begin{example}

Suppose that the ellipse in Example 7.1(d) has foci at the points (0,1) and
(3,0), and passes through the point (2,3).  Find the $y$-coordinate of the
point $(1.99,?)$ through which it passes.  Use the tangent line
approximation.

\smallskip

The tangent line approximation tells us that $f(1.99)\approx f(2)- 0.01
f'(2)=3-0.01y'$, where $y'$ is the derivative at the point $(2,3)$.  The
\index{ implicit differentiation} implicit differentiation of the equation of this ellipse has already been
carried out, so it remains just to substitute the particular values we're
given: $x_1=0$, $y_1=1$, $x_2=3$, $y_2=0$, $x=2$, $y=3$:
\[
\frac{2+2y'}{\sqrt{8}}+\frac{-1+3y'}{\sqrt{10}}=0,\qquad
\text{so~that}\qquad 
        \left(\frac{2}{\sqrt{8}}-\frac{1}{\sqrt{10}}\right)
    +y' \left(\frac{2}{\sqrt{8}}+\frac{3}{\sqrt{10}}\right)=0,
\]
i.e., $0.39088+1.65579y'=0$.  Thus, $y'=-0.39088/1.65579=-0.23607$,
and so $f(1.99)\approx 3-0.01y'=3.00236$.

\end{example}



%Example 5
\begin{example}

  You are standing at (0,1) and receiving light from two sources: source A
located at $(-1,0)$ and source B located at $(1,0)$.  You want to start
walking in the direction which keeps the total \index{ light intensity} light intensity from the two
sources as constant as possible.  Assume that light intensity from a source
is proportional to the strength of the source and inversely proportional to
the square of the distance from the source.  (a) If A and B are equally
strong, show that you should walk horizontally, i.e., set out along the
line $y=1$.  (b) If B is twice as strong as A, find the line along which
you should move.

\smallskip 

We are interested here in the curve of constant total light intensity
passing through the point (0,1).  That is, we want an equation satisfied by
all points $(x,y)$ where the light intensity from A plus the light
intensity from B remains constant.  Since light intensity is inversely
proportional to the square of the distance from the source, this means that
\[
\frac{K}{(\text{dist~of~}(x,y)\text{ from~A})^2}
+\frac{K}{(\text{dist~of~}(x,y)\text{~from~B})^2}=C.
\]
Here the proportionality constant $K$ depends on the strength of the
source; since A and B have the same strength in part (a), the constants are
the same.  In part (b) we change the second $K$ to $2K$, because B is twice
as strong as A.

\smallskip

Next, we use the distance formula in the denominators: the square of the
distance from $(x,y)$ to $(-1,0)$ is $(x+1)^2+y^2$, and the square of the
distance from $(x,y)$ to $(1,0)$ is $(x-1)^2+y^2$.  For convenience, we
also divide through by $K$, so that there are no unknown constants on the
left.  The result is 
\[
\frac{1}{ (x+1)^2+y^2}+\frac{1}{(x-1)^2+y^2}=\frac{C}{ K}.
\]

\smallskip
The question asks for the direction to go in from the point $(0,1)$ that
best keeps to the curve of constant total light intensity.  This amounts to
asking for the tangent line to the curve at $(0,1)$.  To find $y'$, we take
$d/dx$ of both sides, and then substitute the point $(x,y)=(0,1)$ where we
want to find $y'$.  It is important to note that the fact that you happen
to be walking from the point $(0,1)$ is not used until {\it after}
performing the implicit differentiation.  When we take $d/dx$, we use the
chain rule, writing the first term on the left as
$\left((x+1)^2+y^2\right)^{-1}$, and similarly for the second term on the
left (it is more efficient to use the rule for $\frac{d}{ dx}u^{-1}$ than to
use the quotient rule): 
\[
  -\left((x+1)^2+y^2 \right)^{-2}(2(x+1)+2yy')
  -\left((x-1)^2+y^2 \right)^{-2}(2(x-1)+2yy')=0.
\]
(Notice that the constants $C$ and $K$ have disappeared, because the
derivative of any constant is 0.) Substituting $x=0$, $y=1$ gives:
\[
    -(1+1)^{-2}(2+2y')-(1+1)^{-2}(-2+2y')=0.
\]  Solving this, we find that
$y'=0$, i.e., the curve of constant total light intensity has horizontal
tangent line at the point $(0,1)$.

\smallskip

(b) When the source B is twice as strong as the source A, the effect is to
replace the second $K$ by $2K$, and this means having a 2 rather than 1
always in the numerator of the second term on the left.  Our last equation
is now 
\[
    -(1+1)^{-2}(2+2y')-2(1+1)^{-2}(-2+2y')=0.
\]
We can clear denominators by multiplying through by 2, obtaining:
$-1-y'+2-2y'=0$, i.e., $y'=1/3$.  Thus, the tangent line has slope 1/3 and
$y$-intercept 1, so its equation is $y=\frac{1}{ 3}x+1$.

\end{example}



