Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
Next Article:
Log Table | How to Use Logarithm Table with Examples
Next article icon

Logarithmic Differentiation

Last Updated : 17 Dec, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Method of finding a function's derivative by first taking the logarithm and then differentiating is called logarithmic differentiation. This method is specially used when the function is type y = f(x)g(x). In this type of problem where y is a composite function, we first need to take a logarithm, making the function log (y) = g(x) log (f(x)).

Logarithmic Differentiation helps to find the derivatives of complicated functions, using the concept of logarithms. Sometimes finding the differentiation of the function is very tough but differentiating the logarithm of the same function is very easy, then in such cases, the logarithmic differentiation formula is used. 

Note: Logarithmic differentiation is generally used to differentiate functions of form f(x)g(x), f(x)/g(x), f(x)g(x), and others.

Formula for Logarithmic Differentiation

For a function, y = f(x)g(x), differentiation is given by the following formula:

\bold{\frac{dy}{dx} = y\left[g(x)\cdot \frac{f'(x)}{f(x)} + log(f(x))g'(x)\right]}

Logarithmic formulas are very useful in solving logarithmic differentiation. Some of the important logarithmic properties used are,

  • log  XY = log X + log Y
  • log  X/Y = log X - log Y
  • log  X Y = Y log X
  • log Y X = (log X) / (log Y)

Note: Logarithmic differentiation rules are only valid for the positive functions only because logarithm of negative function is undefined.

Derivation of Logarithmic Differentiation Formula

Let us consider a function y = f(x)g(x), and take the natural logarithm of this function to differentiate it,

ln y = ln (f(x)g(x))
⇒ ln (y) = g(x) ln (f(x))

Differentiate the above equation,

\frac{d [\ln y]}{dx} = \frac{d}{dx}[g(x) \cdot \ln f(x)
\Rightarrow \frac{1}{y} \cdot \frac{dy}{dx} = g'(x) \ln(f(x)) + g(x) \cdot \frac{d}{dx}(\ln(f(x)))
\Rightarrow \frac{dy}{dx} = y \left(g'(x) \ln(f(x)) + g(x) \cdot \frac{d}{dx}(\ln(f(x)))\right)
\Rightarrow \frac{dy}{dx} = y \left[g'(x) \ln(f(x)) + g(x) \cdot \frac{f'(x)}{f(x)}\right]

Which is the required formula.

How to Perform Logarithmic Differentiation?

The steps involved in differentiating a logarithmic function are summarized below,

  1. Take log on both sides,
  2. Use logarithmic properties to simplify the function,
  3. Now differentiate the equation with respect to x,
  4. Simplify the obtained equation,
  5. Substitute back the value of y.

Following the above result one can easily find the differentiation of functions using logarithm.

Let's consider an example for better understanding.

Example: Find the derivative of xx.

Solution:

Let y = xx

Step 1: Taking log on both sides
log(y) = log(xx)

Step 2: Use logarithmic property to simplify the equation
log(y) = x ⋅ log(x)    [Using property log(ab) = b⋅ log(a)]

Step 3: Now differentiate the equation with respect to x,
\frac{d}{d x} \log (y)=\frac{d}{d x}(x \cdot \log (x)) \\ \frac{d}{d x} \log (y)=x \cdot \frac{d}{d x} \log (x)+\log (x) \cdot \frac{d x}{d x} \\ \frac{1}{y} \frac{d y}{d x}=x \cdot \frac{1}{x}+\log (x)

Step 4: Simplify the obtained equation
\frac{d y}{d x}=y(1+\log (x))

Step 5: Substitute back the value of y
\frac{d y}{d x}=x^{x}(1+\log (x))

Applications of Log Differentiation

Log differentiation found its application while solving various differentiation problems. Various types of problems where Log Differentiation is used are discussed below,

Product of Functions (Product Rule)

The differentiation of any function which is a product of two functions can easily be calculated using logarithmic differentiation.

Suppose we have to find differentiation of f(x) where, f(x) = g(x) × h(x) then by using concept of logarithmic differentiation,

f(x) = g(x) × h(x)

Taking log on both sides, 

log f(x) = log (g(x) × h(x))
⇒ log f(x) = log g(x) + log h(x)        [Using property log (XY) = log (X) + log (Y)]

Differentiating both sides with respect to x,

d/dx [log f(x)] = d/dx [log g(x)] + d/dx [log h(x)]
⇒ f'(x)/f(x) = g'(x)/g(x) + h'(x)/h(x)
⇒ f'(x) = f(x) [g'(x)/g(x) + h'(x)/h(x)]
⇒ f'(x) = f(x) [(h(x) × g'(x) + g(x) × h'(x))/ (g(x) × h(x))]
⇒ f'(x) = g(x) × h(x) [h(x) × g'(x) + g(x) × h'(x)] / g(x) × h(x)

∴ f'(x) = h(x) × g'(x) + g(x) × h'(x)

The result obtained above is the "Leibniz rule" and is commonly known as the "Product rule".

Division of Functions (Quotient Rule)

The differentiation of any function which is in the form of a division of two functions can easily be calculated using logarithmic differentiation.

Suppose one has to find the differentiation of f(x) where f(x) = g(x) / h(x) by using the concept of logarithmic. differentiation,

f(x) = g(x)/h(x)

Taking log on both sides,

log f(x) = log [g(x)/h(x)]
⇒ log f(x) = log g(x) - log h(x)                       [Using property log (X/Y) = log (X) - log (Y)]

Differentiating both sides with respect to x,

d/dx [log f(x)] = d/dx [log g(x)] - d/dx [log h(x)]
⇒ f'(x)/f(x) = g'(x)/g(x) - h'(x)/h(x)
⇒ f'(x) = f(x)[g'(x)/g(x) - h'(x)/h(x)]
⇒ f'(x) = f(x) [(g'(x) × h(x) - g(x) × h'(x))/(g(x) × h(x))]
⇒ f'(x) = g(x)/h(x) [g'(x) × h(x) - g(x) × h'(x)]/g(x) × h(x)

∴ f'(x) = [g'(x) × h(x) - g(x) × h'(x)] / h2(x)

The result obtained above is commonly known as the "Quotient rule".

Also, Check

  • Laws of Logarithms
  • Logarithmic Function​
  • Advanced Differentiation
  • Implicit Differentiation
  • Differentiation and Integration Formula

Solved Examples on Logarithmic Differentiation

Example 1: Find the derivative of x^{\left(x^{x}\right)}?

Solution:

Given, y = x^{\left(x^{x}\right)}

Step 1: Taking log on both sides,
log(y) = log(x^{\left(x^{x}\right)})

Step 2: Use logarithmic property to simplify the equation
log(y) = xx⋅ log(x)         [Using property log(ab) = b⋅ log(a)]

Step 3: Differentiating both sides with respect to x,
\frac{d}{d x} \log (y)=\frac{d}{d x}\left(x^{x} \cdot \log (x)\right) \\ \frac{d}{d x} \log (y)=x^{x} \cdot \frac{d}{d x} \log (x)+\log (x) \cdot \frac{d}{d x} x^{x}\left\{f^{\prime}(u . v)=u . f^{\prime}(v)+v \cdot f^{\prime}(u)\right\} \\ \frac{1}{y} \frac{d y}{d x}=x^{x} \cdot \frac{1}{x}+\log (x) \frac{d}{d x} x^{x} \left\{f^{\prime}(\log x)=\frac{1}{x}\right\}\\ \frac{1}{y} \frac{d y}{d x}=x^{x-1}+\log (x) \frac{d}{d x} x^{x}

Step 4: Simplify the obtained equation,

Since now we know the derivative of xx, We will substitute here directly.
\frac{1}{y} \frac{d y}{d x}=x^{x-1}+\log x \cdot x^{x}(1+\log x) \\ \frac{d y}{d x}=y\left(x^{x-1}+\log x \cdot x^{x}(1+\log x)\right)

Step 5: Substitute back the value of y
\frac{d y}{d x}=x^{\left(x^{x}\right)}\left(x^{x-1}+\log x \cdot x^{x}(1+\log x)\right)

Example 2: Find the derivative of y = (log x)x.

Solution:

Given, y = (logx)x

Step 1: Taking log on both sides,
log(y) = log((logx)x)

Step 2: Use logarithmic property to simplify the  equation
log(y) = x ⋅ log(logx)     [using property log(ab) = b⋅ log(a)]

Step 3: Differentiating both sides with respect to x,
\frac{d}{d x} \log (y)=\frac{d}{d x}(x \cdot \log (\log x)) \\ \frac{d}{d x} \log (\mathrm{y})=x \cdot \frac{d}{d x} \log (\log x)+\log (\log x) \cdot \frac{d x}{d x} \\ \frac{1}{y} \frac{d y}{d x}=x \cdot \frac{1}{\log x} \cdot \frac{1}{x}+\log (\log x)

Step 4: Simplify the obtained equation, 
\frac{1}{y} \frac{d y}{d x}=\frac{1}{\log x}+\log (\log x) \{ using~chain~rule \} \\ \frac{d y}{d x}=y \cdot\left(\frac{1}{\log x}+\log (\log x)\right) \\

Step 5: Substitute back the value of y
\frac{d y}{d x}=(\log x)^{x} \cdot\left(\frac{1}{\log x}+\log (\log x)\right)

Example 3:  Find the derivative of y = x√x.

Solution:

Given, y = x√x​

Step 1: Taking log on both sides,
log(y) = log(x√x​​)

Step 2: Use logarithmic property to simplify the  equation
log(y) = √x​⋅ log(x)       [using property log(ab) = b⋅ log(a)]

Step 3: Differentiating both sides with respect to x,
\frac{d}{d x} \log (y)=\frac{d}{d x}(\sqrt{x} \cdot \log (x))\\ \frac{d}{d x} \log (\mathrm{y})=\sqrt{x} \cdot \frac{d}{d x} \log (\mathrm{x})+\log (x) \cdot \frac{d \sqrt{x}}{d x}

Step 4: Simplify the obtained equation, 
\frac{1}{y} \frac{d y}{d x}=\sqrt{x} \cdot \frac{1}{x}+\log (x) \cdot \frac{1}{2 \sqrt{x}} \\ \frac{1}{y} \frac{d y}{d x}=\frac{1}{\sqrt{x}}+\log (x) \cdot \frac{1}{2 \sqrt{x}} \\ \frac{d y}{d x}=y \cdot\left(\frac{1}{\sqrt{x}}+\log (\mathrm{x}) \cdot \frac{1}{2 \sqrt{x}}\right) \\

Step 5: Substitute back the value of y
\frac{d y}{d x}=\mathrm{x}^{\sqrt{x}} \cdot\left(\frac{1}{\sqrt{x}}+\log (\mathrm{x}) \cdot \frac{1}{2 \sqrt{x}}\right)

Practice Questions on Logarithmic Differentiation

Q1: Differentiate the function y = (sin x)cos x with respect to x.

Q2: Find the derivative of the function y = (log x)log x with respect to x.

Q3: Differentiate the function y = (x2 + 1)x - 1 with respect to x.

Q4: Find the derivative of the function y = (tan x)cot x with respect to x.

Q5: Differentiate the function y = (ex)x with respect to x.

Answer Key

  1. \frac{dy}{dx} = (\sin x)^{\cos x} \left( -\sin x \ln(\sin x) + \cos x \cot x \right)
  2. \frac{dy}{dx} = (\log x)^{\log x} \left( \frac{\ln(\log x)}{x} + \frac{1}{x} \right)
  3. \frac{dy}{dx} = (x^2 + 1)^{x - 1} \left( \ln(x^2 + 1) + \frac{2x(x - 1)}{x^2 + 1} \right)
  4. \frac{dy}{dx} = (\tan x)^{\cot x} \left( -\csc^2 x \ln(\tan x) + \cot x \cdot \frac{\sec^2 x}{\tan x} \right)
  5. \frac{dy}{dx} = e^{x \ln x} \left( \ln x + 1 \right)

Next Article
Log Table | How to Use Logarithm Table with Examples

R

rathoreatul27
Improve
Article Tags :
  • Technical Scripter
  • Mathematics
  • School Learning
  • Class 12
  • Technical Scripter 2020
  • Calculus - MAQ
  • Maths-Class-12

Similar Reads

    Logarithm
    In mathematics, a logarithm is the inverse operation of exponentiation. It is defined as the power to which the base number must be raised to get the given number.Logarithms serve as mathematical tools that help simplify complex calculations involving exponential relationships. If you know that bx =
    3 min read
    Laws of Logarithms
    The logarithm is the exponent or power to which a base is raised to get a particular number. For example, 'a' is the logarithm of 'm' to the base of 'x' if xm = a, then we can write it as m = logxa. Logarithms are invented to speed up the calculations and time will be reduced when we are multiplying
    4 min read
    Log Rules
    Logarithm rules are used to simplify and work with logarithmic expressions. They help relate logarithms to exponents and make complex calculations easier.A logarithm is the inverse of an exponent. It answers the question: "To what power must a base be raised to get a certain number?"Out of all these
    7 min read
    Logarithm Formula
    Logarithm is defined as the power to which a number is raised to yield some other values. Logarithms are the inverse of exponents. There is a unique way of reading the logarithm expression. For example, bx = n is called as 'x is the logarithm of n to the base b.There are two parts of the logarithm:
    6 min read
    Continuity and Differentiability of Logarithmic Function
    The word continuity means something which is continuous in nature. The flow of water is continuous, time in real life is continuous, and many more instances show the continuity in real life. In mathematics, the Continuous function is the one which when drawn on a graph does not show any breaks and i
    5 min read
    Derivative of Logarithmic Functions
    Derivative or Differentiation of Logarithmic Function as the name suggests, explores the derivatives of log functions with respect to some variable. As we know, derivatives are the backbone of Calculus and help us solve various real-life problems. Derivatives of the log functions are used to solve v
    10 min read
    Logarithmic Differentiation
    Method of finding a function's derivative by first taking the logarithm and then differentiating is called logarithmic differentiation. This method is specially used when the function is type y = f(x)g(x). In this type of problem where y is a composite function, we first need to take a logarithm, ma
    8 min read
    Log Table
    A Log Table in math is a reference tool to ease computations using logarithmic functions. It usually provides pre-computed logarithm values for various integers, commonly in a base like 10 or the natural logarithm base (e.g., ≈ 2.71828). Log tables allow users to obtain the logarithm of a given numb
    9 min read
    Antilog Table
    Antilog Table in math is a refrence tool used to reverse logarithmic computation and retrieve the original number from its logarithmic value.It typically provides a pre-computed antilogarithm value for various logarithmic inputs, commonly in base 1o or natural logarithm base( e.g ≅ 2.71828)Antilog t
    7 min read
    Change of Base in Logarithim
    The change of base formula is a useful concept in mathematics. That allows you to convert a logarithm from one base to another. Change of base formula in logarithm allows us to rewrite a logarithm with a different base. It allows us to compute logarithms using calculators or computational tools that
    4 min read
    Difference Between Log and Ln
    Logarithms(log) and natural logarithms(ln) are fundamental mathematical concepts that simplify complex calculations involving exponential relationships Logarithms are essential for solving equations where an unknown variable appears as the exponent of some other quantity. A logarithm can have any po
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences