# Derivative by First Principle

Derivative from first principles refers to using algebra to find a general expression for the slope of a curve. It is also known as the delta method. Derivative is a measure of the instantaneous rate of change, which is interpreted as

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

## 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}.h +\binom{n}{2}2^{n-2}.h^2 + \dots + h^n - 2^n }{h} \\ & = \lim_{h \to 0} \frac{ \binom{n}{1}2^{n-1}.h +\binom{n}{2}2^{n-2}.h^2 + \dots + h^n }{h} \\ & = \lim_{h \to 0} \binom{n}{1}2^{n-1} +\binom{n}{2}2^{n-2}.h + \dots + h^{n-1} \\ & = 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} \sin a \bigg( \frac{1- \cos h }{h} \bigg) + \cos a \bigg( \frac{\sin h }{h} \bigg) \\ & = \sin a \lim_{h \to 0} \bigg( \frac{1- \cos h }{h} \bigg) + \cos a \lim_{h \to 0} \bigg( \frac{\sin h }{h} \bigg) \\ & = \sin a .(0) + \cos a .(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 the 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 as:
\[ 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\) iff \( m_+ = m_- \). The equal value is called the derivative of \(f\) at \(c\).

The limit \(\displaystyle \lim_{h \to 0} \frac{ f(c + h) - f(c) }{h} \), if 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 of where limits involving 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(\frac{h}{2}) + f(\frac{h}{4}) + f(\frac{h}{8}) + \dots \dots }{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 the 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 the first principle. Maybe, it is not so clear now, but just let us write the derivative of \(f\) at \(0\) using first principle.

\(\displaystyle \begin{array}{l l} 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{array} \)

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 following limit:

\( \displaystyle \lim_{h \to 0}\frac{f(nh)}{h} \) , where \( n \in \mathbb{R} \) This is quite simple. Put \( t=nh \). As \( h \to 0 , t \to 0 \), therefore the given limit becomes \( \displaystyle \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{array} {l l} & \lim_{h \to 0} \frac{ f(4h) + f(2h) + f(h) + f(\frac{h}{2}) + f(\frac{h}{4}) + f(\frac{h}{8}) + \dots \dots }{h} \\ = & \lim_{h \to 0} \frac{f(4h)}{h} + \frac{f(2h)}{h} + \frac{f(h)}{h} + \frac{f(\frac{h}{2})}{h} + \dots \dots \\ = & 4 f'(0) + 2 f'(0) + f'(0) + \frac{1}{2} f'(0) + \dots \dots \\ = & f'(0) \left( 4+2+1+\frac{1}{2} + \frac{1}{4} + \ldots \right) \\ = & f'(0) \times 8 \\ \end{array} \]

Therefore the value of \(f'(0) \) is 8. \(_ \square \)

## If 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 \(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 \quad \)(let)Let us analyse the given equation. For \( m=1\) the equation becomes \( f(n) = f(1) +f(n) \Rightarrow 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 use the first principle!!Put \( m =x \) and \( n = 1 + \frac{h}{x} \) where \(x\) and \(h\) are real numbers . Therefore, we have, \[ f\Big( x\big(1+\frac{h}{x} \big) \Big) = f(x) + f\Big( 1+ \frac{h}{x} \Big) \Rightarrow f(x+h) - f(x) = f\Big( 1+ \frac{h}{x} \Big) \] Divide both sides by \(h\) and let \(h\) approach \(0\). \[ \Rightarrow \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 :

\(\displaystyle = \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 one ( By using the substitution \( t = \frac{h}{x} \) ) which is given to be existing implying that \( f'(x) \) exists. Hence, \( \displaystyle f'(x) = \frac{p}{x} \).This is a standard differential equation the solution of which is beyond the scope of this wiki article. Since, \( f(1) = 0 \) ( Put \( m=n=1 \) in the given equation ) the function is \( \displaystyle \boxed{ f(x) = \text{ ln } x } \)

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 piece wise defined function is possible that \( f(a+0^+) , f(a + 0^-) \) and \( f(a) \) may be given be different formulas. Hence to evaluate the derivative we must evaluate the derivatives from both the sides and check whether they are equal or not.

So, using the terminologies as in the wiki, we can write,

\(\displaystyle \begin{array}{l l} 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{array} \)

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,

\(\displaystyle \begin{array}{l l} 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{array} \)

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 the first principle is also used to check the "differentiability " of a such a piece wise function, which is discussed in detail in another wiki article. 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/