Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 33

Derivatives of Common Functions

Recommended resources

Introduction

In our last lesson, we built the core intuition behind calculus. You learned that a derivative represents an instantaneous rate of change and, geometrically, is the slope of the tangent line to a function's graph. We focused on the what and the why, understanding that the derivative is the value that the average rate of change approaches as our measurement interval shrinks to zero.

Now, we move from intuition to computation. While the limit definition is the theoretical foundation, using it every time you need a derivative is impractical. Fortunately, mathematicians have developed a set of rules for common functions. This lesson is dedicated to mastering these fundamental rules. You will learn to compute the derivatives of polynomial, exponential, and logarithmic functions. These are the essential building blocks you'll need to analyze and optimize the complex functions that power AI models.


1. Derivatives of Polynomials: The Power Rule

Polynomials, like , are one of the most common types of functions. Differentiating them relies on a simple yet powerful rule.

Let's start by learning this rule, known as the Power Rule.

Intro to Derivatives | Calculus for Machine Learning

In this segment from Kylie Ying's 'Calculus for Machine Learning' series, you'll be introduced to the Power Rule, the primary tool for differentiating polynomials.

Watch the clip from 20:27 to 23:03. Pay close attention to the formula presented for a function of the form f(x) = bx^a and how it's applied to individual terms.

As the video explained, the Power Rule is straightforward. For any function of the form , its derivative is:

In simple terms: bring the exponent down as a multiplier, then subtract one from the original exponent.

Let's break this down with a few key cases:

  • A constant multiplier: If , the constant c just comes along for the ride: .
    • Example: If , then .
  • A linear term: If , this is the same as . Applying the rule gives . This makes sense: the slope of a line like is always .
  • A constant term: If , this is the same as . Applying the rule seems tricky, but it's simpler to think geometrically: a constant function is a horizontal line. Its slope is always zero. Thus, the derivative of any constant is 0.

To differentiate a full polynomial, we use the Sum Rule, which states that the derivative of a sum of terms is simply the sum of their individual derivatives.

For a concise, text-based summary of these rules, you can refer to the "Dive into Deep Learning" book.

22.3. Single Variable Calculus - Dive into Deep Learning

This resource provides a formal summary of the basic derivative rules we've just discussed.

Read the section titled 'Common Derivatives'. Note the rules for constants, linear functions, and the Power Rule. Then, look just below at the start of 'Derivative Rules' and note the Sum Rule.

Now, we can differentiate any polynomial. For example, let's find the derivative of .
We differentiate term by term:

  1. The derivative of is .
  2. The derivative of is .
  3. The derivative of is .

Putting it all together: .


2. Derivatives of Exponential Functions

Next, we turn to exponential functions, where the variable is in the exponent, like .

A crucial distinction: Do not confuse the Power Rule with the rule for exponentials.

  • Power Rule: Variable in the base, constant in the exponent (e.g., ).
  • Exponential Rule: Constant in the base, variable in the exponent (e.g., ).

The world of exponential functions has one very special member: , where . This function has a unique and remarkable property.

Derivatives of Logarithmic and Exponential Functions

Let's watch a video from the 'Professor Dave Explains' channel to uncover the derivative of exponential functions, starting with the special case of e^x.

First, watch the segment from 4:51 to 07:34. This part reveals the derivative of e^x and provides a fascinating proof of its property. Then, watch from 03:40 to 04:51, which covers the general rule for any exponential function a^x.

As you saw, the function is its own derivative!

This means that at any point on the graph of , the value of the function is exactly equal to the slope of its tangent line. This is a profound property that makes a fundamental constant in mathematics and science.

For the general exponential function , the rule is slightly different:

Here, is the natural logarithm of the base . Notice that if we set , this rule becomes . Since , the general rule simplifies to the special case.


3. Derivatives of Logarithmic Functions

Finally, let's look at the derivatives of logarithmic functions, which are the inverses of exponential functions. The two main forms are the natural logarithm, , and the logarithm with a general base, .

Derivatives of Logarithmic and Exponential Functions

Let's return to the 'Professor Dave Explains' video to learn the rules for logarithmic functions.

Watch the segment from 00:44 to 03:40. Focus on the derivative rule for ln(x) and see how the change of base formula is used to derive the rule for log_a(x).

The rules for logarithms are as follows. For the natural logarithm:

And for a logarithm with base :

Again, you can see the consistency: if we set , the general rule becomes , which simplifies to since .


Summary and Practice

You have now learned the fundamental rules for differentiating three important classes of functions. Let's summarize them in a single table for easy reference.

Function Type Function Form Derivative
Constant
Power Rule
Exponential
Exponential (General)
Logarithm
Logarithm (General)

Let's apply these rules to a function that combines several types.
Consider the function: .

Using the Sum Rule, we can differentiate it term-by-term:

  1. Derivative of : Using the Power Rule, we get .
  2. Derivative of : The derivative of is , so this becomes .
  3. Derivative of : The derivative of is , so this becomes .

Combining these, the full derivative is:


Conclusion

In this lesson, you have equipped yourself with the essential computational tools of differential calculus. You've moved beyond the conceptual definition of a derivative to the practical application of rules for finding them.

Key Takeaways:

  • The Power Rule () is used to differentiate polynomials.
  • The derivative of the natural exponential function, , is uniquely itself. The general rule for is .
  • The derivative of the natural logarithm, , is . The general rule for is .
  • The Sum Rule allows us to differentiate complex functions by breaking them down into simpler terms.

Preview of the Next Lesson:
The rules you've learned today apply to functions that are added or subtracted. But what happens when functions are multiplied, divided, or even nested inside one another (like )? In the next lesson, we will expand our toolkit by learning the Product, Quotient, and Chain Rules, which will allow you to differentiate almost any single-variable function you might encounter.