aboutsummaryrefslogtreecommitdiff
path: root/entries/Tarcisio-Teixeira/differential.py
diff options
context:
space:
mode:
authorfunemy2022-10-25 23:02:55 +0000
committerfunemy2022-10-25 23:02:55 +0000
commit0a801e985fcb50d22acbe52a626d67d393c21851 (patch)
treec2464c31e16abb30c8f8623f6c335124b91fe149 /entries/Tarcisio-Teixeira/differential.py
parent0269509a887fb154f32b88f5dfbeb883e16f628c (diff)
parente187bb84b9c3231f7f63a70a3136b7355ba0567a (diff)
Merge branch 'main' of github.com:braxtonhall/fib
Diffstat (limited to 'entries/Tarcisio-Teixeira/differential.py')
-rw-r--r--entries/Tarcisio-Teixeira/differential.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/entries/Tarcisio-Teixeira/differential.py b/entries/Tarcisio-Teixeira/differential.py
new file mode 100644
index 0000000..8abbdae
--- /dev/null
+++ b/entries/Tarcisio-Teixeira/differential.py
@@ -0,0 +1,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