Learn Calculus > Derivatives

Topics we're gonna study in Derivatives:

Derivatives - Intuition Ex. 1 - Power Rule Ex. 2 - Sum & Difference Rules Constant Multiple Rule Ex. 3 - Product Rule Ex. 4 - Quotient Rule Ex. 5 - Chain Rule Derivatives - Logarithms Derivatives - Exponentials Derivatives - Trigonometry Ex. 6 - Implicit Differentiation

Derivatives - Intuition

The derivative is the instantaneous slope of a function at a point. More precisely, the slope of the tangent line that touches the graph at that point.

Derivatives can be interpreted as speed, acceleration, inflation, and much more.

Furthermore, its sign indicates if a function is increasing or decreasing.

For example:

Let \(f(x) = 4x + 2\)

Using high school knowledge, we know \(f(x)\) is a linear function, meaning that it can be written as:

$$f(x) = ax + b = 4x + 2$$

Thus we're able to match \(b\) with \(+2\), which doesn't affect the variation rate of the function, and \(a\) with \(4\).

Therefore the slope of \(f(x)\) is \(4\), which is the function's derivative:

$$f'(x) = (4x + 2)' = 4$$

Since \(4 > 0\), we can say the function is increasing.

Note!

There are 2 ways to denote the derivative:

1. \(f'(x) \Rightarrow\) Lagrange's notation

2. \(\frac{d}{dx} f(x) \Rightarrow\) Leibniz's notation

Attention!

Note the slope of a linear function is constant all over its line, due to its constant change rate.

However, this is not true for all functions...

Derivatives of non-linear functions may result in another function, not just a number!

Let's see another example:

Let \(g(x) = -4x + 9\)

The derivative of \(g(x)\) is this:

$$g'(x) = \frac{d}{dx} (-4x + 9) = -4$$

Note the derivative is the constant \(-4\) in this case.

And as \(-4 < 0\), we can say this function is decreasing.

Tip!

The FORMAL mathematical definition of a derivative is:

$$f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}$$

But normally we just use the common differentiation techniques and rules, which let us solve almost any derivative just fine!

Ex. 1 - Power Rule

Let \(f(x) = x^2\)

Attention!

Note that the function is non-linear, that means it hasn't got a constant slope, but a slope that changes according to the point on the function. Furthermore, the derivative will result in a function, just get used to it, functions as our answers is gonna be common from now on!

To calculate the derivative of that, we have to be introduced to the Power Rule:

$$\frac{d}{dx} x^n = n \cdot x^{n-1}$$

Don't be scared! It's just telling you to "knock down" the exponent and then decrease the exponent by \(1\). Like this:

$$\frac{d}{dx} x^2 = 2 \cdot x^{2 - 1} = 2 \cdot x^1 = 2x$$

Therefore, the derivative of \(f(x)\) is the function \(2x\). Notice that the derivative depends on \(x\), meaning the slope changes at each point.

Tip!

If you wanna know the slope in \(x = 4\), for example, just do:

$$f'(4) = 2 \cdot 4 = 8$$

So the slope in \(x = 4\) is \(8\).

Ex. 2 - Sum & Difference Rules

Let \(f(x) = x^2 + x\)

The sum rule is simple. Just split the expression into separate derivatives:

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

Now, solve them one by one:

Use Power Rule: \(\frac{d}{dx} x^2 = 2 \cdot x^1 = 2x\)

Also use Power Rule: \(\frac{d}{dx} x = 1 \cdot x^0 = 1 \cdot 1 = 1\)

So we're left with:

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

That's the derivative! Easy, right?

Now let's see an example with the difference and the sum rules:

Let \(g(x) = x^4 - x^3 + x^2 - x\)

Just do the same. Differentiate each term separately:

$$(x^4)' = 4x^3$$

$$(-x^3)' = -3x^2$$

$$(x^2)' = 2x^1 = 2x$$

$$(-x)' = -1x^0 = -1$$

Now you just "join" them:

$$g'(x) = 4x^3 - 3x^2 + 2x - 1$$

Done!

Tip!

There are some "tricks" for well known derivatives to calculate it fast!

1. The derivative of \(ax\) is \(a\), just get the number multiplying \(x\):

$$(-40x)' = -40$$ $$\left(\frac{-12}{7} x\right)' = \frac{-12}{7}$$

2. The derivative of a constant is \(0\):

$$(0)' = 0$$ $$(e)' = 0$$ $$\left(\frac{-12}{7}\right)' = 0$$

Constant Multiple Rule

This is straightforward!

When you have to differentiate \(k \cdot f(x)\), where \(k\) is a constant and \(f(x)\) is a function, you just gotta pull out the constant:

$$\frac{d}{dx}[k \cdot f(x)] = k \cdot f'(x)$$

Examples:

$$(7x^7)' = 7 \cdot (x^7)' = 7 \cdot (7x^6) = 49x^6$$

$$\left(\frac{1}{3}x^3\right)' = \frac{1}{3} \cdot (x^3)' = \frac{1}{3} \cdot (3x^2) = \frac{3x^2}{3} = x^2$$

Ex. 3 - Product Rule

Let \(u\) and \(v\) be any two functions.

Product Rules says:

$$(uv)' = u'v + uv'$$

Let's say we have \(f(x) = x^2 \cdot (x + 1)\)

To find \(f'(x)\), just make \(u = x^2\) and \(v = (x + 1)\) and apply the formula:

$$\frac{d}{dx} x^2 \cdot (x + 1) = (x^2)' \cdot (x + 1) + x^2 \cdot (x + 1)'$$

From previous examples, we know \((x^2)' = 2x\) and \((x + 1)' = 1\).

Thus we're left with:

$$2x \cdot (x + 1) + x^2 \cdot 1 = 2x^2 + 2x + x^2 = 3x^2 + 2x$$

Therefore:

$$\frac{d}{dx} x^2 \cdot (x + 1) = 3x^2 + 2x$$

Tip!

Noticee that you could simplify the function the entire time:

$$x^2 \cdot (x + 1) = x^3 + x^2$$

$$\therefore \frac{d}{dx} (x^3 + x^2) = 3x^2 + 2x$$

But I split them into a product just for you to know it's also valid to apply the Product Rule, and sometimes that's the only thing that will work.

Ex. 4 - Quotient Rule

Let \(u\) and \(v\) be any two functions.

Quotient Rule says:

$$\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2}$$

For example:

Let's say \(f(x) = \frac{x^2 + 1}{x + 1}\)

Then we differentiate \(u\) and \(v\) using Power Rule and Sum Rule:

$$u = x^2 + 1 \implies u' = 2x + 0 = 2x$$

$$v = x + 1 \implies v' = 1 + 0 = 1$$

Now we just substitute everything into the formula:

$$\frac{2x \cdot (x + 1) - (x^2 + 1) \cdot 1}{(x + 1)^2}$$

Simplify the numerator, combine like terms and apply the Remarkable Product in the denominator:

$$\frac{2x^2 + 2x - x^2 - 1}{x^2 + 2 \cdot x \cdot 1 + 1^2} = \frac{x^2 + 2x - 1}{x^2 + 2x + 1}$$

So the derivative is:

$$\frac{d}{dx} \left(\frac{x^2 + 1}{x + 1}\right) = \frac{x^2 + 2x - 1}{x^2 + 2x + 1}$$

Attention!

Don't mess it up!

There's a "\(-\)" sign in the formula.

Thus the order of the terms is actually crucial!

This is a very common misstake students make!

Ex. 5 - Chain Rule

What if we had a function inside a function?

Let's say we have \(f(g(x))\).

Its derivative would be:

$$\frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x)$$

Look at this example:

Let \(f(x) = (x^2 + 1)^3\)

To differentiate it, first apply Power Rule "outside", then multiply by the derivative of the "inside":

$$f'(x) = 3 \cdot (x^2 + 1)^2 \cdot (x^2 + 1)'$$

Which becomes:

$$f'(x) = 3 \cdot (x^2 + 1)^2 \cdot 2x = 6x \cdot (x^2 + 1)^2$$

Done!

Tip!

Think of it as:

$$\text{outside}' \times \text{inside}'$$

Derivatives - Logarithms

Natural Log

Let \(f(x) = \ln(x)\)

This is a property of \(\ln(x)\):

$$\frac{d}{dx} \ln(x) = \frac{1}{x}$$

So let's make it interesting...

Let \(g(x) = \ln(u)\), where \(u\) is a function.

We can use Chain Rule:

$$\frac{d}{dx} \ln(u) = \frac{1}{u} \cdot u' = \frac{u'}{u}$$

Tip!

So, whenever you have \(\frac{d}{dx} \ln(f(x))\), it's equal to \(\frac{f'(x)}{f(x)}\)

It's just the derivative of the function divided by the function itself.

Any-Base Log

Let \(f(x) = \log_a(x)\)

Let's differentiate it!

$$\frac{d}{dx} \log_a(x)$$

To do so, we can use a property of logarithms to change the base:

$$\log_a(x) = \frac{\ln(x)}{\ln(a)}$$

Now, use Quotient Rule:

$$\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2}$$

$$u = \ln(x) \implies u' = \frac{1}{x}$$

$$a \text{ is constant } \implies \ln(a) \text{ is constant}$$

$$\therefore v = \ln(a) \implies v^2 = \left(\ln(a)\right)^2 \implies v' = 0$$

Substituting in the formula:

$$\left(\frac{\ln(x)}{\ln(a)}\right)' = \frac{\frac{1}{x} \cdot \ln(a) - \ln(x) \cdot 0}{\left(\ln(a)\right)^2} = \frac{\frac{1}{x} \cdot \ln(a)}{\left(\ln(a)\right)^2} = \frac{\ln(a)}{x \cdot \left(\ln(a)\right)^2} = \frac{1}{x \cdot \ln(a)}$$

Therefore:

$$\frac{d}{dx} \log_a(x) = \frac{1}{x \cdot \ln(a)}$$

Derivatives - Exponentials

Base \(e\)

Let \(f(x) = e^x\)

\(e^x\) has a unique property. When you differentiate it, it results in itself. So it doesn't change:

$$\frac{d}{dx} e^x = e^x$$

Now, let's say \(g(x) = e^{kx}\), where \(k\) is a constant.

We wanna find \(\frac{d}{dx} e^{kx}\)

You just gotta apply Chain Rule over here:

$$e^{kx} \cdot (kx)'$$

We know, from the Constant Multiple Rule, that \((kx)' = k\), thus we're left with:

$$k \cdot e^{kx}$$

Therefore:

$$\frac{d}{dx} e^{kx} = k \cdot e^{kx}$$

Any Base (Extra)

Let \(f(x) = a^x\)

We wanna find \(\frac{d}{dx} a^x\)

To do that, we need to use natural logarithm's property, which lets us write \(a^x)\ as:

$$a^x = e^{\ln(a^x)}$$

Let's use logarithm properties to manipulate a litle more:

$$a^x = e^{x \cdot \ln(a)}$$

From what we know about \(e^x\) properties, we then have:

\(a\) is constant \(\implies\) \(\ln(a)\) is constant as well

$$\frac{d}{dx} a^x = e^{x \cdot \ln(a)} \cdot \ln(a)$$

And as \(e^{x \cdot \ln(a)} = a^x\), we can come back with it. Therefore:

$$\frac{d}{dx} a^x = a^x \cdot \ln(a)$$

Tip!

When you see \(\frac{d}{dx} a^x\), just multiply it by \(\ln(a)\)

But let's now consider another function \(g(x) = a^{kx}\)

Let's find \(\frac{d}{dx} a^{kx}\)

To do so, we are basically gonna do the same thing:

$$a^{kx} = e^{\ln(a^{kx})} = e^{x \cdot k \cdot \ln(a)}$$

Differentiate using Chain Rule over again:

$$\frac{d}{dx} a^{kx} = e^{x \cdot k \cdot \ln(a)} \cdot (x \cdot k \cdot \ln(a))' = e^{x \cdot k \cdot \ln(a)} \cdot k \cdot \ln(a)$$

Then what's left is to substitute \(e^{x \cdot k \cdot \ln(a)}\) by \(a^{kx}\). Therefore:

$$\frac{d}{dx} a^{kx} = a^{kx} \cdot k \cdot \ln(a)$$

Tip!

When you see \(\frac{d}{dx} a^{kx}\), where \(k\) is a CONSTANT, just multiply it by \(k \cdot \ln(a)\)

Derivatives - Trigonometry

You can also differentiate trigonometric functions.

However, since their proofs involve more complex stuff, the derivatives are just gonna be shown here, but not deeply explained.

$$(\sin x)' = \cos x$$

$$(\cos x)' = -\sin x$$

$$(\tan x)' = \sec^2 x$$

Nevertheless we're able to prove the last one, let's do it:

$$\tan x = \frac{\sin x}{\cos x}$$

Just to make it easier, let \(S = \sin x\) and \(C = \cos x\)

$$\left(\frac{\sin x}{\cos x}\right)' = \left(\frac{S}{C}\right)' = \frac{S'C - SC'}{C^2}$$

We've just learned \(S' = C\) and \(C' = -S\), thus we substitute:

$$\frac{CC - S(-S)}{C^2} = \frac{C^2 + S^2}{C^2}$$

Now, Pythagorean Trigonometric Identity says:

$$\sin^2 x + \cos^2 x = 1$$

Then substitute:

$$\frac{1}{C^2} = \left(\frac{1}{C}\right)^2$$

Substitute \(C\) by \(\cos x\) again and note that \(\frac{1}{\cos x} = \sec x\)

$$\left(\frac{1}{\cos x}\right)^2 = (\sec x)^2 = \sec^2 x$$

Therefore:

$$(\tan x)' = \sec^2 x$$

Tip!

This tip will become handy in Product Rule of derivatives, integrals, AND in Taylor Series.

When you start off with \(\sin x\) and differentiate it forever you have a pretty cool and repeating sequence:

$$(\sin x)' = \cos x$$

$$(\cos x)' = -\sin x$$

$$(-\sin x)' = -\cos x$$

$$(-\cos x)' = -(-\sin x) = \sin x$$

$$(\sin x)' = \cos x$$

...

You see the pattern?

When you start differentiating \(\sin x\) forever, you get:

$$\{ \sin x, \cos x, -\sin x, -\cos x, ... \}$$

Let's now start differentiating forever with \(\cos x\):

$$(\cos x)' = -\sin x$$

$$(-\sin x)' = -\cos x$$

$$(-\cos x)' = -(-\sin x) = \sin x$$

$$(\sin x)' = \cos x$$

$$(\cos x)' = -\sin x$$

...

Again! It's repeating!

So when you start differentiating \(\cos x\) forever, you get:

$$\{ \cos x, -\sin x, -\cos x, \sin x, ... \}$$

Ex. 6 - Implicit Differentiation

Imagine you have this:

$$x^2 + y^2 = 25$$

Where \(y\) is a function of x (y is dependent on x).

What's the slope of the function at the point \((3, 4)\)?

First, we gotta substitute the point's coordinates to check whether the function contains it or not;

$$x^2 + y^2 = 3^2 + 4^2 = 9 + 16 = 25 \checkmark$$

So it is a point on the function!

Now, let's differentiate the equation using Sum Rule:

$$\frac{d}{dx} (x^2 + y^2) = 0 \implies \frac{d}{dx} x^2 + \frac{d}{dx} y^2 = 0$$

Note that \(y\) is a function, so we must apply Chain Rule:

$$2x + 2y \cdot y' = 0$$

Now, isolate \(y'\) to find the derivative of the function:

$$2y \cdot y' = -2x \implies y' = \frac{-2x}{2y} \implies y' = -\frac{x}{y}$$

There we go! We found the derivative!

And, finally, let's find the slope of the function at the point \((3, 4)\), which is just substituting the coordinates in the derivative:

Slope at (3, 4): $$slope = -\frac{3}{4}$$

Done!

Nevertheless, this technique can be used in many ways to find special derivatives or just more scary ones.

Let's take a look at another example:

Find \(\frac{d}{dx} x^x\)

First step:

Let $$y = x^x$$

Use log "Knock Down" property:

$$\ln(y) = \ln(x^x) \implies \ln(y) = x \cdot \ln(x)$$

Now, just differentiate both sides!

As we saw in the Logarithms topic: $$(\ln(y))' = \frac{y'}{y}:$$

$$\frac{y'}{y} = (x \cdot \ln(x))'$$

Applying Product Rule, we're left with:

$$\frac{y'}{y} = x' \cdot \ln(x) + x \cdot (\ln(x))' = 1 \cdot \ln(x) + x \cdot \frac{1}{x} = \ln(x) + 1$$

Now, just isolate \(y'\) and substitute \(y\) by the original form \(x^x\):

$$y' = y \cdot (\ln(x) + 1)$$

$$y' = x^x \cdot (\ln(x) + 1)$$

Done!