The Chain Rule: Formula and Examples
In this article, we will learn what the chain rule is, the chain rule formula for different functions (like trigonometry, Logs, exponential, etc.) generalized chain rule for higher derivative, partial derivative, and many more concepts.
Chain Rule is one of the fundamental concepts in differential equations. It plays a significant role when differentiating the composite functions - Composite functions are those that are made up of two or more other functions.
For Example: cos (x2)
cos (x2) is made up of two function cos x and x2.
let's break it down to get a better understanding.
consider f(x) = cos x and g(x) = x2
then, f(g(x)) = cos x2.
=> cos x2 is a composite function.
What is the Chain Rule?
The Chain Rule in Calculus tells us how to differentiate the composite functions.
It states that if you have two functions f(u) and g(x) such that g(x) is inside f(u) and you want to find the derivative of f(g(x)), then:
- Differentiate the first (outer) function f(u) with respect to u (here - g(x)).
- Multiply the result of step 1 by the derivative of the inner function g(x) with respect to x.
Mathematically, it is given as:
if y = f(g(x)), then
dy/dx = d/dx [f (g (x) ) ] = f' ( g (x) ) * g'(x)
Let's take an example to get a better understanding of how to use the Chain Rule.
Example-1: Find the derivative of h(x) = (3x + 2)2 using the chain rule.
Here, the outer function is f(u) = u2, and the inner function is g(x) = 3x + 2.
=> h(x) = f(g(x))
Now, to find the derivative of h(x),
first, differentiate f(u) with respect to u, we get:
df(u)/du = d/du[u2] = 2u
second, differentiate g(x), with respect to x, we get:
dg(x)/ dx = d/dx [3x+2] = 3
=> Now, using the chain rule, we will get the following:
dh(x)/dx = f'(g(x)) * g'(x) = 2(3x + 2) * 3 = 6(3x + 2)
=> h'(x) = 18x + 12
In the above example, we have seen how to use the chain rule step-by-step. Now, in the following examples, we will directly use the chain rule formula.
Example-2: Find the derivative of k(x) = sin(5x) using the chain rule.
Let k(x) = f(g(x)), where f(u) = sin u and g(x) = 5x
=> k'(x) = f'(g(x)) * g'(x) = cos(5x) * 5
=> k'(x) = 5cos(5x)
Note: d/dx (sin x) = cosx and d/dx (kx^n) = n*k*x(n-1)
Let's take some more complex functions.
Example-3: Find the derivative of m(x) = e(2x2+ 3x) using the chain rule.
Let m(x) = f(g(x)), where f(u) = eu, and g(x) = 2x2 + 3x
=> m'(x) = f'(g(x)) * g'(x) = e(2x2+ 3x) * (4x + 3)
=> m'(x) = e(2x^2 + 3x) * (4x + 3)
Note: d/dx (ex) = ex d/dx (kxn) = n*k*x(n-1) and d/dx (f(x) + g(x)) = f'(x) + g'(x).
Till now, you have a clear understanding of what chain rule is and how to use it. Now, it’s time to level up.
Chain Rule for Three Functions
Let f(u), g(v), and h(x) be three functions such that y = f(g(h(x))). Then, the chain rule can be applied as follows:
- Differentiate f(u) with respect to g(v).
- Differentiate g(v) with respect to h(x).
- Multiply the results of step-1, step-2 with the derivate of the h(x).
Mathematically, it is represented as:
d/dx [f (g (h (x) ) ) ] = f' (g (h (x) ) ) * g' (h (x) ) * h' (x)
Now, let's take some examples to get a better understanding:
Example-1: Find the derivative of y = (sin (ex))1/2 using the chain rule.
let y(x) = f(g(h(x))), where f(u) = u1/2, g(x) = sin(v), and h(x) = ex
Now, using the chain rule formula, we get:
y'(x) = f'(g(h(x))) * g'(h(x)) * h'(x) = [1/2*(sin(ex))1/2] * cos(ex) * ex
=> y'(x) = [1/2*(sin(ex))1/2] * cos(ex) * ex
Note: d/dx (sin x) = cos x, d/dx ex = ex, d/dx(xn) = nx(n-1)
Example-2: Find the derivative of y = ln(cos(3x+2)) using the chain rule.
Let y(x) = f(g(h(x))), where f(u) = ln(u), g(v) = cos(v), and h(x) = 3x+2
Now, using the chain rule formula, we get:
y'(x) = f'(g(h(x))) * g'(h(x)) * h'(x) = 1/cos(3x+2) * (-sin(3x+2)) * 3
=> y'(x) = -3sin(3x+2) / cos(3x+2)
Note: d/dx (cos x) = -sinx, d/dx (ln x) = 1/x