aboutsummaryrefslogtreecommitdiff
path: root/entries/Tarcisio-Teixeira/differential.py
blob: 8abbdae9ab29f595d59e02f9ed45190d1efa3c9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
from sympy import *

def fib(n):
  x = symbols('x')
  f = diff(1/(1-x-x**2),x,0)
  fact = 1
  for i in range(1,n):
    f = diff(f,x)
    fact *= i
  return f.subs(x,0)/fact