Skip to content

Instantly share code, notes, and snippets.

@Sinitca-Aleksandr
Created February 1, 2016 13:35
Show Gist options
  • Select an option

  • Save Sinitca-Aleksandr/fcc61ba7f91d9c651ab4 to your computer and use it in GitHub Desktop.

Select an option

Save Sinitca-Aleksandr/fcc61ba7f91d9c651ab4 to your computer and use it in GitHub Desktop.
>>> from sympy import *
# Разложим на простейшие
>>> apart(1/( (x+3)*(x+6) ), x)
-1/(3*(x + 6)) + 1/(3*(x + 3))
>>> apart((2*x+1)/(x-1), x)
2 + 3/(x - 1)
# Перемножим дроби
>>> together(1/x + 1/y + 1/y+1)
(x*y + 2*x + y)/(x*y)
# Применем обратные действия последовательно
>>> together(apart((x+3)/(x-3), x), x)
(x + 3)/(x - 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment