Derivation of a Function

Yaser Rahmati | یاسر رحمتی

Given a function f(x)f(x), the derivative f(x)f′(x) (read as "f prime of x") at a particular point xx is defined as the limit of the difference quotient as the interval around xx shrinks to zero:

limh0f(x+h)f(x)hlim_{h\to 0}\frac{f(x+h)-f(x)}{h}

Example

Let's find the derivative of the function f(x)=x3f(x)=x^3 using the definition of the derivative:

f(x)ˊ=limh0f(x+h)f(x)h\acute{f(x)}=lim_{h\to 0}\frac{f(x+h)-f(x)}{h}

Step 1:

Write down the function.

f(x)=x3f(x)=x^3

Step 2:

Compute f(x+h)f(x+h).

f(x+h)=(x+h)3f(x+h)=(x+h)^3

Step 3:

Expand (x+h)3(x+h)^3 using binomial expansion or the distributive property.

f(x+h)=x3+3x2h+3xh2+h3f(x+h)=x^3+3x^2h+3xh^2+h^3

Step 4:

Subtract f(x)f(x) from f(x+h)f(x+h).

f(x+h)f(x)=3x2h+3xh2+h3f(x+h)-f(x) = 3x^2h+3xh^2+h^3

Step 5:

Plug f(x+h)f(x)f(x+h)−f(x) into the definition of the derivative.

f(x)ˊ=limh0f(x+h)f(x)h=limh03x2h+3xh2+h3h=limh0(3x2+3xh+h2)\acute{f(x)}=lim_{h\to 0}\frac{f(x+h)-f(x)}{h}=lim_{h\to 0}\frac{3x^2h+3xh^2+h^3}{h} = lim_{h\to 0}(3x^2+3xh+h^2)

Step 6:

Plug in h=0h=0 to evaluate the limit.

f(x)=3x2f(x)=3x^2

Python

You can use the SymPy library in Python to symbolically calculate the derivative of a function. Here's how you can do it:

import sympy as sp

# Define the symbol and the function
x = sp.symbols('x')
f = x**3  # Define your function here

# Calculate the derivative
f_prime = sp.diff(f, x)

# Print the derivative
print("The derivative of f(x) =", f_prime)

My Training Video

My Youtube Channel
My Aparat Channel

Keywords

Web Development (Django, Flask) , Data Science (Pandas, NumPy, Matplotlib) , Machine Learning (Scikit-learn, TensorFlow, PyTorch) , Artificial Intelligence , Automation , GUI Development (Tkinter, PyQt) , Game Development (Pygame) , Scientific Computing , Financial Analysis (Pandas, NumPy) , Network Programming , Image Processing (OpenCV) , Web Scraping (Beautiful Soup, Scrapy) , Internet of Things (IoT) Development , Robotics , Cybersecurity , Mobile App Development (Kivy) , Cloud Computing (Boto3, AWS Lambda) , Big Data Analysis (PySpark) , Geographical Information Systems , Natural Language Processing (NLTK, spaCy) , Data Visualization (Seaborn, Plotly) , Bioinformatics (Biopython) , Multimedia Applications , Education and Teaching

Last updated