---
author: Nathan Carter (ncarter@bentley.edu)
---

This answer assumes you have imported SymPy as follows.


```python
from sympy import *                   # load all math functions
init_printing( use_latex='mathjax' )  # use pretty math output
```

Let's consider the example of the unit circle, $x^2+y^2=1$.

To plot it, SymPy first expects us to move everything to the left-hand side
of the equation, so in this case, we would have $x^2+y^2-1=0$.

We then use that left hand side to represent the equation as a single formula,
and computue $\frac{dy}{dx}$ using the `idiff` function (standing for
"implicit differentiation").


```python
var( 'x y' )
formula = x**2 + y**2 - 1   # to represent x^2+y^2=1
idiff( formula, y, x )
```




$\displaystyle - \frac{x}{y}$



So in this case, $\frac{dy}{dx}=-\frac xy$.

b5df0e7721950b3592fbe5254ec2d5b13d33c3c7
ipynb
Jupyter Notebook
database/tasks/How to do implicit differentiation/Python, using SymPy.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
database/tasks/How to do implicit differentiation/Python, using SymPy.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
database/tasks/How to do implicit differentiation/Python, using SymPy.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
2021-07-18T19:01:29.000Z
2022-03-29T06:47:11.000Z
Qwen/Qwen-72B
1. YES
2. YES