Finding Derivatives in Python

Author: David Manuel
In this video, it is demonstrated how to find derivatives in Python. The presenter solves an example the rate of change of force as a box is dragged along the ground by a rope attached to a pulley.

Transcript 08

Exercises

Python Code:
from sympy import *

mu,m,g,x,h=symbols('mu m g x h')
F=mu*m*g*sqrt(x**2+h**2)/(x+mu*h)
dF=F.diff(x)print('The general derivative is',dF)
dFat10=F.subs({m:18,h:10,mu:0.55,g:9.8,x:10})
print('When x=10, the rate of change in t is',dFat10.evalf() ,'Newtons/meter')

dFat40=F.subs({m:18,h:10,mu:0.55,g:9.8,x:40})
print('When x=40, the rate of change in t is', dFat40.evalf(), 'Newtons/meter')

Open Python Notebook File