Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Created June 30, 2026 07:31
Show Gist options
  • Select an option

  • Save TomoG29/c8f3e73e0b4bea6bf36baaf25f994690 to your computer and use it in GitHub Desktop.

Select an option

Save TomoG29/c8f3e73e0b4bea6bf36baaf25f994690 to your computer and use it in GitHub Desktop.
Blog_DifferentialBySymPy.py
from sympy import *
x = Symbol('x')
f = x**3
df = diff(f)
print(df)
for i in range(1, 6):
print(df.subs(x, i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment