\( \definecolor{colordef}{RGB}{249,49,84} \definecolor{colorprop}{RGB}{18,102,241} \)

Differential Calculus

Chain Rule

Many complex functions are created by composing simpler ones. A composite function has the form \(f(x) = v(u(x))\), where one function (the "inner" function, \(u\)) is the input to another (the "outer" function, \(v\)). For example, in the function \(f(x) = (x^2+1)^3\), the inner function is \(u(x)=x^2+1\) and the outer function is \(v(x)=x^3\).
The Chain Rule provides a powerful method for differentiating such functions by finding the derivatives of the inner and outer functions separately.
Proposition Chain Rule
If \(f(x)=v(u(x))\) then:$$ f'(x) = v'(u(x)) \cdot u'(x) $$In Leibniz notation, if \(y=v(u)\) then$$ \dfrac{dy}{dx} = \dfrac{dy}{du} \cdot \dfrac{du}{dx} $$
Example
Find the derivative of \(f(x) = (x^2+1)^3\).

  • Using prime notation:
    Let the outer function be \(v(x)=x^3\) and the inner function be \(u(x)=x^2+1\). We have \(f(x)=v(u(x))\). The derivatives are \(v'(x)=3x^2\) and \(u'(x)=2x\).$$\begin{aligned}f'(x) &= v'(u(x)) \cdot u'(x) \\ &= 3(u(x))^2 \cdot (2x) \\ &= 3(x^2+1)^2 \cdot (2x)\\ &= 6x(x^2+1)^2\end{aligned}$$
  • Using Leibniz's notation (\(y=f(x)\)):
    For \(y=u^3\) and \(u=x^2+1\), the derivatives are \(\frac{dy}{du}=3u^2\) and \(\frac{du}{dx}=2x\).$$\begin{aligned}\dfrac{dy}{dx} &= \dfrac{dy}{du} \cdot \dfrac{du}{dx} \\ &= (3u^2) \cdot (2x) \\ &= 3(x^2+1)^2 \cdot (2x)\\ & = 6x(x^2+1)^2\end{aligned}$$

Proposition Common Derivatives for Composite Functions
Let \(u\) be a differentiable function with derivative \(u'\), \(a\) and \(b\) be real numbers, and \(n\) be a natural number.
Function Derivative Function Derivative
\(a u\) \(a u'\) \(\sqrt{u}\) \(\dfrac{u'}{2\sqrt{u}}\)
\(u^2\) \(2u'u\) \(\cos(u)\) \(-u'\sin(u)\)
\(u^3\) \(3u'u^2\) \(\sin(u)\) \(u'\cos(u)\)
\(u^n\) \(n u' u^{n-1}\) \(e^u\) \(u' e^u\)
\(\dfrac{1}{u}\) \(-\dfrac{u'}{u^2}\) \(\dfrac{1}{u^n}\) \(-\dfrac{nu'}{u^{n+1}}\)

Second Derivative

Definition Second Derivative
The second derivative of \(f\), denoted \(f''\), is the derivative of the first derivative, \(f'\).$$ f''(x) = \dfrac{d}{dx}(f'(x)) \quad \text{ or in Leibniz notation, } \quad \dfrac{d^2 y}{dx^2}= \dfrac{d}{dx}\left(\dfrac{dy}{dx} \right) $$
Example
Find the second derivative of \(f(x)=x^4 - 5x^2\).

First, we find the first derivative:$$ f'(x) = 4x^3 - 10x $$Now, we differentiate again to find the second derivative:$$ f''(x) = \dfrac{d}{dx}(4x^3 - 10x) = 12x^2 - 10 $$

Concavity

We have seen that the first derivative, \(f'(x)\), gives the slope of the curve \(y=f(x)\) at any value of \(x\).
The second derivative, \(f''(x)\), tells us the rate of change of the slope. It therefore gives us information about the shape or curvature of the curve.
Definition Concavity
A function \(f\) is:
  • concave up on an interval if its graph bends upwards, like a cup .
  • concave down on an interval if its graph bends downwards, like a cap .
Proposition Second Derivative and Tangents
Let \(f\) be a function that is twice differentiable on an interval \(I\), with a second derivative \(f''\).If \(f''\) is positive on \(I\), then the graph of \(f\) lies above all of its tangents on \(I\).

Let \(x_0\) be any point in \(I\). The equation of the tangent to the curve of \(f\) at \(x_0\) is:$$ y = f'(x_0)(x - x_0) + f(x_0) $$Let \(\phi\) be the function defined on \(I\) by the difference between the function and its tangent:$$ \phi(x) = f(x) - [f'(x_0)(x - x_0) + f(x_0)] = f(x) - f'(x_0)x + f'(x_0)x_0 - f(x_0) $$\(\phi\) is differentiable on \(I\) as a sum of differentiable functions. Its derivative is:$$ \phi'(x) = f'(x) - f'(x_0) $$Since \(f''\) is positive, the first derivative \(f'\) is increasing on \(I\). Therefore:
  • if \(x \ge x_0\), then \(f'(x) \ge f'(x_0)\), so \(\phi'(x) \ge 0\).
  • if \(x \le x_0\), then \(f'(x) \le f'(x_0)\), so \(\phi'(x) \le 0\).
Furthermore, the value at \(x_0\) is \(\phi(x_0) = f(x_0) - f(x_0) = 0\). We obtain the following variation table:
Since the minimum of \(\phi\) is \(0\) at \(x = x_0\), we have \(\phi(x) \ge 0\) for all \(x \in I\).Thus, \(f(x) \ge f'(x_0)(x - x_0) + f(x_0)\), which means the curve is above its tangent.

Example
The curve \(f(x)=x^2\) is always concave up. The tangents lie below the curve.
Consider the curve below, which is concave down.
As we move along the curve from left to right, \(x\) increases, but the slope of the tangent decreases (from \(2\), to \(1\), to \(0\), to \(-1\), etc.).
This means that the derivative function, \(f'\), is a decreasing function. If \(f'\) is decreasing, then its own derivative satisfies \(f''(x)\leq 0\) (where defined).
Proposition Second Derivative Test for Concavity
For a function \(f\) that is twice differentiable on an interval \(I\):
  • \(f''(x) \ge 0\) for all \(x \in I\), if and only if \(f\) is concave up on \(I\).
  • \(f''(x) \le 0\) for all \(x \in I\), if and only if \(f\) is concave down on \(I\).
Example
Show that \(f(x)=\ln(x)\) is concave down on its domain.

The domain of \(f(x)=\ln(x)\) is \((0,+\infty)\).
We find the first and second derivatives:$$ f'(x)=\frac 1 x \quad \text{and} \quad f''(x)=-\frac{1}{x^2}. $$For all \(x\) in the domain, \(x^2 > 0\), which means \(-\dfrac{1}{x^2} < 0\).
Since \(f''(x) < 0\) for all \(x \in (0, +\infty)\), the function is concave down on its entire domain.

Points of Inflection

A point of inflection marks a subtle but important change in the behavior of a function. While the function may still be increasing or decreasing, the rate at which it does so changes from accelerating to decelerating, or vice versa.
Consider the total number of cases during the start of an epidemic. Initially, the number of new cases per day increases, meaning the curve of total cases is steepening (concave up). At some point, measures are taken and the number of new cases per day, while still positive, starts to decrease. The curve of total cases begins to flatten (concave down). The moment this transition occurs is the point of inflection. It is the point where the rate of growth is at its maximum.
Definition Point of Inflection
A point of inflection is a point on a curve where the concavity changes (from up to down, or from down to up). At this specific point, the tangent line crosses the curve.
\(\quad\)
Since concavity is determined by the sign of the second derivative \(f''(x)\), a point of inflection must occur where \(f''(x)\) changes sign. For this to happen, \(f''\) must be zero at that point.
Proposition Second Derivative Test for a Point of Inflection
A point \((a, f(a))\) is a point of inflection if \(f''(a)=0\) and the sign of \(f''(x)\) changes at \(x=a\).
Example
For \(f(x)=x^3\), find the coordinates of the point of inflection.

  1. Find the second derivative:
    \(f'(x) = 3x^2\) and \(f''(x) = 6x\).
  2. Find potential inflection points:$$\begin{aligned}f''(x) = 0 &\iff 6x = 0 \\ &\iff x = 0\end{aligned}$$
  3. Check for sign change in \(f''(x)\) at \(x=0\):
    The function \(f''(x) = 6x\) is linear with a positive slope; it is negative for \(x < 0\) and positive for \(x > 0\). Since \(f''\) vanishes and changes sign at \(x=0\), there is a point of inflection at \((0, f(0)) = (0,0)\).