Created
February 1, 2016 13:10
-
-
Save Sinitca-Aleksandr/623e5add4bfcc2d15c28 to your computer and use it in GitHub Desktop.
Простой пример работы с символьными переменными
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> from sympy import * | |
| # Объявляем символьные переменные | |
| >>> x = Symbol('x') | |
| >>> y = Symbol('y') | |
| # Теперь можно работать с символьными выражениями | |
| >>> x+x+x+y | |
| 3*x + y | |
| >>> x*x*y+x | |
| x**2*y + x | |
| # Раскроем скобки | |
| >>> ((x+y)**3).expand() | |
| x**3 + 3*x**2*y + 3*x*y**2 + y**3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment