The previous article explained how to calculate limits of functions; this article shows how to calculate the derivative.
Start notebook (if you want to open the file used for this article, you can find it at the following link (broken link)):
$ipython notebook
You can create a notebook (or open the notebook mentioned in the previous link).
Below is the script that calculates the derivatives of 3 different functions:
#!/usr/bin/env python
# coding: utf-8
#Se importa sympy
from sympy import *
x = Symbol('x')
#Se calcula la derivada de la funcion cos(sin(x^3)) con respecto a x
print diff(cos(sin(x**3)),x)
#Se calcula la derivada de la funcion 5(x^5)+3(x^3)-6x+5
print diff(5*(x**5)+3*(x**3)-6*x+5,x)
#Calcula la derivada ene-sima de x^2+8x-4+sin(2x)
print diff(x**2+8*x-4+sin(2*x),x,2)
Running the script shows the result of executing the 3 print statements:
-3*x**2*sin(sin(x**3))*cos(x**3)
25*x**4 + 9*x**2 - 6
2*(-2*sin(2*x) + 1)
x,2)
Running the script shows the result of executing the 3 print statements:
-3*x**2*sin(sin(x**3))*cos(x**3)
25*x**4 + 9*x**2 - 6
2*(-2*sin(2*x) + 1)
Below is an image of the resulting notebook:
Below is an image of the resulting notebook:
Make a donation! If you liked the article you can make a donation with Bitcoin (BTC) using the digital wallet of your choice to the following address: 17MtNybhdkA9GV3UNS6BTwPcuhjXoPrSzV
Or by scanning the QR code from your wallet:
