<jupyter_start><jupyter_text>Differentiation Three ways  Numerical DifferentiationApplying the process of approximation of the derivative of a given function at a point.SciPy provides two different procedures     1 For Generic univariate fucntions, the central difference forumula with fixed spacing.    2 Numerical differentiation using the Cauchy's theorem, that transform derivative into a definite integral. This intergral             then treated with the techniques of numerical integration explained in the upcoming section.             Symbolic differentiation It refers to computation of functional expressions of derivatives of functions  Automatic differentiation Another set of techniques to numerically evaluate the derivative of a functions. It is not based upon any approximation schema. This is without a doubt the most powerful option in the context of high derivatives of multivariate functions. In order to calcualte the numerical differentiation is performed with the central difference forumula with uniformally spaced nodes. To maintain symmetry, an odd number of nodes is required to guarantee smaller roundoff erros.f(x) = x**5<jupyter_code>import numpy as np
from scipy.misc import derivative
def f(x): return x**5
derivative(f, 1.0, dx=1e-6, order=15) # 1st Derivative
derivative(f, 1.0, dx=1e-6, order=15, n=2) # 2nd Derivative<jupyter_output><empty_output><jupyter_text>Both derivates are somehow accurate but not same as actual values 5 and 20  Symbolic differentiation<jupyter_code>p = np.poly1d([1,0,0,0,0,0]) # Define a polynomial
p
np.polyder(p,1)(1.0) # First derivative
np.polyder(p,2)(1.0) # 2nd Derivative
p.deriv()(1.0)
p.deriv(2)(1.0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.061068702290076333, 'fraction_numerical': 0.024075161479741633, 'mean_word_length': 5.382022471910112, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '164817', 'license': 'MIT', 'n_tokens_mistral': 486, 'n_tokens_neox': 447, 'n_words': 203, 'path': 'ps-details/ways_of_diff.ipynb', 'repo_name': 'write2imran/mldl', 'size': '1703'}