Python Encyclopedia for Academics
  • Course Outline
  • Artificial Intelligence
    • Data Science Foundation
      • Python Programming
        • Introduction and Basics
          • Variables
          • Print Function
          • Input From User
          • Data Types
          • Type Conversion
        • Operators
          • Arithmetic Operators
          • Relational Operators
          • Bitwise Operators
          • Logical Operators
          • Assignment Operators
          • Compound Operators
          • Membership Operators
          • Identity Operators
      • Numpy
        • Vectors, Matrix
        • Operations on Matrix
        • Mean, Variance, and Standard Deviation
        • Reshaping Arrays
        • Transpose and Determinant of Matrix
      • Pandas
        • Series and DataFrames
        • Slicing, Rows, and Columns
        • Operations on DataFrames
        • Different wayes to creat DataFrame
        • Read, Write Operations with CSV files
      • Matplotlib
        • Graph Basics
        • Format Strings in Plots
        • Label Parameters, Legend
        • Bar Chart, Pie Chart, Histogram, and Scatter Plot
  • Machine Learning Algorithms
    • Regression Analysis In ML
      • Regression Analysis in Machine Learning
      • Proof of Linear Regression Formulas
      • Simple Linear Regression Implementation
      • Multiple Linear Regression
      • Advertising Dataset Example
      • Bike Sharing Dataset
      • Wine Quality Dataset
      • Auto MPG Dataset
    • Classification Algorithms in ML
      • Proof of Logistic Regression
      • Simplified Mathematical Proof of SVM
      • Iris Dataset
  • Machine Learning Laboratory
    • Lab 1: Titanic Dataset
      • Predicting Survival on the Titanic with Machine Learning
    • Lab 2: Dow Jones Index Dataset
      • Dow Jones Index Predictions Using Machine Learning
    • Lab 3: Diabetes Dataset
      • Numpy
      • Pandas
      • Matplotlib
      • Simple Linear Regression
      • Simple Non-linear Regression
      • Performance Matrix
      • Preprocessing
      • Naive Bayes Classification
      • K-Nearest Neighbors (KNN) Classification
      • Decision Tree & Random Forest
      • SVM Classifier
      • Logistic Regression
      • Artificial Neural Network
      • K means Clustering
    • Lab 4: MAGIC Gamma Telescope Dataset
      • Classification in ML-MAGIC Gamma Telescope Dataset
    • Lab 5: Seoul Bike Sharing Demand Dataset
      • Regression in ML-Seoul Bike Sharing Demand Dataset
    • Lab 6: Medical Cost Personal Datasets
      • Predict Insurance Costs with Linear Regression in Python
    • Lab 6: Predict The S&P 500 Index With Machine Learning And Python
      • Predict The S&P 500 Index With Machine Learning And Python
  • Artificial Neural Networks
    • Biological Inspiration vs. Artificial Neurons
    • Review linear algebra and calculus essentials for ANNs
    • Activation Function
  • Mathematics
    • Pre-Calculus
      • Factorials
      • Roots of Polynomials
      • Complex Numbers
      • Polar Coordinates
      • Graph of a Function
    • Calculus 1
      • Limit of a Function
      • Derivative of Function
      • Critical Points
      • Indefinite Integrals
  • Calculus 2
    • 3D Coordinates and Vectors
    • Vectors and Vector Operations
    • Lines and Planes in Space (3D)
    • Partial Derivatives
    • Optimization Problems (Maxima/Minima) in Multivariable Functions
    • Gradient Vectors
  • Engineering Mathematics
    • Laplace Transform
  • Electrical & electronics Eng
    • Resistor
      • Series Resistors
      • Parallel Resistors
    • Nodal Analysis
      • Example 1
      • Example 2
    • Transient State
      • RC Circuit Equations in the s-Domain
      • RL Circuit Equations in the s-Domain
      • LC Circuit Equations in the s-Domain
      • Series RLC Circuit with DC Source
  • Computer Networking
    • Fundamental
      • IPv4 Addressing
      • Network Diagnostics
  • Cybersecurity
    • Classical Ciphers
      • Caesar Cipher
      • Affine Cipher
      • Atbash Cipher
      • Vigenère Cipher
      • Gronsfeld Cipher
      • Alberti Cipher
      • Hill Cipher
Powered by GitBook
On this page
  • 1. Derivative of a Power Function
  • 2. Derivative of a Polynomial
  • 3. Derivative of a Constant Multiplied Function
  • 4. Derivative of a Sum of Functions
  • 5. Derivative of a Trigonometric Function
  • 6. Derivative of a Product of Two Functions
  • 7. Derivative of a Quotient
  • 8. Derivative of a Composite Function
  • 9. Derivative of an Exponential Function
  • 10. Derivative of a Logarithmic Function
  • Keywords
  1. Mathematics
  2. Calculus 1

Derivative of Function

Nerd Cafe

1. Derivative of a Power Function

  • Function:

f(x)=x3f(x)=x^{3}f(x)=x3
  • Derivative:

fˊ(x)=3x2f\acute{}(x)=3x^{2}fˊ(x)=3x2
  • Python Code:

from sympy import symbols, diff

x = symbols('x')
f = x**3
derivative = diff(f, x)
print(derivative)
  • Output:

3*x**2

2. Derivative of a Polynomial

  • Function:

f(x)=2x4+3x2−5f(x)=2x^{4}+3x^{2}-5f(x)=2x4+3x2−5
  • Derivative:

fˊ(x)=8x3+6xf\acute{}(x)=8x^{3}+6xfˊ(x)=8x3+6x
  • Python Code:

f = 2*x**4 + 3*x**2 - 5
derivative = diff(f, x)
print(derivative)
  • Output:

8*x**3 + 6*x

3. Derivative of a Constant Multiplied Function

  • Function:

f(x)=7x5f(x)=7x^{5}f(x)=7x5
  • Derivative:

fˊ(x)=35x4f\acute{}(x)=35x^{4}fˊ(x)=35x4
  • Python Code:

f = 7*x**5
derivative = diff(f, x)
print(derivative)
  • Output:

35*x**4

4. Derivative of a Sum of Functions

  • Function:

f(x)=x2+x+1f(x)=x^{2}+x+1f(x)=x2+x+1
  • Derivative:

fˊ(x)=2x+1f\acute{}(x)=2x+1fˊ(x)=2x+1
  • Python Code:

f = x**2 + x + 1
derivative = diff(f, x)
print(derivative)

5. Derivative of a Trigonometric Function

  • Function:

f(x)=sin(x)f(x)=sin(x)f(x)=sin(x)
  • Derivative:

fˊ(x)=cos(x)f\acute{}(x)=cos(x)fˊ(x)=cos(x)
  • Python Code:

from sympy import sin, cos

f = sin(x)
derivative = diff(f, x)
print(derivative)
  • Output:

cos(x)

6. Derivative of a Product of Two Functions

  • Function:

f(x)=x.sin(x)f(x)=x.sin(x)f(x)=x.sin(x)
  • Derivative (Product Rule):

fˊ(x)=x.cos(x)+sin(x)f\acute{}(x)=x.cos(x)+sin(x)fˊ(x)=x.cos(x)+sin(x)
  • Python Code:

f = x * sin(x)
derivative = diff(f, x)
print(derivative)
  • Output:

x*cos(x) + sin(x)

7. Derivative of a Quotient

  • Function:

f(x)=x2+1xf(x)=\frac{x^{2}+1}{x}f(x)=xx2+1​
  • Derivative (Quotient Rule):

fˊ(x)=2x(x)−(1)(x2+1)x2=x2−1x2f\acute{}(x)=\frac{2x(x)-(1)(x^{2}+1)}{x^{2}}=\frac{x^{2}-1}{x^{2}}fˊ(x)=x22x(x)−(1)(x2+1)​=x2x2−1​
  • Python Code:

f = (x**2 + 1) / x
derivative = diff(f, x)
print(derivative)
  • Output:

2 - (x**2 + 1)/x**2

8. Derivative of a Composite Function

  • Function:

f(x)=sin(x2)f(x)=sin(x^{2})f(x)=sin(x2)
  • Derivative (Chain Rule):

fˊ(x)=(2x).cos(x2)f\acute{}(x)=(2x).cos(x^{2})fˊ(x)=(2x).cos(x2)
  • Python Code:

f = sin(x**2)
derivative = diff(f, x)
print(derivative)
  • Output:

2*x*cos(x**2)

9. Derivative of an Exponential Function

  • Function:

f(x)=exf(x)=e^{x}f(x)=ex
  • Derivative:

fˊ(x)=exf\acute{}(x)=e^{x}fˊ(x)=ex
  • Python Code:

from sympy import exp

f = exp(x)
derivative = diff(f, x)
print(derivative)
  • Output:

exp(x)

10. Derivative of a Logarithmic Function

  • Function:

f(x)=ln(x)f(x)=ln(x)f(x)=ln(x)
  • Derivative:

fˊ(x)=1xf\acute{}(x)=\frac{1}{x}fˊ(x)=x1​
  • Python Code:

from sympy import ln

f = ln(x)
derivative = diff(f, x)
print(derivative)
  • Output:

1/x

Keywords

derivative,calculus,calculus 1,python,sympy,math,mathematics,differentiation,power rule,product rule,quotient rule,chain rule,polynomial,trigonometric function,exponential function,logarithmic function,symbolic computation,automatic differentiation,step-by-step,python code, nerd cafe

PreviousLimit of a FunctionNextCritical Points

Last updated 2 months ago