Brain Dump

Derivatives

Tags
math

The gradient at a point on a curve is defined as the gradient of the tangent to the curve at that point. We define the gradient-function as the function that gives this gradient value. The process of finding the gradient of a function is called differentiation.

For a function \( f(x) \) we call the its derivative \( \frac{\delta f(x)}{\delta x} = f'(x) \).

Take for example an arbitrary 2D function with a curve \( y = f(x) \) and pick two points \( (x_i, f(x_i)) \) on it. We can find the average change in \( y \) with respect to \( x \) by solving the formula \( \frac{y_2 - y_1}{x_2 - x_1} \). This is the formula of the gradient between these two points. Now consider when \( x_1 = x_2 \), now there's no change in \( x \) (\( \Delta x = 0 \)) and therefore no change in \( y \) (\( \Delta{y} = 0 \)) either, however the curve almost certainly still has a tangent at this point. Finding the derivative of \( f(x) \) is the same as solving this formula for \( x_1, x_2 = x_1 + \Delta{x} \) where we slowly shrink \( \Delta{x} \) to 0.

Note: If we can differentiate a function to get its gradient function, we can then set that function equal to some gradient value we want to find and then solve for the roots of the resulting function to find the \( x \) values where we get the desired gradient.

Laws of Differentiation

Table 1: Listing of common functions and their derivatives. tbl:common-derivative-functions
Name\( f(x) \)\( \frac{\delta{f(x)}}{\delta x} \)
Constant\( c \)\( 0 \)
Line\( x \)\( 1 \)
\( ax \)\( a \)
Square\( x^2 \)\( 2x \)
\( ax^n \)\( anx^{n-1} \)
Square Root\( \sqrt{x} = x^{\frac{1}{2}} \)\( (\frac{1}{2})x^{\frac{1}{2}} \)
Exponential\( e^x \)\( e^x \)
\( a^x \)\( \ln(a) a^x \)
Logarithms\( \ln(x) \)\( \frac{1}{x} \)
\( \log_a(x) \)\( \frac{1}{x \ln(a)} \)
Trignonometry (x is radians)\( \sin(x) \)\( \cos(x) \)
\( \cos(x) \)\( - \sin(x) \)
\( \tan(x) \)\( \sec^{2}(x) \)
\( \sec(x) \)\( \sec(x)\tan(x) \)
\( \cosec(x) \)\( -\cosec(x)\cot(x) \)
\( \cot(x) \)\( - \cosec^2(x) \)
Inverse Trigonomoetry\( \sin^{-1}(x) \)\( \frac{1}{\sqrt{(1 - x^2)}} \)
\( \cos^{-1}(x) \)\( \frac{-1}{\sqrt{(1 - x^2)}} \)
\( \tan^{-1}(x) \)\( \frac{1}{(1 + x^2)} \)
\begin{figure}[ht]
  \centering
  \incfig{20210610180811}
  \caption{Demonstration of the cyclic nature of the trigonometric derivatives.}
\end{figure}
Table 2: Listing of common rules used for differentiation. tbl:derivative-rules
Common Rulesf(x)\( \frac{\delta{f(x)}}{\delta x} \)
Multiplication by Constant\( cf(x) \)\( cf'(x) \)
Power Rule\( x^n \)\( n x^{n-1} \)
Sum Rule\( f(x) + g(x) \)\( f'(x) + g'(x) \)
Difference Rule\( f(x) - g(x) \)\( f'(x) - g'(x) \)
Quotient Rule\( \frac{f(x)}{g(x)} \)\( \frac{f'(x)g(x) - g'(x)f(x)}{(g(x))^2} \)
Product Rule\( f(x)g(x) \)\( f(x)g'(x) + f'(x)g(x) \)
Reciprocal Rule\( \frac{1}{f(x)} \)\( \frac{-f'(x)}{f^2(x)} \)
Chain Rule\( f(x) \circ g(x) = f(g(x)) \)\( (f'(x) \circ g(x)) \times g'(x) = f'(g(x)) \times g'(x) \)
\( \frac{\delta y}{\delta x} = \frac{\delta y}{\delta u} \frac{\delta u}{\delta x} \)

Examples

This section contains some example derivations using tbl:derivative-rules and tbl:common-derivative-functions.

Product Rule

Consider the equation \( y = f(x) = x \cos x \), what is \( \frac{\,dy}{\,dx} \).

\begin{align*} u &= x & v &= \cos x \
\frac{\,du}{\,dx} &= 1 & \frac{\,dv}{dx} &= - \sin x \
\frac{\,dy}{\,dx} &= u \frac{\,dv}{\,dx} + v \frac{\,du}{\,dx} \\

                &= x(-\sin x) + 1 \cos x \\\\
                &= -x\sin x + \cos x

\end{align*}

For the product rule we simply multiply the diagonals of the first 2 equations shown above and then sum the result.

Quotient Rule

\begin{align*} u &= \cos x & v &= \sin x \
\frac{\,du}{\,dx} &= - \sin x & \frac{\,dv}{\,dx} &= \cos x \
\frac{\,dy}{\,dx} &= \frac{\frac{\,du}{\,dx} v - \frac{\,dv}{\,dx} u }{v^2} \\

                &= \frac{(- \sin x) (\sin x) - (\cos x)(\cos x)}{(\sin x)^2} \\\\
                &= \frac{- \sin^2 x - \cos^2 x}{\sin^2 x} \\\\
                &= - \frac{\sin^2 x + \cos^2 x}{\sin ^2x} \\\\
                &= - \frac{1}{\sin^2 x} \\\\
                &= - \cosec^2 x

\end{align*}