Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Derivatives of Composite Functions

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Derivatives are an essential part of calculus. They help us in calculating the rate of change, maxima, minima for the functions. Derivatives by definition are given by using limits, which is called the first form of the derivative. We already know how to calculate the derivatives for standard functions, but sometimes we need to deal with complex mathematical functions which are composed of more than two functions. It becomes hard and cumbersome to calculate the derivative for such functions in a brute-force way. It becomes essential to learn about the rules and methods which make our calculation easier. The chain rule is one of them, which allows us to calculate the derivatives of complex functions. Let’s see this rule formally. 

Composite Functions and Chain Rule 

Let’s say we have a function f(x) = (x + 1)2, for which we want to calculate the derivative. These kinds of functions are called composite functions, which means they are made up of more than one function. Usually, they are of the form g(x) = h(f(x)) or it can also be written as g = hof(x). In our case, the given function f(x) = (x + 1)2 is composed of two functions,

f(x) = g(h(x)) where g(x) = x2 and h(x) = x + 1. 

For example, 

f(x) = (x + 1)2

⇒ f(x) = x2 + 1 + 2x

Differentiating the function with respect to x, 

f'(x) = 2x + 1

This function can be differentiated through complete binomial expansion but in case the value of the binomial exponent goes higher and higher, it becomes hard to expand it every time and then differentiate it. In those cases, chain rule becomes essential. 

Chain Rule

Let f be a real-valued function which is a composite of two functions, “u” and “v”, that is f = v o u. Let’s say t = u(x) and if both \frac{dv}{dt} and \frac{dt}{dx} exist for both of the functions “u” and “v”. 

\frac{df}{dx} = \frac{dv}{dt}\frac{dt}{dx}

The chain rule can be extended to any number of composite functions. For example, 

f = (w o u) o v. If t = v(x) and s = u(t) then, 

\frac{df}{dx} = \frac{d(w o u)}{dx}. \frac{dt}{dx} = \frac{dw}{ds}\frac{ds}{dt}\frac{dt}{dx}

Let’s say we have a function f(x) = sin(x2

This function is a composite function made up of two functions. If t = u(x) = x2 and v(t) = sin(t), then 

f(x) = (v o u)(x) = v(u(x)) = v(x2) = sin x2

Putting t = u(t) = x2\frac{dv}{dt} = cos(t) and \frac{dt}{dx} = 2x exist. Hence, by chain rule, 

\frac{df}{dx} = \frac{dv}{dt}\frac{dt}{dx} = cos(t).2x

\frac{df}{dx} = cos(x^2).2x

An alternative method to Chain Rule (Short trick to find derivative using chain rule)

The chain rule can also be applied with a shortcut method. This is explained with an example, let’s say we have a function f(x) = (sin(x))2. In general, we don’t really use the composition of the functions approach to differentiate the functions. We identify the “inside function” and the “outside function”. Then, differentiate the outside function leaving the inside function alone, and keep going like this in the hierarchy. 

\frac{df}{dx} = \frac{d}{dx}sin^2x

\frac{df}{dx} = 2sin(x)\frac{d}{dx}sinx

\frac{df}{dx} = 2sin(x)(cos(x))

\frac{df}{dx} = 2sin(x)cos(x)

Generally, this shortcut method is used to calculate the derivatives for different functions easily. 

Let’s see some problems with this rule, 

Sample Problems 

Problems on Derivatives of Polynomial Function and composite function using the chain rule

Question 1: Find the derivative for the function f(x) = (x + 2)2

Solution: 

This function is composite function, 

\frac{df}{dx} = \frac{d}{dx}(x + 1)^2

\frac{df}{dx} = 2(x + 1)\frac{d}{dx}(x + 1)

\frac{df}{dx} = 2(x + 1)

Question 2: Find the derivative for the function f(x) = (x6 + x2 + 1)10

Solution: 

\frac{df}{dx} = \frac{d}{dx}(x^6 + x^2 + 1)^{10}

⇒ \frac{df}{dx} = 10(x^6 + x^2 + 1)^9\frac{d}{dx}(x^6 + x^2 + 1)

⇒ \frac{df}{dx} = 10(x^6 + x^2 + 1)^9(\frac{d}{dx}x^6 + \frac{d}{dx}x^2)

\frac{df}{dx} = 10(x^6 + x^2 + 1)^9(6x^5 +2x)

Question 3: Find the derivative for the function f(x) = (x2 + 1)5

Solution: 

\frac{df}{dx} = \frac{d}{dx}(x^2 + 1)^{5}

⇒ \frac{df}{dx} = 5(x^2 + 1)^4\frac{d}{dx}( x^2 + 1)

⇒ \frac{df}{dx} = 5(x^2 + 1)^4(\frac{d}{dx}( x^2))

\frac{df}{dx} = 5(x^2 + 1)^4(2x)

\frac{df}{dx} = 10x(x^2 + 1)^4

Problem on Derivatives of Trigonometric function using chain rule

Question 4: Find the derivative of the function f(x) = sin(tanx + 5). 

Solution: 

 f(x) = sin(tanx + 5)

\frac{d}{dx}f(x) = \frac{d}{dx} sin(tan(x) + 5)

\frac{d}{dx}f(x) = cos(tan(x) + 5)\frac{d}{dx}(tan(x) + 5)

\frac{d}{dx}f(x) = cos(tan(x) + 5)\frac{d}{dx}(tan(x))

\frac{d}{dx}f(x) = cos(tan(x) + 5)sec^2(x)

Problem on derivatives of Power functions using chain rule

Question 5: Find the derivative of the function, f(x) = e(2x + 5)

Solution: 

 f(x) = e(2x + 5)

\frac{df}{dx} = \frac{d}{dx}(e^{(2x +5)})

\frac{df}{dx} = \frac{d}{dx}(e^{(2x +5)})

\frac{df}{dx} = e^{(2x +5)}\frac{d}{dx}(2x + 5)

\frac{df}{dx} = e^{(2x +5)}2

\frac{df}{dx} = 2e^{(2x +5)}

Problem on Derivatives of Modulus function using chain rule

Question 6: Find the derivative of the function, f(x) = | x + 1 |. 

Solution: 

Let’s say f(x) = |x + 1|. 

We know that modulus functions such |x| represent √x2. So, each modulus function can be transformed like this to find the derivative. 

f(x) = \sqrt{(x+1)^2}

\frac{d}{dx}f(x) = \frac{d}{dx}\sqrt{(x + 1)^2}

\frac{d}{dx}f(x) = \frac{1}{2}\frac{1}{\sqrt{(x + 1)^2}}\frac{d}{dx}(x + 1)^2

\frac{d}{dx}f(x) = \frac{x + 1}{\sqrt{(x + 1)^2}}

\frac{d}{dx}f(x) = \frac{x + 1}{\sqrt{(x + 1)^2}}

\frac{d}{dx}f(x) = \frac{x + 1}{|x + 1|}

\frac{d}{dx}f(x) = \frac{x + 1}{|x + 1|}

When x > -1 |x + 1| = x + 1, thus \frac{d}{dx}f(x) = \frac{x + 1}{x + 1} = 1

When x < -1 |x + 1| = -(x + 1), thus \frac{d}{dx}f(x) = \frac{x + 1}{-(x + 1)} = -1

When x = -1, the derivative is not defined. 

Question 7: Find the derivative of the function, f(x) = | 2x – 1 |. 

Solution: 

Let’s say f(x) = |2x – 1|. 

f(x) = \sqrt{(2x-1)^2}

\frac{d}{dx}f(x) = \frac{d}{dx}\sqrt{(2x - 1)^2}

\frac{d}{dx}f(x) = \frac{1}{2}\frac{1}{\sqrt{(2x - 1)^2}}\frac{d}{dx}(2x - 1)^2

\frac{d}{dx}f(x) = \frac{1}{2}\frac{1}{\sqrt{(2x - 1)^2}}2(2x - 1)\frac{d}{dx}(2x-1)

\frac{d}{dx}f(x) = \frac{1}{2}\frac{1}{\sqrt{(2x - 1)^2}}2(2x - 1).2

\frac{d}{dx}f(x) = 2\frac{1}{\sqrt{(2x - 1)^2}}(2x - 1)

\frac{d}{dx}f(x) = 2\frac{1}{\sqrt{(2x - 1)^2}}(2x - 1)

When x > \frac{1}{2}    |2x – 1| = 2x – 1, thus \frac{d}{dx}f(x) = 2\frac{1}{\sqrt{(2x - 1)^2}}(2x - 1) = 2

When x < \frac{1}{2}    |2x – 1| = -(2x – 1), thus \frac{d}{dx}f(x) = 2\frac{1}{\sqrt{(2x - 1)^2}}(2x - 1)=  -2

When x = \frac{1}{2}   , the derivative is not defined. 


My Personal Notes arrow_drop_up
Last Updated : 16 May, 2021
Like Article
Save Article
Similar Reads
Related Tutorials