# Derivative by First Principle

**Derivative by first principle** refers to using algebra to find a general expression for the slope of a curve. It is also known as the delta method. The derivative is a measure of the instantaneous rate of change, which is equal to

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

This expression is the foundation for the rest of differential calculus: every rule, identity, and fact, follows from this.

## Derivative by First Principle

A derivative is simply a measure of the rate of change. It can be the rate of change of distance with respect to time or the temperature with respect to distance. We want to measure the rate of change of a function \( y = f(x) \) with respect to its variable \( x \).

The general notion of rate of change of a quantity \( y \) with respect to \(x\) is the change in \(y\) divided by the change in \(x\), about the point \(a\). This describes the **average rate of change**, and can be expressed as

\[ \frac{ f(x ) - f( a) } { x - a } . \]

To find the instantaneous rate of change, we take the limiting value as \(x \) approaches \(a\). To simplify this, we set \( x = a + h \), and we want to take the limiting value as \( h \) approaches 0. Thus, we have

\[ \lim_{h \rightarrow 0 } \frac{ f(a+h) - f(a) } { h }. \]

(Review Two-sided Limits.) If this limit exists and is finite, then we say that

\[ f'(a) = \lim_{h \rightarrow 0 } \frac{ f(a+h) - f(a) } { h }. \]

Evaluate the derivative of \(x^2 \) at \( x=1\) using first principle.

Here \(f(x) = x^2 \) and \(c=1\). Using first principle, we can write\[ \begin{array}{l l} \frac{\text{d}}{\text{d}x} f(x) & = \lim_{h \to 0} \frac{ f(1 + h) - f(1) }{h} \\ & = \lim_{h \to 0} \frac{ (1 + h)^2 - (1)^2 }{h} \\ & = \lim_{h \to 0} \frac{ 1 + 2h +h^2 - 1 }{h} \\ & = \lim_{h \to 0} \frac{ 2h +h^2 }{h} \\ & = \lim_{h \to 0} (2+h) \\ & = 2.\ _\square \\ \end{array} \]

Evaluate the derivative of \(x^n \) at \( x=2\) using first principle, where \( n \in \mathbb{N} \).

Here \(f(x) = x^n \) and \(c=2\). Using first principle, we can write\[ \begin{array}{l l} \frac{\text{d}}{\text{d}x} f(x) & = \lim_{h \to 0} \frac{ f(2 + h) - f(2) }{h} \\ & = \lim_{h \to 0} \frac{ (2 + h)^n - (2)^n }{h} \\ & = \lim_{h \to 0} \frac{ 2^n + \binom{n}{1}2^{n-1}\cdot h +\binom{n}{2}2^{n-2}\cdot h^2 + \cdots + h^n - 2^n }{h} \\ & = \lim_{h \to 0} \frac{ \binom{n}{1}2^{n-1}\cdot h +\binom{n}{2}2^{n-2}\cdot h^2 + \cdots + h^n }{h} \\ & = \lim_{h \to 0} \left[\binom{n}{1}2^{n-1} +\binom{n}{2}2^{n-2}\cdot h + \cdots + h^{n-1}\right] \\ & = n2^{n-1}.\ _\square \end{array} \]

Evaluate the derivative of \(\sin x \) at \( x=a\) using first principle, where \( a \in \mathbb{R} \).

Here \(f(x) = \sin x\) and \(c=a\). Using first principle, we can write\[\begin{array}{l l} \frac{\text{d}}{\text{d}x} f(x) & = \lim_{h \to 0} \frac{ f(a + h) - f(a) }{h} \\ & = \lim_{h \to 0} \frac{ \sin (a + h) - \sin (a) }{h} \\ & = \lim_{h \to 0} \frac{ \sin a \cos h + \cos a \sin h - \sin a }{h} \\ & = \lim_{h \to 0}\left[ \sin a \bigg( \frac{\cos h-1 }{h} \bigg) + \cos a \bigg( \frac{\sin h }{h} \bigg)\right] \\ & = \sin a \lim_{h \to 0} \bigg( \frac{\cos h-1 }{h} \bigg) + \cos a \lim_{h \to 0} \bigg( \frac{\sin h }{h} \bigg) \\ & = \sin a\cdot (0) + \cos a \cdot (1) \\ & = \cos a.\ _\square \end{array}\]

The above examples demonstrate the method in which the derivative is computed. If you know some standard derivatives like that of \(x^n\) and \(\sin x,\) you could just realize that the above obtained values are just the values of the derivatives at \(x=2\) and \(x=a\) respectively. In fact, all the standard derivatives and rules are derived using first principle. You can try deriving those using the principle for further exercise to get acquainted to evaluating the derivative via the limit.

## One-sided Derivative

Consider a function \(f : [a,b] \rightarrow \mathbb{R}, \) where \( a, b \in \mathbb{R} \). In general, derivative is only defined for values in the interval \( (a,b) \). Let \( c \in (a,b) \) be the number at which the rate of change is to be measured.

Firstly consider the interval \( (c, c+ \epsilon ),\) where \( \epsilon \) is number arbitrarily close to zero. Let \( 0 < \delta < \epsilon \) .

Rate of change \((m)\) is given by \(\displaystyle \frac{f(x_2) - f(x_1)}{x_2 - x_1} \). So for a given value of \( \delta \) the rate of change from \( c\) to \( c + \delta \) can be given as

\[ m = \frac{ f(c + \delta) - f(c) }{(c+ \delta ) - c }.\]

As \(\epsilon \) gets closer to \(0,\) so does \(\delta \) and it can be expressed as the right hand limit:

\[ m_+ = \lim_{h \to 0^+} \frac{ f(c + h) - f(c) }{h}.\]

This limit, if existent, is called the right hand derivative at \(c\). Similarly we can define the left hand derivative as follows:

\[ m_- = \lim_{h \to 0^-} \frac{ f(c + h) - f(c) }{h}.\]

The function \(f\) is said to be **derivable** at \(c\) if \( m_+ = m_- \). The equal value is called the derivative of \(f\) at \(c\).

The limit \( \lim_{h \to 0} \frac{ f(c + h) - f(c) }{h} \), if it exists (by conforming to the conditions above), is the derivative of \(f\) at \(c\) and the method of finding the derivative by such a limit is called **derivative by first principle**.

Often, the limit is also expressed as \(\frac{\text{d}}{\text{d}x} f(x) = \displaystyle \lim_{x \to c} \frac{ f(x) - f(c) }{x-c} \).

## Problem Solving

Derivative by first principle is often used in cases where limits involving an unknown function are to be determined and sometimes the function itself is to be determined.

A function satisfies the following equation:

\[ \lim_{h \to 0} \frac{ f(4h) + f(2h) + f(h) + f\big(\frac{h}{2}\big) + f\big(\frac{h}{4}\big) + f\big(\frac{h}{8}\big) + \cdots}{h} = 64. \]

Given that \( f(0) = 0 \) and that \( f'(0) \) exists, determine \( f'(0) \).

At first glance, the question does not seem to involve first principle at all, and is merely about properties of limits.

Well, in reality it does involve a simple property of limits but the crux is the application of first principle. Maybe, it is not so clear now, but just let us write the derivative of \(f\) at \(0\) using first principle:

\[\begin{align} f'(0) & = \lim_{h \to 0} \frac{ f(0 + h) - f(0) }{h} \\ & = \lim_{h \to 0} \frac{ f( h) - (0) }{h} \\ & = \lim_{h \to 0} \frac{ f(h)}{h}. \end{align}\]

This is somewhat the general pattern of the terms in the given limit. This hints that there might be some connection with each of the terms in the given equation with \( f'(0) \). Let us consider the limit \( \lim_{h \to 0}\frac{f(nh)}{h} \), where \( n \in \mathbb{R}. \) This is quite simple. Let \( t=nh \). Then as \( h \to 0 , t \to 0 \), and therefore the given limit becomes \( \lim_{t \to 0}\frac{nf(t)}{t} = n \lim_{t \to 0}\frac{f(t)}{t},\) which is nothing but \( n f'(0) \). Now this probably makes the next steps not only obvious but also easy:

\[ \begin{align} \lim_{h \to 0} \frac{ f(4h) + f(2h) + f(h) + f\big(\frac{h}{2}\big) + f\big(\frac{h}{4}\big) + f\big(\frac{h}{8}\big) + \cdots }{h} = & \lim_{h \to 0} \frac{f(4h)}{h} + \frac{f(2h)}{h} + \frac{f(h)}{h} + \frac{f\big(\frac{h}{2}\big)}{h} + \cdots \\ = & 4 f'(0) + 2 f'(0) + f'(0) + \frac{1}{2} f'(0) + \cdots \\ = & f'(0) \left( 4+2+1+\frac{1}{2} + \frac{1}{4} + \cdots \right) \\ = & f'(0) \times 8\\ = &64. \end{align} \]

Therefore, the value of \(f'(0) \) is 8. \(_\square \) [[end-hidden]]

A function \(f\) satisfies the following relation:

\[ f(mn) = f(m)+f(n) \quad \forall m,n \in \mathbb{R}^{+} .\]

Given that \( f'(1) = c \) (exists and is finite), find a non-trivial solution for \(f(x) \).

The previous question gives us the required lead:\[\displaystyle f'(1) =\lim_{h \to 0}\frac{f(1+h) - f(1)}{h} = p \ (\text{call it }p).\]

Let us analyze the given equation. For \( m=1,\) the equation becomes \( f(n) = f(1) +f(n) \implies f(1) =0 \). Moreover, to find the function, we need to use the given information correctly. An expression involving the derivative at \( x=1 \) is most likely to come when we differentiate the given expression and put one of the variables to be equal to one.

But wait, we actually do not know the differentiability of the function. Either we must prove it or establish a relation similar to \( f'(1) \) from the given relation. It means either way we have to use first principle!!

Let \( m =x \) and \( n = 1 + \frac{h}{x}, \) where \(x\) and \(h\) are real numbers. Then we have

\[ f\left( x\left(1+\frac{h}{x} \right) \right) = f(x) + f\left( 1+ \frac{h}{x} \right) \implies f(x+h) - f(x) = f\left( 1+ \frac{h}{x} \right). \]

Divide both sides by \(h\) and let \(h\) approach \(0\):

\[ \lim_{h \to 0}\frac{f(x+h) - f(x)}{h} = \lim_{ h \to 0} \frac{ f\Big( 1+ \frac{h}{x} \Big) }{h}. \]

The left hand side of the equation represents \(f'(x), \) and if the right hand side limit exists, then the left hand one must also exist and hence we would be able to evaluate \(f'(x) \). Consider the right hand side of the equation:

\[ \lim_{ h \to 0} \frac{ f\Big( 1+ \frac{h}{x} \Big) }{h} = \lim_{ h \to 0} \frac{ f\Big( 1+ \frac{h}{x} \Big) - 0 }{h} = \frac{1}{x} \lim_{ h \to 0} \frac{ f\Big( 1+ \frac{h}{x} \Big) -f(1) }{\frac{h}{x}}. \]

The final expression is just \(\frac{1}{x} \) times the derivative at 1 \(\big(\)by using the substitution \( t = \frac{h}{x}\big) \), which is given to be existing, implying that \( f'(x) \) exists. Hence, \( f'(x) = \frac{p}{x} \).

This is a standard differential equation the solution, which is beyond the scope of this wiki. Since \( f(1) = 0 \) \((\)put \( m=n=1 \) in the given equation\(),\) the function is \( \displaystyle \boxed{ f(x) = \text{ ln } x }. \) \(_\square\)

Note: If we were not given that the function is differentiable at 0, then we cannot conclude that \(f(x) = cx \). (See Functional Equations.)

Consider the piecewise function

\[ f(x) =

\begin{cases} -x^2 && x < 0 \\ 0 && x = 0 \\ \sin x && x> 0. \end{cases}\]Evaluate \(f'(0) \).

\(f'(0) \) means the derivative of \(f(x)\) at the point \(x=0\). Now one must realize that since \(f(x)\) is a piecewise defined function, it is possible that \( f(a+0^+) , f(a + 0^-) \) and \( f(a) \) may be given different formulas. Hence, to evaluate the derivative, we must evaluate the derivatives from both sides and check whether they are equal or not.So, using the terminologies in the wiki, we can write

\[\begin{align} m_+ & = \lim_{h \to 0^+} \frac{ f(0 + h) - f(0) }{h} \\ & = \lim_{h \to 0^+} \frac{ \sin (0 + h) - (0) }{h} \\ & = \lim_{h \to 0} \frac{ \sin h}{h} \\ & = \boxed{1}. \end{align}\]

For \( f(0+h) \) where \( h \) is a small positive number, we would use the function defined for \( x > 0 \) since \(h\) is positive and hence the equation.

Similarly, we have

\[\begin{align} m_- & = \lim_{h \to 0^-} \frac{ f(0 + h) - f(0) }{h} \\ & = \lim_{h \to 0^-} \frac{ (0 + h)^2 - (0) }{h} \\ & = \lim_{h \to 0} \frac{ h^2}{h} \\ & = \boxed{0}. \end{align}\]

Now, for \( f(0+h) \) where \( h \) is a small negative number, we would use the function defined for \( x < 0 \) since \(h\) is negative and hence the equation.

But wait, \( m_+ \neq m_- \)!! It implies the derivative of the function at \(0\) does not exist at all!!!

So actually this example was chosen to show that first principle is also used to check the "differentiability" of a such a piecewise function, which is discussed in detail in another wiki. Such functions must be checked for continuity first and then for differentiability. Also had we known that the function is differentiable, there is in fact no need to evaluate both \( m_+ \) and \( m_-\) because both have to be equal and finite and hence only one should be evaluated, whichever is easier to compute the derivative.

So, the answer is that \( f'(0) \) does not exist. \(_\square\)

**Cite as:**Derivative by First Principle.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/derivative-by-first-principle/