Chain Rule: From the Main Formula to Practical Examples

The chain rule is one of the most important topics in differential calculus because it allows us to find the derivative of a composite function. When one function depends on another, the usual differentiation rules are no longer enough. At that point, a natural question arises: how do we differentiate such an expression correctly without losing the connection between its parts?

This is exactly where the chain rule becomes useful. It explains how a change in the inner expression affects the change in the whole function. In this article, we will look at the main formula, carefully follow its derivation, and see how it works in practice.

Chain Rule: Formula for a Composite Function

Suppose we have the composite function

\[
y=f(g(x)).
\]

In this case, its derivative is found using the formula

\[
\frac{dy}{dx}=f'(g(x))\cdot g'(x).
\]

This is the main formula of the chain rule. It means that we first differentiate the outer function while keeping the inner expression unchanged, and then multiply the result by the derivative of the inner function. In other words, if a function consists of two nested parts, then when differentiating it, we must take into account the change in each part.

Here, it is especially important not to confuse the outer function with the inner one. In the expression \( y=f(g(x)) \), the inner function is \( g(x) \) because it appears inside. The outer function is \( f \) because it is applied to the result of \( g(x) \). That is why the formula contains \( f'(g(x)) \) first, followed by the factor \( g'(x) \).

Why does this formula involve a product? Because the change in the whole function happens in two connected stages. First, the inner expression \( g(x) \) changes, and then, because of that change, the value of the outer function \( f \) changes. So the chain rule is not just a convenient trick. It reflects the actual mechanism by which a composite function changes.

Sometimes the same formula is also written in the following form:

\[
\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}, \qquad u=g(x).
\]

This form is often convenient when first learning the topic because it clearly shows the intermediate variable. It also makes the sequence of steps easier to follow. First, we differentiate the outer function with respect to \( u \), and then we multiply by the derivative of \( u \) with respect to \( x \). The meaning is the same; this is simply a more visual way of writing the formula.

Step by Step: Deriving the Formula from the Definition of the Derivative

Now let us look at where this formula comes from. To do this, we use the definition of the derivative as a limit. Let

\[
H(x)=f(g(x)).
\]

Then, by definition, the derivative of the function \( H(x) \) is

\[
H'(x)=\lim_{h\to 0}\frac{H(x+h)-H(x)}{h}.
\]

Now substitute the expression for \( H(x) \). Then we get

\[
H'(x)=\lim_{h\to 0}\frac{f(g(x+h))-f(g(x))}{h}.
\]

At this stage, we already have the correct expression for the derivative of a composite function. However, it is not yet written in the familiar formula form. So we need to perform a transformation that lets us separate the change in the outer function from the change in the inner one.

To do this, let us multiply the expression inside the limit by the fraction

\[
\frac{g(x+h)-g(x)}{g(x+h)-g(x)}.
\]

This fraction is equal to one, so the value of the expression does not change. Why do we make this transformation? Because it allows us to introduce two factors: one will later become the derivative of the outer function, and the other will become the derivative of the inner function. At this step, the structure of the final formula begins to appear clearly.

So we have

\[
H'(x)=\lim_{h\to 0}\left(
\frac{f(g(x+h))-f(g(x))}{h}\cdot
\frac{g(x+h)-g(x)}{g(x+h)-g(x)}
\right).
\]

Now let us regroup the factors:

\[
H'(x)=\lim_{h\to 0}\left(
\frac{f(g(x+h))-f(g(x))}{g(x+h)-g(x)}
\cdot
\frac{g(x+h)-g(x)}{h}
\right).
\]

In this form, the meaning of each factor is already easy to see. The second factor,

\[
\frac{g(x+h)-g(x)}{h}
\]

is the difference quotient for the function \( g(x) \). Therefore, as \( h\to 0 \), it becomes the derivative of the inner function:

\[
\lim_{h\to 0}\frac{g(x+h)-g(x)}{h}=g'(x).
\]

So we can write

\[
H'(x)=\left(
\lim_{h\to 0}\frac{f(g(x+h))-f(g(x))}{g(x+h)-g(x)}
\right)\cdot g'(x).
\]

Now let us focus on the first factor. In the numerator, we have the change in the function \( f \), and in the denominator, the change in its argument. However, the argument of the function \( f \) here is not simply \( x \), but the expression \( g(x) \). That is why it is convenient to introduce a new notation:

\[
\Delta u=g(x+h)-g(x).
\]

Then the first factor can be rewritten as

\[
\lim_{h\to 0}\frac{f(g(x)+\Delta u)-f(g(x))}{\Delta u}.
\]

Why is this step correct? Because as \( h\to 0 \), the value \( x+h \) approaches \( x \), and therefore the increment \( g(x+h)-g(x) \) also approaches zero. That is,

\[
\Delta u\to 0.
\]

This means that we are effectively moving from the increment of the variable \( x \) to the increment of the new argument of the outer function. So the same expression can now be written as

\[
\lim_{\Delta u\to 0}\frac{f(g(x)+\Delta u)-f(g(x))}{\Delta u}.
\]

But this is exactly the derivative of the function \( f \) at the point \( g(x) \). Therefore,

\[
\lim_{\Delta u\to 0}\frac{f(g(x)+\Delta u)-f(g(x))}{\Delta u}=f'(g(x)).
\]

Returning to the previous expression, we obtain

\[
H'(x)=f'(g(x))\cdot g'(x).
\]

Since \( H(x)=f(g(x)) \), we finally get

\[
\frac{d}{dx}f(g(x))=f'(g(x))\cdot g'(x).
\]

Thus, the formula of the chain rule is derived from the definition of the derivative as a limit. As we can see, this formula does not appear by accident. It arises naturally when we carefully trace how a composite function changes through the changes in its inner and outer parts.

Chain Rule: A Detailed Look at Examples

Now that we have discussed and derived the main formula, it is time to move on to practice. Specific examples show most clearly how this rule works and how to correctly identify the inner and outer functions. In each case, it is helpful to proceed step by step: first identify the outer function, then the inner function, then find their derivatives, and only after that write the final answer.

Example 1. Find the derivative of the function \( y=(3\cdot x+1)^5 \)

In this example, we have a composite function. The outer function is raising to the fifth power, and the inner function is the expression \( 3\cdot x+1 \). For convenience, let us introduce the notation

\[
u=3\cdot x+1.
\]

Then the function takes a simpler form:

\[
y=u^5.
\]

Now let us find the derivative of the outer function with respect to \( u \):

\[
\frac{dy}{du}=5\cdot u^4.
\]

After that, let us find the derivative of the inner function:

\[
\frac{du}{dx}=3.
\]

Apply the chain rule:

\[
\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}=5\cdot u^4\cdot 3.
\]

Now substitute back in terms of \( x \):

\[
y’=5\cdot (3\cdot x+1)^4\cdot 3=15\cdot (3\cdot x+1)^4.
\]

So,

\[
y’=15\cdot (3\cdot x+1)^4.
\]

Example 2. Find the derivative of the function \( y=\sqrt{2\cdot x^2-7} \)

Here we also have a composite function. The outer function is the square root, and the inner function is the expression \( 2\cdot x^2-7 \). Let us write

\[
u=2\cdot x^2-7.
\]

Then

\[
y=\sqrt{u}.
\]

Now let us find the derivative of the outer function:

\[
\frac{dy}{du}=\frac{1}{2\cdot \sqrt{u}}.
\]

Next, let us find the derivative of the inner function:

\[
\frac{du}{dx}=4\cdot x.
\]

Apply the chain rule:

\[
\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}
=\frac{1}{2\cdot \sqrt{u}}\cdot 4\cdot x.
\]

Now substitute back in terms of \( x \):

\[
y’=\frac{1}{2\cdot \sqrt{2\cdot x^2-7}}\cdot 4\cdot x.
\]

Simplify the expression:

\[
y’=\frac{4\cdot x}{2\cdot \sqrt{2\cdot x^2-7}}=\frac{2\cdot x}{\sqrt{2\cdot x^2-7}}.
\]

So,

\[
y’=\frac{2\cdot x}{\sqrt{2\cdot x^2-7}}.
\]

Example 3. Find the derivative of the function \( y=\sin(5\cdot x^3) \)

In this case, the outer function is the sine, and the inner function is the expression \( 5\cdot x^3 \). So let us define

\[
u=5\cdot x^3.
\]

Then

\[
y=\sin(u).
\]

The derivative of the outer function is

\[
\frac{dy}{du}=\cos(u).
\]

The derivative of the inner function is

\[
\frac{du}{dx}=15\cdot x^2.
\]

Now apply the chain rule:

\[
\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}
=\cos(u) \cdot 15\cdot x^2.
\]

Substitute back the original argument:

\[
y’=\cos(5\cdot x^3)\cdot 15\cdot x^2.
\]

So,

\[
y’=15\cdot x^2\cdot \cos(5\cdot x^3).
\]

Example 4. Find the derivative of the function \( y=e^{x^2+4\cdot x} \)

Here the outer function is the exponential function, and the inner function is the quadratic expression \( x^2+4\cdot x \). Let us define

\[
u=x^2+4\cdot x.
\]

Then

\[
y=e^u.
\]

The derivative of the outer function is

\[
\frac{dy}{du}=e^u.
\]

The derivative of the inner function is

\[
\frac{du}{dx}=2\cdot x+4.
\]

By the chain rule, we get

\[
\frac{dy}{dx}=e^u\cdot (2\cdot x+4).
\]

Now substitute back in terms of \( x \):

\[
y’=e^{x^2+4\cdot x}\cdot (2\cdot x+4).
\]

So,

\[
y’=(2\cdot x+4)\cdot e^{x^2+4\cdot x}.
\]

Example 5. Find the derivative of the function \( y=\ln(x^2-3\cdot x+2) \)

Here the outer function is the natural logarithm, and the inner function is the quadratic expression \( x^2-3\cdot x+2 \). Let us define

\[
u=x^2-3\cdot x+2.
\]

Then

\[
y=\ln(u).
\]

The derivative of the outer function is

\[
\frac{dy}{du}=\frac{1}{u}.
\]

The derivative of the inner function is

\[
\frac{du}{dx}=2\cdot x-3.
\]

Now apply the chain rule:

\[
\frac{dy}{dx}=\frac{1}{u}\cdot(2\cdot x-3).
\]

Substitute back the original expression:

\[
y’=\frac{1}{x^2-3\cdot x+2}\cdot(2\cdot x-3).
\]

So,

\[
y’=\frac{2\cdot x-3}{x^2-3\cdot x+2}.
\]

What to Read Next: Useful Topics

After the topic of the chain rule, it is quite natural to move on to other basic differentiation rules that are very often used in practical problems. These materials will help you better understand how derivatives work in more complex expressions and how several rules can be combined in one solution.

  1. Power Rule: Formula, Proof, Examples — This article explains the derivative of power functions, the logic behind the formula, and how it is used in common practice problems.
  2. Product Rule: Formula, Proof, Examples — Here, we look at how to find the derivative of the product of two functions and how to apply this rule correctly in practice.
  3. Quotient Rule: Formula, Proof, Examples — This material shows how to calculate the derivative of a quotient of functions and what to pay attention to during the solution process.

Chain Rule: From Formula to Your Own Program

The chain rule is useful not only when finding derivatives by hand, but also in programming, when you need to study the behavior of a function using numerical methods. If you are interested in combining mathematical analysis with coding, try implementing the algorithm from the given flowchart in your favorite programming language and checking how the critical points of the function \( y=\sin(x^2-4\cdot x) \) are found in practice.

This is a good opportunity to see how the theoretical derivative formula turns into a sequence of calculations, conditions, and checks. That is exactly how a mathematical idea becomes a complete program.

A flowchart of the algorithm showing how the Chain Rule helps find the critical points of the function \( y=\sin(x^2-4\cdot x) \) on a given interval

Leave a Reply

Your email address will not be published. Required fields are marked *