In this section, we will learn that even when $y$ is not explicitly expressed in terms of $x$, we can apply differentiation rules to find $dy/dx$. This is called implicit differentiation.

In most of the functions that we have encountered, the dependent variable, $$y$$, has been explicitly expressed in terms of the independent variable, $$x$$, as in $y=\frac{\sin x}{x},\qquad\text{or}{\qquad y=x\sqrt{x^{2}+1}.}$ In general, $$y$$ is an explicit function of $$x$$ if $y=f(x).$ However, sometimes we have to deal with equations of the form $F(x,y)=0,$ where the equation is not solved for $$y$$, such as $x^{2}+y^{2}=4,$ or $x^{3}-3xy+y^{3}=0.$ In such cases, we say $$y$$ is implicitly expressed in terms of $$x$$; if a value of $$x$$ is given, a value or values of $$y$$ may be determined. Sometimes, we can solve these equations for $$y$$ in terms of $$x$$, thereby $$y$$ becomes an explicit function (or perhaps several functions) of $$x$$. For example, we can solve the equation $$x^{2}+y^{2}=4$$ (this is the equation of a circle of radius 2 centered at the origin) for $$y$$ and obtain: $y=\sqrt{4-x^{2}},\qquad\text{and}{\qquad y=-\sqrt{4-x^{2}}}.$ We may state that the equation $$x^{2}+y^{2}=4$$ implicitly defines two functions
$f(x)=\sqrt{4-x^{2}},\qquad\text{and}{\qquad g(x)=-\sqrt{4-x^{2}}}.$
The graph of $$f$$ is the upper semicircle and the graph of $$g$$ is the lower semicircle (see Figure 1).

 (a) Graph of $$x^{2}+y^{2}=4$$ (b) Graph of $$y=\sqrt{4-x^{2}}$$ (c) Graph of $$y=-\sqrt{4-x^{2}}$$ Figure 1

If we can solve explicitly for $$y$$, then we can differentiate it as before.

Example 1

If $$x^{2}+y^{2}=4$$, find $$\dfrac{dy}{dx}$$.

Solution

We discussed that $$y$$ can be written as $$y=f(x)=\sqrt{4-x^{2}}$$ or $$y=g(x)=-\sqrt{4-x^{2}}$$. We can easily compute the derivatives of $$f$$ and $$g$$ by the chain rule:
\begin{align} f'(x) & =\frac{d}{dx}\sqrt{4-x^{2}}\\ & =\frac{d}{du}(\sqrt{u})\frac{du}{dx}\tag{{u=4-x^{2}}}\\ & =\frac{1}{2\sqrt{u}}(-2x)\\ & =\frac{-2x}{2\sqrt{4-x^{2}}}\\ & =-\frac{x}{f(x)}\\ & =-\frac{x}{y},\end{align}
whenever $$y=f(x)\neq0$$. Similarly, we can show $g'(x)=-\frac{-x}{\sqrt{4-x^{2}}}=-\frac{x}{g(x)}=-\frac{x}{y},$ whenever $$y=g(x)\neq0$$. So in general, we can write
$\frac{dy}{dx}=-\frac{x}{y}\qquad\text{if }y\neq0.$

Sometimes it is very difficult or even impossible to solve an implicit relation for $$y$$. For example, solving the equation $$x^{3}-3xy+y^{3}=0$$ for $$y$$ in terms of $$x$$ is difficult (computer algebra systems such as Mathematica, Maple, and Sympy can solve this equation for $$y$$, but the expressions that they give are complicated and long). This equation represents a curve that is called the folium of Descartes (see Figure 2), and implicitly defines infinitely many functions (for example see, Figure 3).

 Figure 3: Graphs of three functions implicitly defined by $x^3+y^3-3xy=0$

If we assume that $$y$$ can be defined as one or more differentiable functions of $$x$$, we can apply the chain rule to find $$dy/dx$$ directly without solving the equation. In this method that is known as implicit differentiation, we differentiate both sides of an equation with respect to $$x$$ and treat $$y$$ as a differentiable function of $$x$$. Then, we try to solve for $$dy/dx$$.

Example 2

If $$x^{2}+y^{2}=4$$, find $$dy/dx$$ using implicit differentiation.

Solution

We assume $$dy/dx$$ exists and apply $$\dfrac{d}{dx}$$ to both sides of the equation:
$\frac{d}{dx}\left(x^{2}+y^{2}\right) =\frac{d}{dx}4$ [Recall that the derivative of a constant is zero] $\dfrac{d}{dx}x^2+\dfrac{d}{dx}y^2=0$ $2x+2y\frac{dy}{dx} =0.\tag{i}$ For the last step, we have used the chain rule:
$\frac{d}{dx}(y^{2})=\frac{d}{dy}(y^{2})\cdot\frac{dy}{dx}=2y\frac{dy}{dx}.$ We can solve Equation (i) for $$dy/dx$$ and obtain:
$\frac{dy}{dx}=-\frac{x}{y}.$

• Note that in implicit differentiation only those values of the variables which satisfy the original relation can be substituted in the derivative.

Example 3

Find the equation of the tangent line to the curve described by $$x^{3}+y^{3}-3xy=0$$ at $$(\sqrt[3]{2},\sqrt[3]{4})$$.

Solution

First of all, we note that $$x=\sqrt[3]{2}$$ and $$y=\sqrt[3]{4}$$ satisfy $$x^{3}+y^{3}-3xy=0$$. Differentiating with respect to $$x$$, we obtain:
\begin{align} \frac{d}{dx}(x^{3})+\frac{d}{dx}\left(y^{3}\right)-3\frac{d}{dx}(xy) & =0,\\ 3x^{2}+3y^{2}\frac{dy}{dx}-3y-3x\frac{dy}{dx} & =0,\\ \frac{dy}{dx}\left(3y^{2}-3x\right) & =3(y-x^{2})\\ \frac{dy}{dx} & =\frac{y-x^{2}}{y^{2}-x}.\end{align}
The slope of the tangent at $$(\sqrt[3]{2},\sqrt[3]{4})$$ is thus
$y’=\left.\frac{y-x^{2}}{y^{2}-x^{2}}\right|_{x=\sqrt[3]{2},y=\sqrt[3]{4}}=\frac{\sqrt[3]{4}-(\sqrt[3]{2})^{2}}{\sqrt[3]{16}+\sqrt[3]{4}}=\frac{\sqrt[3]{4}-\sqrt[3]{4}}{\sqrt[3]{16}+\sqrt[3]{4}}=0.$
This shows that the tangent to this curve is horizontal and its equation becomes $$y=\sqrt[3]{4}$$. The following figure shows the curve described by the equation $$x^{3}+y^{3}-3xy=0$$ and its tangent at the point $$(\sqrt[3]{2},\sqrt[3]{4})\approx(1.26,1.587)$$.

Example 4

If $$x^{2}-3xy+2y^{2}=3$$, find $$\dfrac{dy}{dx}$$.

Solution

Here we can solve for $$y$$ (because it is a quadratic equation in terms of $$y$$), but it is better if we assume that $$y’$$ exists and apply $$\dfrac{d}{dx}$$ to both sides of the equation:
\begin{align} \frac{d}{dx}(x^{2}-3xy+2y^{2}) & =\frac{d}{dx}3\\ \frac{d}{dx}(x^{2})-3\frac{d}{dx}(xy)+2\frac{d}{dx}(y^{2}) & =0\\ 2x-3\left(y\frac{dx}{dx}+x\frac{dy}{dx}\right)+2\times2y\frac{dy}{dx} & =0\\ 2x-3y-3x\frac{dy}{dx}+4y\frac{dy}{dx} & =0\end{align}

thus $\frac{dy}{dx}(4y-3x)=3y-2x,$ and finally
$\frac{dy}{dx}=\frac{3y-2x}{4y-3x}.$

## Higher Order Derivatives Using Implicit Differentiation

Higher order derivatives can also be obtained by application of implicit differentiation. We will illustrate how to do that by means of the following example.

Example 5

If $$x^{2}+y^{2}=4$$, find $$\dfrac{d^{2}y}{dx^{2}}$$.

Solution

In Examples 1 and 2, we showed $\frac{dy}{dx}=-\frac{x}{y}.$ We now apply the quotient rule to find $$y^{\prime\prime}$$.
\begin{align} \frac{d^{2}y}{dx^{2}} & =\frac{d}{dx}\left(-\frac{x}{y}\right)\\ & =-\frac{\frac{dx}{dx}\cdot y-x\cdot\frac{dy}{dx}}{y^{2}}\\ & =-\frac{y-x\cdot\left(-\frac{x}{y}\right)}{y^{2}}\tag{\text{substitute }{\frac{dy}{dx}=-x/y}}\\ & =-\frac{y+\frac{x^{2}}{y}}{y^{2}}\\ & =-\frac{y^{2}+x^{2}}{y^{3}}\\ & =-\frac{4}{y^{3}}\tag{\text{because } {x^{2}+y^{2}=4}}\end{align}

Example 6

If $$y^{3}-xy-1=0$$, find $$\dfrac{d^{2}y}{dx^{2}}$$.

Solution

First we need to find $$dy/dx$$. In doing so, we use implicit differentiation.
\begin{align} 3y^{2}\frac{dy}{dx}-y-x\frac{dy}{dx}-0 & =0\\ \frac{dy}{dx}\left(3y^{2}-x\right) & =y\end{align}

$\Rightarrow\frac{dy}{dx}=\frac{y}{3y^{2}-x}.$ Then, we apply the quotient rule to find $$y^{\prime\prime}$$.
\begin{align} \frac{d^{2}y}{dx^{2}} & =\frac{\dfrac{dy}{dx}\cdot(3y^{2}-x)-y\dfrac{d}{dx}\left(3y^{2}-x\right)}{(3y^{2}-x)^{2}}\\ & =\frac{\dfrac{y}{3y^{2}-x}\cdot(3y^{2}-x)-y\cdot\left(6y\dfrac{dy}{dx}-1\right)}{(3y^{2}-x)^{2}}\\ & =\frac{y-y\left(\dfrac{6y^{2}}{3y^{2}-x}-1\right)}{(3y^{2}-x)^{2}}\\ & =\frac{y(3y^{2}-x)-y\left(6y^{2}-(3y^{2}-x)\right)}{(3y^{2}-x)^{3}}\\ & =\frac{-2xy}{(2y^{2}-x)^{3}}.\end{align}

Example 7

Given $$\dfrac{x^{2}}{a^{2}}+\dfrac{y^{2}}{b^{2}}=1$$, find $$\dfrac{d^{2}y}{dx^{2}}$$.
[The above equation is the equation of an ellipse.]

Solution

First we need to find $$dy/dx$$. Using implicit differentiation, we obtain:
\begin{align} \frac{1}{a^{2}}\frac{dx^{2}}{dx}+\frac{1}{b^{2}}\frac{dy^{2}}{dx} & =\frac{d}{dx}(1),\\ \frac{2}{a^{2}}x+\frac{2}{b^{2}}y\frac{dy}{dx} & =0,\end{align}
$\Rightarrow\frac{dy}{dx}=-\frac{b^{2}x}{a^{2}y}.$ Now we can apply the quotient rule to find $$d^{2}y/dx^{2}$$:
\begin{align} \frac{d^{2}y}{dx^{2}} & =-\frac{b^{2}}{a^{2}}\frac{\dfrac{dx}{dx}\cdot y-x\cdot\dfrac{dy}{dx}}{y^{2}}\\ & =-\frac{b^{2}}{a^{2}}\dfrac{y-x\left(\dfrac{b^{2}x}{a^{2}y}\right)}{y^{2}}\\ & =-\frac{b^{2}}{a^{4}}\frac{a^{2}y^{2}+b^{2}x^{2}}{y^{3}}\end{align}
If we multiply both sides of $$\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1$$ by $$a^{2}b^{2}$$, we can conclude that $$b^{2}x^{2}+a^{2}y^{2}=a^{2}b^{2}$$. Thus
\begin{align} \frac{d^{2}y}{dx^{2}} & =-\frac{b^{2}}{a^{4}}\frac{a^{2}b^{2}}{y^{3}}\\ & =-\frac{b^{4}}{a^{2}y^{3}}.\end{align}