Calculus Review

slopeThis very brief summary is intended to re-familiarize you with basic calculus.  If your grasp of calculus is shaky, I recommend you purchase the Schaum Outline Introduction to Mathematical Economics (3rd ed.) by Edward Dowling (NY: Schaum Outline Series, McGraw-Hill) for a more throrough review.  Calculus is the most essential "power tool" of economics.  It provides the formal structure for virtually all of the economics you have learned so far: utility maximization, demand theory and welfare economics; profit maximization, cost minimization and production theory.

The slope of a function y = f(x)  is calculated as the change in y associated with a change in x, i.e. "the rise over the run."   The slope of the quadratic function diagrammed here is constantly changing as x changes.  Calculating a slope from two discrete points on this function will only approximate the true slope at any intermediate point.  The derivative function df(x)/dx expresses the true slope of f(x), i.e., its instantaneous rate of change, at any point x. 

If y = f(x) is a polynomial in x such as the cubic function f(x) = 30 + 25x - 4x2 + 0.15x3 then f(x) can be differentiated term by term, premultiplying each term by the exponent on x and subtracting one from each exponent. 
Rewriting f(x) as 30x0 + 25x1 - 4x2 + 0.15x3, the derivative or slope function of f(x) is calculated as:
df(x)/dx = f '(x) = 0×30x(0-1) + 1×25x(1-1) - 2×4x(2-1) + 3×0.15x(3-1)  = 25 - 8x + 0.45x2

derivatives If a function has local maximum or minimum points, its slope will equal zero at those points.  To determine the values of x that maximize or minimize f(x), take the derivative, set it equal to zero and solve for x. 

The range of the cubic (3rd-order polynomial) function f(x) in the graph here (shown in black)  is unbounded, but it has both a local maximum and a local minimum.  Its derivative is the quadratic (2nd-order polynomial) function (shown in red) which we set equal to zero: 25 - 8x + 0.45x2 = 0.
The roots of this quadratic (solved from the quadratic equation) are 4.0457 and 13.732.
These are the values of x that yield local maximum or minimum values for f(x).

To distinguish a maximum from a minimum, we need to take the second derivative of f(x) and evaluate it at these values of x.  The second derivative is simply the derivative of the first derivative:
if df(x)/dx = f '(x) = 25x0 - 8x1 + 0.45x2, then d2f(x)/dx2 = f ''(x) =  -8 + 0.90x (shown in blue).
If f(x) is at a maximum, its slope is decreasing from positive to negative, so the slope of the derivative will be negative.  If f(x) is at a minimum, its slope is increasing from negative to positive, so the slope of the derivative will be positive.

The graph shows that x = 4.0457 yields a local maximum for f(x), where f ' = 0 and f '' = -4.359.
The other solution x = 13.732 yields a local minimum for f(x), where f ' = 0 and f '' = +4.359.

For higher-order functions, if the second derivative evaluates to zero at the maximizing or minimizing value(s) of x, you have to evaluate higher-order derivatives to distinguish maxima, minima or inflection points.  For a polynomial such as f(x) = x4 the derivative f ' = 4x3 = 0 when x = 0.  But f '' = 12x2 = 0 when x = 0 also.  So we keep evaluating successive derivatives at x = 0 until we find one yielding something other than zero:  f ''' = 24x = 0, but f '''' = 24 > 0.  Since this non-zero derivative is an even-order (fourth) derivative, it implies that f(x) = x4 is minimized at x = 0.  For a polynomial such as f(x) = x3 , f ' = 3x2 = 0 and f '' = 6x = 0 when x = 0, but f ''' = 6 > 0.  Since this non-zero derivative is an odd-order (third) derivative, it implies that f(x) = x3 has an inflection point at x = 0. 

To determine the maximum or minimum point of a function of two variables, e.g., z = f(x,y) = -2x2 + 20x - xy + 5y - 3y2, we take partial derivatives with respect to each variable, treating the other variable as a constant, set these equal to zero and solve the system of equations, e.g., fx = -4x + 20 - y = 0 and fy = -x + 5 - 6y = 0 is solved by x = 5 and y = 0.  Since the four second parial derivatives fxx = -4, fxy = -1, fyx = -1 and fyy = -6 are all negative, this function is maximized in both x and y at this point, implying that this function has a hill shape.

The function z = f(x,y) = x2 - y2 has first partials fx = 2x and fy = -2y.  Setting these equal to zero yields the solution x = 0 and y = 0.  The four second partials are fxx = +2, fxy = 0, fyx = 0 and fyy = -2, implying that f(x,y) is minimized in the x-plane and maximized in the y-plane at this point, which means that this function is shaped like the saddle on a horse.

integralsWhere the derivative of a function f(x) expresses its slope, the integral of f(x) expresses the exact area between f(x) and the x-axis.   Calculating the areas under discrete arcs defined by points on the function will yield only approximate area measures. 

Integrating a function is the opposite of taking its derivative.   If f '(x) = g(x), then the integral of g(x) is f(x) + C where C is an arbitrary constant term that might have dropped out of f(x) during differentiation.   So integration recovers the original function from its slope function, except for its intercept term. 

If y = f(x) is a function such as 4x - x2, f(x) is integrated by multiplying each term by x, dividing each term by the resulting exponent of x, and adding an unknown constant C, e.g., F(x) = 2x2 - x3/3 + C.   This indefinite integral can evaluated for any value of x only up to this arbitrary constant.
 
A definite integral is evaluated for a bounded interval in x, e.g., between x = 1 and x = 2.  The definite integral for this example would be F(x=2) - F(x=1) = [8 - 8/3 + C] - [2 - 1/3 + C] = 3.667.  The unknown C cancels out.