Geometrically, the problem of finding the derivative of the function is existence of the unique tangent line at some point of the graph of the function. The problem of finding the unique tangent line at some point of the graph of the function is equivalent to finding the slope of the tangent line at the same point.

Let $s$ be a secant line trough points $P(p, f(p))$ and $Q(q, f(q))$. A secant line trough these two points has the slope:

$$m_{sec} = \frac{f(q) – f(p)}{q-p}.$$

If $q \to p$, that is, if point $Q$ according to the graph of the function approaches point $P$, then the secant line $s$ becomes the tangent line $t$. Therefore, the slope of the secant line $m_{sec}$ becomes the slope of the tangent line $m_{tan}$, that is

$$ m_{tan}= \lim_{q \to p} \frac{f(q) – f(p)}{q-p}.$$

The expression $\frac{f(x) – f(x_o)}{x – x_0}$ is called **the difference quotient** for the function $f$ at point $x_0$.

Let $I \subseteq \mathbb{R}$ be an open interval. The function $f: I \to \mathbb{R}$ is **differentiable** **at the point** $x_0 \in I$ if exists

$$\lim_{x \to x_0} \frac{f(x) – f(x_0)}{x – x_0}.$$

The number

$$\lim_{x \to x_0} \frac{f(x) – f(x_0)}{x – x_0}$$

is called the **derivative of the function** $f$ **at point** $x_0$ and we write

$$f'(x_0) = \lim_{x \to x_0} \frac{f(x) – f(x_0)}{x – x_0}.$$

The function $f$ is **differentiable on** $I$ if it is **differentiable at every point** $x_o \in I$.

Therefore, the equation of a tangent at point $(x_0, f(x_0))$ is

$$y – f(x_0) = f'(x_0) (x – x_0).$$

To find a tangent to the curve at point $(x_0, f(x_0))$, it’s enough to find its slope, and that number is $f'(x_0)$ (provided that this limit exists).

If we let $\Delta x = x – x_0$, then $x= \Delta x + x_0$ and $\Delta x \to 0$ as $x \to x_0$, the definition of the derivative of the function $f: I \to \mathbb{R}$ at point $x_0$ we can also write in the following form:

$$f'(x_0) = \lim_{\Delta x \to 0 } \frac{f( x_0 + \Delta x) – f(x_0)}{\Delta x},$$

where $\Delta x$ is the change in $x$-coordinates and $\Delta y = \Delta f(x) = f(x_0 + \Delta x) – f(x_0)$ is the change in $y$-coordinates.

A derivative can also be written with symbols:

$$f'(x) = \frac{d f(x)}{dx} = \frac{d y}{d x}.$$

**Theorem**.

Let $I \subseteq \mathbb{R}$ be an open interval and $f: I \to \mathbb{R}$. If the function $f$ is differentiable on $I$, then the function is continuous on $I$.

The opposite is not true. A counterexample; the absolute value function $abs: \mathbb{R} \to \mathbb{R}^+$ defined as

$$abs(x) :$$

$$x, x \ge 0 $$

$$-x, x<0 $$

is continuous on $\mathbb{R}$, however, it doesn’t have a derivative at point $x = 0$.

**Derivative rules**

Let $ I \subseteq \mathbb{R}$ be an open interval and $f, g: I \to \mathbb{R}$ differentiable functions at point $x_o \in I$. Then

**1.)** the function $f + g$ is differentiable at point $x_0$ and

$$(f+g)’ = f’ + g’$$,

**2.) **(*the Leibniz rule*) the function $f \cdot g$ is differentiable at point $x_o$ and

$$ f \cdot g = f’ \cdot g + f \cdot g’$$,

**3.)** the function $\alpha \cdot f$, $\alpha \in \mathbb{R}$ is differentiable at point $x_0$ and

$$(\alpha \cdot f)’ = \alpha \cdot f’$$,

**4.)** the function $\frac{f}{g}$ defined on $I$ is differentiable at point $x_0$ and

$$\left( \frac{f}{g}\right)’ = \frac{f’ \cdot g – f \cdot g’ }{g^2}$$.

**The derivative of a constant function** $f: \mathbb{R} \to \mathbb{R}$, $f(x) = c$ at $x_0 \in \mathbb{R}$ is equal to

$$f'(x_0) = \lim_{x \to x_0} \frac{f(x) – f(x_0)}{x – x_0} = \lim_{x \to x_0}\frac{c – c}{x – x_o} =0,$$

that is, $f'(x) = 0$.

The derivative of a function $f: \mathbb{R} \to \mathbb{R}$, $f(x) = x$ at point $x_0 \in \mathbb{R}$ is equal to

$$f'(x_0) = \lim_{x \to x_0} \frac{f(x) – f(x_0)}{x – x_0} = \lim_{x \to x_0}\frac{x – x_0}{x – x_0} =\lim_{x \to x_0} 1 = 1 ,$$

that is, $f'(x) = 1$.

For all $n \in \mathbb{Z}, n\neq 0$ is valid $(x^n)’ = n \cdot x ^{n-1}$. For $n < 0$ the potential $x^n$ we can write as a fraction:

$$x^n = \frac{1}{x^{-n}} = \frac{1}{x^t},$$

where $t = -n$ is a positive number.

That is, we have:

$$(x^n)’ = \left ( \frac{1}{n} \right)’ = – \frac{tx^{t-1}}{x^{2t}} = -t \frac{1}{x^{t+1}} = n \frac{1}{x^{-n+1}} = nx^{n-1}.$$

**Example 1**. Find the derivative of function $f$ if

$$ f(x) = 3 x^3 -2x^2 + 3x -1.$$

**Solution**:

$$f'(x) = (3 x ^3) ‘ – (2x^2)’ +(3x)’ – 1’$$

$$ = 3 \cdot 3 \cdot x ^{3 – 1} – 2 \cdot 2 \cdot x ^{2 – 1} + 3 \cdot 1 – 0 $$

$$ = 9 x^2 – 4 x + 3.$$

**Example 2**. Find the derivative of function $f$ if

$$f(x) =(x^2 – 1) ( 3x +4)$$

**Solution**:

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

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

$$= 6x^2 + 8x + 3x^2 -3 $$

$$= 9x^2 + 8x -3 .$$

**Example 3**. Find the derivative of function $f$ if

$$f(x) = \frac{x^2 – 6x + 5}{x-3}$$

**Solution**:

$$f'(x) = \frac{(x^2 – 6x + 5)’ \cdot (x-3) – (x^2 – 6x + 5) \cdot (x-3)’}{(x-3)^2}$$

$$ = \frac{(2x – 6) \cdot (x-3) – (x^2 – 6x + 5) \cdot 1}{(x-3)^2}$$

$$= \frac{2x^2 – 6x – 6x + 18 – x^2 + 6x -5}{(x+3)^2}$$

$$= \frac{x^2 – 6x +15}{(x+3)^2} $$

**Derivatives of trigonometric functions**

**Derivative of function sine**.

We will use the trigonometric identity for difference of sines. Firstly, we calculate the difference quotient:

$$\frac{f(x) – f(x_0)}{x – x_0} = \frac{\sin x – \sin x_0}{x – x_0}$$

$$ = \frac{2 \sin \frac{x – x_0}{2} \cos \frac{x + x_0}{2}}{x – x_0}$$

$$ = \frac{\sin \frac{x – x_0}{2}}{\frac{x – x_0}{2}} \cos \frac{x + x_0}{2}. $$

By using the definition of derivative we have:

$$f'(x_0) = \lim_{x \to x_0} \frac{\sin \frac{x – x_0}{2}}{\frac{x – x_0}{2}} \cos \frac{x + x_0}{2}$$

$$ = \lim_{x \to x_0} \frac{\sin \frac{x – x_0}{2}}{\frac{x – x_0}{2}} \cdot \lim_{x \to x_0} \cos \frac{x + x_0}{2}. $$

Since $\lim_{x \to 0} \frac{\sin x}{x} = 1$, then

$$f'(x_0) = 1 \cdot \lim_{x \to x_0}\cos \frac{x+ x_0}{2} $$

$$ = \cos \frac{2 x_0}{2}$$

$$ = \cos x_0.$$

That is, we obtained $(\sin x)’ = \cos x$.

Similarly, we can find derivatives of the rest trigonometric functions:

**Higher order derivative**

If the function $f: I \to \mathbb{R}$ has the derivative at every point of open interval $I$, then the function $f’$ also has the derivative on $I$. The derivative of the function $f’$ is denoted as $f”$ and is called **the second derivative** **of the function** $f$.

**The** $n$**th derivative of the function** $f$ is denoted as $f^{(n)}$ and defined as

$$f^{(n)}(x) = \left (f^{(n-1)} (x) \right)’.$$

**Example 4**. Determine the third derivative of the function $f$ if:

$$f(x) =2 x^5 – 3x.$$

**Solution**:

$$f'(x) = 2 \cdot 5 \cdot x^{5-1} – 3 = 10x^4 -3$$

$$f”(x) = (f'(x))’ = (10 x^4 – 3) ‘ = 40 x^3$$

$$f”'(x) = (f”(x))’ = (40 x^3)’ = 120 x^2$$

**The composite function rule**

If $f$ and $g$ are differentiable functions, then a composite function $f(g(x))$ is differentiable and the derivative of a composite function $f(g(x))$ we calculate by the following formula:

$$f(g(x))’ = f'(g(x)) \cdot g'(x).$$

The formula above is also known as **the chain rule**.

**Example 5**. Calculate the derivative of the following function:

$$f(x) = \sqrt{1 – 2x}.$$

**Solution**:

Firstly, note that $f(x) = f(g(x))$, where $f(x) = \sqrt{x}$ and $g(x) = 1 – 2x$.

Therefore, we have:

$$f'(x) = \frac{1}{2 \sqrt{x}} \Longrightarrow f'(g(x)) =\frac{1}{2 \sqrt{1 – 2x}} $$

and

$$g'(x) = (1 -2x)’ = -2,$$

Now, by the chain rule, we have:

$$f'(x) = \frac{1}{2 \sqrt{1 – 2x}} \cdot (- 2) = -\frac{1}{\sqrt{1 – 2x}}.$$

**Derivative of inverse function**

Let $f$ be injective function and $f'(x) \neq 0$. Then its inverse function $f^{-1}$ is differentiable at point $y=f(x)$ and

$$(f^{-1})'(y) = \frac{1}{f'(x)}, \quad \quad f'(x) = \frac{1}{(f^{-1})'(y)}.$$

For instance, $y = \sqrt{x} \Longleftrightarrow x = y^2$, that is, the function $f^{-1}(y) = y^2$ is an inverse function of function $f(x) = \sqrt{x}$. By using the formula $f'(x) = \frac{1}{(f^{-1})'(y)}$ we calculate:

$$ (\sqrt{x})’ = f'(x) = \frac{1}{(f^{-1})'(y)} = \frac{1}{2y} = \frac{1}{2 \sqrt{x}}.$$

**Derivative of logarithmic function**

All logarithmic functions can be represented as logarithmic function of one base. Therefore, we choose $f(x) = \ln x$, which base is the number $e$.

**Note**. The function $\ln: \mathbb{R}^+ \to \mathbb{R}$ defined as $f(x) = \ln x$ is called the **natural** **logarithm function**.

The number $e$ is defined as the limit of a sequence:

$$e = \lim_{n \to \infty} \left(1 + \frac{1}{n} \right)^n.$$

Firstly, we calculate the difference quotient:

$$\frac{f(x + \Delta x) – f(x)}{\Delta x} = \frac{\ln (x + \Delta x) – \ln x}{\Delta x}.$$

Now, by using the rule of logarithms $\left ( \log x – \log y = \log \frac{x}{y} \right)$ we have:

$$\frac{f(x + \Delta x) – f(x)}{\Delta x} = \frac{1}{\Delta x} (\ln (x + \Delta x) – \ln x)$$

$$= \frac{1}{\Delta x} \ln \left (\frac{x + \Delta x}{x} \right ).$$

By the definition of derivative now we have:

$$(\ln x)’ = \lim_{\Delta x \to 0} \frac{1}{\Delta x} \ln \left (\frac{x + \Delta x}{x} \right ) $$

$$ =\lim_{\Delta x \to 0} \frac{1}{\Delta x} \ln \left ( 1 +\frac{\Delta x}{x} \right ).$$

If we define $n: = | \frac{x}{\Delta x} |$ then $n \to +\infty$ when $\Delta x \to 0$. Since the domain of the function $\ln$ is $\mathbb{R}^+$, then $n> 0$, that is $x >0$. Therefore, we can write $n = \frac{x}{\Delta x}$. It follows that $\frac{\Delta x}{x} = \frac{1}{n}$ and $\Delta x = \frac{x}{n}$, that is $\frac{1}{\Delta x} = \frac{n}{x}$.

By the substitution we obtain:

$$(\ln x)’ = \lim_{n \to + \infty} \frac{n}{x} \ln \left( 1 + \frac{1}{n} \right) .$$

By using the logarithm rule $\log_a x^n = n \log_a x$ we have:

$$(\ln x)’ = \lim_{n \to \infty} \frac{1}{x} \left(1 + \frac{1}{n} \right)^n$$ $$ = \frac{1}{x} \lim_{n \to \infty} \left(1 + \frac{1}{n} \right)^n.$$

We defined $e = \lim_{n \to \infty} \left(1 + \frac{1}{n} \right)^n$, therefore

$$(\ln x)’ = \frac{1}{x} \cdot \ln e,$$

that is,

$$(\ln x)’ = \frac{1}{x}.$$

Derivative of logarithm of any other base we calculate from the connection of logarithm functions:

$$\log_a x = \frac{1}{ \ln a} \cdot \ln x$$

Therefore,

$$(\log_a x)’ = \frac{1}{\ln a} \cdot \frac{1}{x} = \frac{1}{x \ln a}.$$

**Derivative of exponential function**

The exponential function is an inverse function of logarithmic function:

$$ y = e^x \Longleftrightarrow x = \ln y.$$

By using the rule for derivative of inverse function we have:

$$(e^x)’ = \frac{1}{(\ln y)’} = \frac{1}{\frac{1}{y}} = y = e^x.$$

A derivative of the exponential function $a^x$ we calculate from the connection:

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

Note;

$$(\ln f) ‘ = (\ln f)’ \cdot f’ = \frac{1}{f} \cdot f’,$$

$$(e^f)’ = (e^f)’ \cdot f’ = e^f \cdot f’.$$

**Example 6**. Find the derivative of function $f$ if

$$f(x) = \ln ( \sin x).$$

**Solution**:

$$f'(x) =\frac{1}{\sin x} \cdot (\sin x)’ = \frac{1}{\sin x} \cdot \cos x = \frac{\cos x}{\sin x} = \cot x.$$

**Example 7**. Calculate the first derivative of function $f$ at point $x = 1$ if

$$f(x) = e^{x-2}.$$

**Solution**:

$$f'(x) = (e^{x-2})’ = e^{x-2} \cdot (x -2)’ = e^{x-2} \cdot (-2).$$

It follows

$$f'(1) = (-2) \cdot e^{1-2} = (-2) \cdot e^{-1} = -\frac{2}{e}.$$