CHAPTER 6
DIFFERENTIAL CALCULUS   

Many business and economic problem solving and decisions are based on the cost and benefit analysis or more specifically on the marginal cost and marginal benefit analysis.  For example, to maximize profit, a business in a perfectly competitive market sets marginal cost of the product equal to the price of the  product; a producer in a monopolistic market sets marginal cost equal to marginal revenue.  The concept of "marginal" in economics is nothing but the concept of the "derivative" in mathematics.  Marginal cost and marginal revenue are the derivatives of the total cost and the total revenue functions with respect to output. The mathematical concept of the derivative is also of extreme importance for optimizing problems. Maximizing revenue,  maximizing profit, or minimizing cost are examples of optimizing problems that can be solved using derivatives.  Differential calculus is the branch of mathematics which deals with the calculation of the derivatives of functions and with the application of these derivatives.  The derivative is the most fundamental concept studied in this chapter. However, the concepts of limit and continuity, which have direct bearing on differentiability and derivatives of the functions, will be studied first. 

TOOL BOX
Mathematica Commands		Function
Limit[f(x), x -> n]			Finds limit of f(x) as x approaches n
D [f(x), x]				Finds derivative of f(x) with respect to x
D [f(x), {x,  n}]				Finds the (n^th) order derivative of f(x) with respect to x
f '[x]					Finds derivative of f(x) if it is defined in "f[x_]: = " format
f ''[x]					Finds second derivative of f(x) if it is defined in "f[x_]: = " format
f '[n]					Finds derivative of f(x) and evaluates it at x = n
Dt[f(x, y), x]				Find total derivative of f(x, y) with respect to x

I.   Limit and Continuity: The Limit Command                     
Limit: Let the function f(x)  be defined on the set of real numbers and let  xo be a real number.  If f(x) approaches the real number L when x approaches xo,  we say that f(x) has the limit L at xo, and we write (Underscript[(f(x)), x -> (Subscript[x, o])]) → L, or (Underscript[(lim f (x)), x -> (Subscript[x, o])]) = L.   
   
Example:  Find the limit of f(x) = x2 + 1 as x approaches 3.  
Solution:  When x approaches  3, x2 + 1 approaches 10.  Thus, f(x) has the limit 10 at 3.  
The limit of a function f(x) as x approaches (Subscript[x, o]) can be found using Mathematica.  To find the limit of a function with Mathematica, use the command Limit[f(x), x -> n] as follows: 
\(Clear[x]

        Limit[x^2\  + \ 1, \ x\  -> \ 3]\)
10 Null

Example:  Find the limit of f(x) = ((x  +  1)/x) as x approaches 1 and ∞.  
Solution:  As x approaches 1, f(x)  approaches 2 and has the limit 2 at x = 1.  As x approaches an infinitely large number, ∞, f(x) is undefined.  However, if we write f(x) as f(x) = 1 + (1/x), as x -> ∞, (1/x) -> 0 and the limit of f(x) approaches 1.  
To solve the problem using Mathematica,
Clear[x]
Limit[(x + 1)/x, x -> 1]
2
Limit[(x + 1)/x, x -> Infinity]
1

Example: Find the limit of f(x) = ((4  x)/x) as x approaches 0.   
Solution:  Here, f(x) = 4 if x ≠ 0.  For x = 0, f(x) is not defined.  However, as x approaches zero, f(x) approaches the limit 4.
This example shows that, in many occasions the value of f(x) at xo has nothing to do with the limit of  f(x) as x approaches to xo.  f(x) may equal  L at xo, may be different from L at xo, or may be undefined at xo.  The next example reemphasizes this point.

Example:  Find the limit of f(x) = ((sin x)/x) as x approaches zero.  
Solution:  At x = 0, f(x) is not defined.  However, it can be shown (by direct substitution) that as x approaches zero, f(x) approaches  1.
To solve the problem using Mathematica,
Clear[x]
Limit[Sin[x]/x, x -> 0]
1

Right-Side Limit Left-Side Limit:  A function f(x) approaches a limit L as x approaches xo if and only if its right-side limit, denoted by (Underscript[lim f(x), x->(SuperPlus[xo])]), is equal to its left-side limit, denoted by (Underscript[lim f(x), x->(SuperMinus[xo])]) .  That is, whether x approach xo from the right side of xo (x values that are larger than xo), or the left side of xo ( x values that are smaller than xo),  f(xo) will be the same.  The following graph illustrates this point for f(x) = (x^2) + 2.  In the graph of y = f(x) = (x^2) + 2 below, the right- side limit equals to left-side limit at xo = 1 and the function has limit at this point.



However, for the function y = (x/(x - 1)), the right-side limit is different from the left-side limit at xo = 1.  As x  approaches xo = 1 from the x values of x < 1, f(x) approaches -∞.  As x approaches xo = 1 from the x values of x > xo,  f(x) approaches +∞.  Therefore, the function does not have limit at xo = 1.



The geometric interpretation of the limit, as presented by the two graphs above, are of great importance for the concept of continuity and differentiability which will be studied in the next sections.  

Example:  Sales of New Products  
Sales of new products are usually estimated using the function  y = c(e^((k/t))), where t is the number of years that the product has been in the market and c and k are unknown parameters.  Find c and k and express y as a function of t for a product that has sold 6000 units after 3 years and that the market saturation quantity for the product is 28000 units.  Graph the sales function and find how many units will be sold after ten years.
Solution:  The market saturation quantity is given to be 28000 units.  This implies that, as t->∞, y->28000.  In other words, the (Underscript[limy, t -> ∞]) = 28000.   To find the limit of y as t->∞, substitute for t in the equation of y.  Since (k/t)->0 as t->∞, (e^((k/t)))->1 and the limit of y as t->∞ is y = c.  This gives c = 28000.  Also, For t = 3, y = 6000, this gives 6000 = c(e^((k/3))).  By substituting for c and solving the latter equation for k, k = -4.62.  Therefore, the sales equation is y = 28000(e^(((-4.62)/t))).  To find the estimated sales after 10 years, set t = 10 in the equation to find y = 17640 units.  To graph the function, either find few points of the function by substituting values for t and finding the corresponding values of y and graphing them or by using the "Plot" command of the Mathematica.  The graph of the function is shown below.


The sales of new products, generally, have a standard "S" shaped curve.  The sales increases with increasing rate at the early years of introduction to market.  As time passes, sales increases with a decreasing rate, then it flattens out as the market saturates. 
To solve the problem using Mathematica, formulate the problem in Mathematica and solve the equations as follows,
\(Clear[y, \ c, \ k, \ t]

        \(y\  = \ c\ E^\((k/t)\);\)

        N[
          Solve[{Limit[y, \ t -> Infinity] == 28000, \ 
              6000 == c\ E^\((k/3)\)}, \ {c, \ k}]]\)
\(\(\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\({\((c -> 
              28000.`)\), \((k -> \(-4.6213351228414465`\))\)}\)\(}\)\)\)
the function is y = 28000(e^(((-4.62)/t))).  To graph the function, use the Plot command as,
Clear[y,  t]  
y = 28000  E^(-4.62/t);
 Plot[y,  {t,  1,  30},  
          AxesLabel -> {"t",  "Y"}]
To find the value of y at t = 10,
y /. t -> 10

Continuity:  A function f (x) is said to be continuous at x = xo if and only if f (xo) and the (Underscript[limf(x), x -> 
            (Subscript[x, o])]) exist and  (Underscript[limf(x), x -> 
            (Subscript[x, o])]) = f (xo).
Note that, in the discussion of limits, we are concerned only with the limiting values of f (x) as x approaches xo. That is, f (xo) may or may not exist, and (Underscript[limf(x), x -> 
            (Subscript[x, o])]) may or may not be equal to f (xo ).  For continuity, however, a function is said to be continuous if the three conditions below are satisfied:  
1- f (xo) exist
2- (Underscript[limf(x), x -> 
            (Subscript[x, o])]) exists.
3- (Underscript[limf(x), x -> 
            (Subscript[x, o])]) = f (xo)                                       
If the three conditions hold for all the values of x in the domain of function, the function is called everywhere continuous.  Otherwise, the function is called piecewise continuous.

Example: Verify continuity of f(x) = x2 + x + 1 at x = 1.
Solution:  Find f(1) and (Underscript[(limf(x)), x -> 1]).   f(1) = 3 and (Underscript[(limf(x)), x -> 1]) = 3.   Since both f(x) and (Underscript[(limf(x)), x -> 1]) exist and are equal to each other, the function satisfies all the three conditions for continuity and f(x) is continuous at x = 1.   The plot of the function, below, also shows the continuity at x = 1.


To check the conditions using Mathematica, use the following commands:
Clear[x]
f[x_] :=  x^2  +  x  +  1
f[1]
3
Limit[x^2  +  x  +  1,  x -> 1]
3
Plot[x^2  +  x  +  1,  {x,  0,  3},  
          AxesLabel -> {"X", "Y"}]

Example: Verify the continuity of f(x) = ((X + 1)/(X - 1)),  at x = 1.
Solution:  f(-1) does not exist and (Underscript[(Limf(x)), x -> 1]) = ∞.  Therefore, f(x) is not continuous at x = 1.  The plot of the function, below, also shows discontinuity at x = 1.


Using Mathematica, 
Clear[x]
f[x_] :=  (x + 1)/(x - 1)
f[1]
Limit[(x + 1)/(x - 1),  x  ->  1]
∞
Plot[(x + 1)/(x - 1),  {x,  0,  3},  
          AxesLabel -> {"X", "Y"}]
Note that, under the definition of continuity, functions that have kinks are continuous.  The next example shows the continuity of a kinked function.

Example:  Verify the continuity of  f (x) = |x -1| + 2 at x = 1.
Solution:  Find f(1) and (Underscript[(limf(x)), x -> 1]).  Since f(1) and (Underscript[(limf(x)), x -> 1]) exist and are equal to each other, f(x) is continuous at x = 1.  Note that, as x->1 from the x-values x < 1, the left-side limit exists and is equal to 2.  When x->1 from the x-values x > 1, the right-side limit exists and is equal to 2.  Since the right-side limit equals to the left-side limit, f(x) has a limit as x->1 and the limit is equal to 2.   Also f(1) = 2.  Therefore, the function is continuous at x = 1.  The following graph shows the graph of the function and confirms its continuity, even though the function is a kinked function.


You may use Mathematica to test for continuity of the function and plot the function.
Clear[x]
Plot[Abs[x - 1]  + 2, {x, -10, 10}]
\(f[x_] := Abs[x - 1] + 2

        f[1]\)
Limit[Abs[x - 1] + 2,  x  ->  1]
Plot[Abs[x - 1] + 2 , {x,  0,  2},  
          AxesLabel -> {"X", "Y"}]

Example:  Verify the continuity of y = f(x) = {({{2      if x ≤ 0}, {(x^2)      if x  >  0}})  at (Subscript[x, o]) = 0.
Solution:  The graph of the function, below, shows that as x approaches zero from the left side, Lim\(TraditionalForm\`\(f(x)\)\+\(x -> \(0\^-\)\)\)= 2.  However, as x approaches zero from the right side, Lim\(TraditionalForm\`\(f(x)\)\+\(x -> \(0\^+\)\)\) -> 0.  Since the left-side limit is not equal to the right-side limit as x approaches zero the function is not continuous at x = 0.



Problems
1.   Find the limit of the following sequence of numbers
        a)  1, 2, 3, 4, .............
        b)  10, 9, 8, 7, ............
        c)  (1/2), (2/3), (3/4), (4/5), .....                                            
        d)  (1/2), (1/3), (1/4), (1/5), .....
2.   For an economy with an aggregate consumption function of C = 500 + 0.7Y, the effect of a one dollar increase in autonomous spending can be listed as:
({{Time, 1, 2, 3, 4, ., ., .}, {Incease in Income, 1, 0.7, (0.7^2), (0.7^3), ., ., .}}) 
        a)  What is the effect on income as t → ∞ ?
         b) What is the total effect on income?
3.   Find the limit of the following functions as x approaches the given values.
        a) (Underscript[(limf(x)), x -> 1]) = (x^2) - 1
        b) (Underscript[(limf(x)), x -> -2]) = ((2  x  +  4)/(2  x  -  4))
        c)  (Underscript[(limf(x)), x -> 3]) = ((x  +  3)/(x  -  3))
        d)  (Underscript[(limf(x)), x -> 1]) = x(1 + x)
         e) (Underscript[(limf(x)), x -> 1]) = \(TraditionalForm\`\(\(x\^3\)\(\ \)\(-\)\(\ \)\(1\)\(\ \)\)\/\(x\  - \ 1\)\)
         f) (Underscript[(limf(x)), x -> 0]) = ((Cos x)/Sinx)
 4.  Verify the continuity of the following functions at the given  points.
       a)  f(x) = x + 3; 		x = 1
       b)  f(x) = x2 - 1; 		x = 1                 
       c)  f(x) = (1/x)1/x; 		x = 0
       d)  f(x) = (1/(((x  -  1))^2)); 		x = 1
       e)  f(x) = ((1  -  x)/(1  +  x)); 		x = 1                       
       f)  f(x) =  |x - 3| + 1;	x = 3
       g)  f(x) = |x -2|;		x = 2
       h)  f(x) = {({{\(2\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ x ≤ 0\)}, {(x^2) + 2       if x > 0}});       x = 0
       i)   f(x) = {({{ 1 - 
                          x        if x<1 }, {-1 + x      if x ≥ 1}});       x = 1
       j)   f(x) = {({{(x^2) + 1     if x ≤ 1}, {   1              if x >  
                        1}});        x = 1

II. Derivatives and Differentiability:  The D [f(x), x] Command                     
Derivative of a Function: The derivative is the most fundamental concept in differential calculus.  It is concerned with the instantaneous rate of change of a function f(x) with respect to x at a point, say xo.  Let the function   f   given by y =  f (x)  be continuous in the open interval a < x < b which contains the point xo.  If we represent a small increment in xo by △x and the corresponding increment in y by △y, △y =  f(xo + △x) -  f (xo), the following quotient, \(TraditionalForm\`\(\(△y\)\(\ \)\)\/△x\) = ((f(xo + △x) - f(xo))/(△x)) is called a difference quotient.  The difference quotient shows the average rate of change of  f (x) with respect to x, over the interval △x.  Regardless of how small we make △x, we can not use the difference quotient to compute the instantaneous rate of change of y with respect to x at the point xo.  The difficulty is that at xo, we have no interval (△x) over which we could take an average.  However, if \(TraditionalForm\`\(\(△y\)\(\ \)\)\/△x\) approaches a limit as △x approaches zero, it is reasonable to define the instantaneous rate of change of y with respect to x at x = xo as the limit of the difference quotient.   Therefore, the instantaneous rate of change of y with respect to x  at x = xo, which may be denoted by  f  '(xo), is defined as,

 f '(xo)  = (Underscript[lim., Δx -> 0])Δ(y/Δ)x =  (Underscript[lim., Δx -> 0])((f(xo + △x) - f(xo))/(△x))

The expression  f  '(xo) is called the derivative of  f (x) with respect to x at x = xo.  If the  (Underscript[lim., Δx -> 0])Δ(y/Δ)x exists at this point, we say that f(x) is differentiable at xo or has a derivative at xo. 

Example:  Find the derivative of y =  f  (x) = x2 + 2x at x = 2.
Solution :  The difference quotient of the function is Δ(y/Δ)x=((f(xo + △x) - f(xo))/(△x)) = \(TraditionalForm\`\(\((2\  + \ Δx)\)\^2 + \ 2 \((2 + \ Δx)\)\  - \ 8\)\/Δx\)= \(TraditionalForm\`\(Δx(Δx\  + \ 6)\)\/Δx\)= Δx + 6.  The limit of the difference quotient (at xo = 2) as Δx->0 is  f  ' = (Underscript[lim., Δx -> 0])Δ(y/Δ)x = 6.  
To follow the steps using Mathematica, define the function, then find the limit of the difference quotient as Δx->0.
Clear[x]
f[x_] :=  x^2  +  2  x 
Limit[(f[2 + △x]  -  
                  f[2])/△x,  △x  -> 
              0]

6

Example:  Find  f  '(3) for the function   f   defined by  y =  f  (x) = (1/x).
Solution:  Find the limit of the difference quotient Δ(y/Δ)x= \(TraditionalForm\`\(f(3\  + \ △x)\  - \ f(3)\)\/△x\) as Δx->0.   The difference quotient is, Δ(y/Δ)x= \(TraditionalForm\`\(1\/\(3 + Δx\)\  - \ 1\/3\)\/Δx\)= \(TraditionalForm\`\(\(-Δx\)\/\(3 \((3 + Δx)\)\)\)\/Δx\) = ((-1)/(3 (3 + Δx))).   At xo = 3, (Underscript[lim., Δx -> 0])Δ(y/Δ)x =  f  '(3) = ((-1)/9).   
Using Mathematica,
Clear[x]
f[x_] :=  1/x
Limit[(f[3 + △x]  -  
                  f[3])/△x,  △x  -> 
              0]

-(1/9)
The instantaneous rate of change expression,  f  '(xo) above, may be defined for the set of points at which  f  is differentiable, rather than the point x = xo.  Such a function may be denoted by y',  f '(y), (dy/dx), or  f'x and is defined as, y' = f '(x) = (dy/dx) = f'x  = (Underscript[lim., dx -> 0])(dy/dx) = (Underscript[lim., dx -> 0]) ((f(x   +   dx)  -  f(x))/dx).

Example:  Find the derivative of  y = f (x) = 3(x^2) - 2x + 5.
Solution:  y' = f '(x) = (Underscript[lim., dx -> 0]) ((f(x   +   dx)  -  f(x))/dx)= (Underscript[lim., dx -> 0]) \(TraditionalForm\`\(3 \((x\  + \ dx)\)\^2\  - \ 2 \((x\  + \ dx)\)\  + \ 5\  - \ \((3  x\^2\  - 2  x\  + \ 5)\)\)\/dx\) = (Underscript[lim., dx -> 0]) ((dx(3  dx  +  6  x  -  2))/dx)= 6x - 2.  
Using Mathematica, The solution is derived as, 
\(Clear[x]

        f[x_] := \ 3  x^2 - 2  x + 5

        Limit[\((f[x + dx] - f[x])\)/dx, \ dx -> 0]\)
(Null^2) (-2 + 6 x)

Example:  Find the derivative of y =  f (x) = (1/(1  -  (x^2))).
Solution:   y' = f '(x) = (Underscript[lim., dx -> 0]) ((f(x   +   dx)  -  f(x))/dx)= (Underscript[lim., dx -> 0])= \(TraditionalForm\`\(1\/\(1\  - \ \((x\  + \ dx)\)\^2\) - 1\/\(1 - x\^2\)\)\/dx\) =  (Underscript[lim., dx -> 0]) \(TraditionalForm\`\(\(1\  - \ x\^2 - 1\  + \ \((x\  + \ dx)\)\^2\)\/\(\((1\  - \ x\^2)\) \((1\  - \ \((x\  + \ dx)\)\^2)\)\)\)\/dx\)= (Underscript[lim., dx -> 0]) \(TraditionalForm\`\(\(dx(2  x\  + \ dx)\)\/\(\((1\  - \ x\^2)\) \((1\  - \ \((x\  + \ dx)\)\^2)\)\)\)\/dx\) = ((2  x)/(((1  -  (x^2)))^2)).  
Using Mathematica,
Clear[x]
f[x_] := 1/(1 - x^2)
Limit[(f[x + dx] - f[x])/dx, dx -> 0]
((2 x)/(((-1 + (x^2)))^2))

Example:  Average Cost and Marginal Cost:
The total cost of producing q units of a product is given as TC = 4500 + 9q + .06(q^2).  Find the average rate of change of TC with respect to q when the output level is changed from: (i) 100 to 110 units, (ii) from 100 to 105 units.  Find the instantaneous rate of change of TC with respect to q when q = 100. (Note:  the instantaneous rate of change of TC with respect to q at qo, or the derivative of TC with respect to q at qo, is the same as the marginal cost at qo)
Solution:   The average rate of change is found using the difference quotient formula.  When q changes from 100 to 110 units, Δq = 10 units. Therefore, we can write:
 Δ(TC/Δ)q= \(TraditionalForm\`\(f(100\  + \ △q)\  - \ f(100)\)\/△q\)= \(TraditionalForm\`\(4500\  + \ 9 \((100\  + \ Δq)\)\  + \  .06 \((100\  + \ Δq)\)\^2\  - \ 6000\)\/Δq\)= \(TraditionalForm\`\(Δq(21\  + \  .06  Δq)\)\/Δq\)= 21 + .06Δq
 for Δq = 10,  Δ(TC/Δ)q = 21.6.  For a change in q from 100 units to 105 units Δq = 5 and Δ(TC/Δ)q = 21.3.  To find the instantaneous rate of change of TC with respect to q, find TC ' (100) as follows:
 TC '(100) = (dTC/dq) = (Underscript[lim., dq -> 0])((f(100   +   dq)  -  f(100))/dq) = (Underscript[lim., dq -> 0])\(TraditionalForm\`\(4500\  + \ 9 \((100\  + \ dq)\)\  + \  .06 \((100\  + \ dq)\)\^2\  - \ 6000\)\/dq\)= (Underscript[lim., dq -> 0]) ((dq(21  +   .06  dq))/dq) = 21.
 You may formulate the average rate of change and the instantaneous rate of change into Mathematica and do the calculations using Mathematica.  To find the average rate of change using Mathematica, 
Clear[TC,  q,  △q]

        f[q_] := 400 + 9  q +  .06  q^2

        Limit[(f[100 + △q] - 
                f[100])/△q, △q -> 
            10]
(70/40325967)
Limit[(f[100 + △q] - 
                f[100])/△q, △q -> 
            5]
(205/110228976)
To find the instantaneous rate of change using Mathematica, 
Limit[(f[100 + △q] - 
                f[100])/△q, △q -> 
            0]
(200/99980001)

Do More Practice:
1- Find the average rate of change of TC with respect to q as q changes from 100 to 102.
2- Find the average rate of change of TC with respect to q as q changes from 100 to 101.
3- What is the relationship between the average rate of change and the instantaneous rate of change in TC as Δq approach to zero. 
 
 Differentiability:  A function  f  is differentiable at x = xo if  f  '(xo) exists. The function  f   is differentiable in an open interval (a, b) if it is differentiable at every point in that interval.  

Continuity and differentiability are two desirable properties of functions.  If a function   f  is differentiable at xo, then   f  is continuous at xo.  However, continuity does not imply differentiability.  That is, a function  f  may be continuous at point xo, but not differentiable at that point.  What makes a continuous function not differentiable at a point is the existence of a corner point or kink at that point.

Example:  Prove that  f (x) = |x| is continuous at x = 0 but is not differentiable at this point.
Solution:   f (x) is continuous at x = xo if  f( xo) exists and (Underscript[lim f (x), x -> (Subscript[x, o])]) =  f (xo).   The function  f (x) = |x| is continuous at x = 0 because (Underscript[Lim f (x), \(\(x\)\( -> \_\(0\^-\)\)\)]) = \(TraditionalForm\`\(Lim\ \(f(x)\)\)\+\(x -> \(0\^+\)\)\) =  f (0).  However, the function is not differentiable at x = 0.  This is because  f  (x) = |x| has a kink at x = 0.  For x > 0,  |x| = x.  If we choose Δx a positive number (right-side of x = 0) we have: 
		f ' (x) = (Underscript[(lim ), Δx -> 0])\(TraditionalForm\`\(\(|\)\(x\  + \ △x\)\(|\)\(\ \)\(-\ \(\(|\)\(x\)\(|\)\)\)\)\/△x\)=  (Underscript[(lim ), Δx -> 0])\(TraditionalForm\`\(\((x\  + \ △x)\)\  - \ x\)\/△x\) = (Underscript[(lim ), Δx -> 0]) Δ(x/Δ)x= 1
This implies that |x| is differentiable for any x > 0.  Similarly, for x < 0, |x| = -x and Δx can be chosen such that |x + Δx| = - (x + Δx).  Therefore, for x < 0 we have:
		f ' (x) = (Underscript[(lim ), Δx -> 0])\(TraditionalForm\`\(\(|\)\(x\  + \ △x\)\(|\)\(\ \)\(-\ \(\(|\)\(x\)\(|\)\)\)\)\/△x\)= (Underscript[(lim ), Δx -> 0])\(TraditionalForm\`\(\(-\((x\  + \ △x)\)\)\  - \ \((\(-x\))\)\)\/△x\) = (Underscript[(lim ), Δx -> 0]) ((-Δx)/Δ)x= -1
This implies that |x| is differentiable for any x < 0.  For x = 0, we have:
		f ' (0) = (Underscript[(lim ), Δx -> 0])\(TraditionalForm\`\(f(0\  + \ △x)\  - \ f(0)\)\/△x\)= (Underscript[(lim ), Δx -> 0])\(TraditionalForm\`\(\(|\)\(\ \)\(0\  + \ △x\)\(|\)\(\ \)\(-\ \(\(|\)\(\ \)\(0\)\(|\)\)\)\)\/△x\) = (Underscript[(lim ), Δx -> 0]) \(TraditionalForm\`\(\(|\)\(Δx\)\(|\)\)\/Δx\)
f ' (0) =  (Underscript[(lim ), Δx -> 0]) \(TraditionalForm\`\(\(|\)\(Δx\)\(|\)\)\/Δx\) does not yield a single value.  The right-side limit of  f ' (0) =   \(TraditionalForm\`\(\(lim\)\(\ \)\)\+\(Δx -> \(0\^+\)\)\) \(TraditionalForm\`\(\(|\)\(Δx\)\(|\)\)\/Δx\)= Δ(x/Δ)x = +1.   The let-side limit of  f ' (0) =   \(TraditionalForm\`\(\(lim\)\(\ \)\)\+\(Δx -> \(0\^-\)\)\) \(TraditionalForm\`\(\(|\)\(Δx\)\(|\)\)\/Δx\)= ((-Δx)/Δ)x = -1.  Since the right-side limit is different from the left-side limit,  f ' (0) does not exits and  f  (x) = |x| is not differentiable at x = 0.  
This can be observed through the graph of  f  (x) = |x| below.  The function  f  is continuous at x = 0 but it has a kink at this point.


Similarly, the graph of f ''(x) = {({{-1     if x < 0}, {+1     if x > 0}}) is shown below.  As the graph shows Lim\(TraditionalForm\`\(f(x)\)\+\(x -> \(0\^-\)\)\) ≠  Lim\(TraditionalForm\`\(f(x)\)\+\(x -> \(0\^+\)\)\), thus f '(0) does not exist.



Differentiation Formulas:  The basic method of finding the derivative of a function is to apply the definition of derivative. However, learning the following formulas enables us to compute derivatives much more rapidly.   The proof of the formulas are not given here.  Students are required to practice deriving at least the first three formulas using the definition of the derivative.

In Mathematica, the command to find the derivatives of f(x) with respect to x is D [f(x), x]. 

Formula 1-  If y = f(x) = c  (constant),  y' = 0.

Example: Find y' if y = 10.
Solution:  Since y equals a constant number, y' = 0.  Using Mathematica, the solution is,
Clear[x]
D[10,  x]
0

Formula 2-  If y = f(x) = cxm,   y' = cmxm-1.

Example:  Find derivative of  y = 10x3.
Solution:  The solution is 30(x^2).  Using Mathematica, the solution is,
Clear[x]
D[10  x^3,  x]
30 (x^2)

Formula 3-  Let u be a differentiable function of x and y = (u^m), then y '=((d((u^m)))/dx)  = mu'(u^(m - 1)), where u' = (du/dx).

Example:  Find y', if y = f(x) = (4x3 + 3x + 1)5.
Solution:  Let u = 4x3 + 3x + 1, then (du/(dx )) = 12x2 + 3 and  y = u5 .  Therefore, y ' = (dy/dx) = 5(12x2 + 3)(4x3 + 3x + 1)4 .  Using Mathematica, the solution is,
Clear[x]
D[(4  x^3  +  3  x  +  1)^5, x]
5 (3 + 12 (x^2)) (((1 + 3 x + 4 (x^3)))^4)

Formula 4-  If u and v are differentiable functions of x and y = u.v, then y ' = ((d(uv))/dx) = u'v + v'u,  where u' = (du/dx) and v' = (dv/dx). 

Example:  Find y ' if y = f(x) = (5x3 + 5x2 + 1)(3x3 + 2x -1).
Solution:  Let u = (5x3 + 5x2 + 1) and v = (3x3 + 2x -1).  Hence, y = u.v, u' = (du/dx) = 15x2 + 10x, v' = (dv/dx) = 9x2 + 2, and
y'= (dy/dx) = (15x2 + 10x)(5x3 + 5x2 + 1) + (9x2 + 2)(3x3 + 2x- 1).  Using Mathematica, the solution is,
Clear[x]
D[(5  x^3  +  5  x^2  +  1) (3  x^3  +  2  x  - 
                1), x]
(10 x + 15 (x^2)) (-1 + 2 x + 3 (x^3)) + (2 + 
              9 (x^2)) (1 + 5 (x^2) + 5 (x^3))

Formula 5- If u and v are differentiable functions of x and y = (u/v), then y ' = ((d((u/v)))/dx)= ((u' v  -  v' u)/(v^2)), where u' = (du/dx) and v' = (dv/dx).

Example:  If y = f(x) = ((5  (x^2)  +  3)/((x^3)  - 1)), find (dy/dx).
Solution:  Let u = 5x2 + 3 and v = x3 -1.  Therefore, y = (u/v),  u' = 10x,  v' = 3x2, and (dy/dx) = \(TraditionalForm\`\(5  x\^4\  + \ 9  x\^2\  + \ 10  x\)\/\((x\^3\  - 1)\)\^2\).  Using Mathematica, the solution is,
Clear[x]
D[(5  x^2  +  3)/(x^3  -  1),  x]
\(\(-\(\(3\ x\^2\ \((3 + 
                    
                    5\ x\^2)\)\)\/\((\(-1\) + x\^3)\)\^2\)\) + \(10\ x\)\/\(\(-1\) + x\^3\)\)

Formula 6-  If u is a differentiable function of x and y = lnu, then y ' = (dy/dx) = \(u'\/u\), where u' = (du/dx).

Example:  If y = f(x) = 10 + ln(x3 - 1),  find y'. 
Solution:  Let u = x3 - 1.  Hence, u' = 3x2 ,  y = f(x) = 10 + lnu, and  y ' = (dy/dx) = ((u')/u) = ((3  (x^2))/((x^3)  -  1)).  Using Mathematica, the solution is,
Clear[x]
D[Log[E,  x^3  -  1]  +  10, x]
((3 (x^2))/(-1 + (x^3)))
Note:  If the logarithm has a base other than e, first transform it to a natural logarithm, then  differentiate.  To transform a log to natural log, note that (Subscript[log, b]^x) = (Subscript[log, e]^x) (Subscript[log, b]^e).

Example:  If y = f(x) = (Subscript[log, 2]^((x^2))), find y'.
Solution:  First transform the log to the base e.  That is,  y =(Subscript[log, e]^((x^2)))(Subscript[log, 2]^e).  Now the derivative is, y' = (dy/dx) = (2/x) (Subscript[log, 2]^e) = (2/x)(Subscript[log, 2]^e).  Using Mathematica, the solution is,
Clear[x]
D[Log[2, x^2], x]
(2/(x Log[2]))

Formula 7-  If u is a differentiable function of x and y = eu, then y' = u'eu, where u' = (du/dx).  

Example:  If  y = f(x) = (e^((x^2))), find y'.
Solution:  Let u = x2 .  Therefore, y = eu and y' = (dy/dx) = u' (e^u) where u' = 2x.  Using Mathematica, the solution is,
Clear[x]
D[E^(x^2), x]
2 (e^((x^2))) x

Derivative and Slope of a Function:  For a linear function  y = mx + c, the slope of the line (m) represents its steepness.  For the two arbitrary points,  P((Subscript[x, 1]), (Subscript[y, 1])) and Q((Subscript[x, 2]), (Subscript[y, 2])) on a line segment, the slope of the line represents the ratio of rise to run (Δ(y/Δ)x) and is measured by  m = tan ⊖ = ((y2  -  y1)/(x2 - 
              x1))=  \(TraditionalForm\`\(\(△y\)\(\ \)\)\/△x\) , where ⊖ is the angle between the line and the x-axis.  Obviously for the equation of a line, the slope m is the same everywhere along the line.  However, for a non-linear function, y = f(x), the slope of the curve at a point P(xo, yo), denoted by mp, is the slope of the tangent to the curve at that point.  In other words, the slope of  f(x) at a point x = (Subscript[x, o]) is the instantaneous rate of change of the function at this point or f ' ((Subscript[x, o])) = (Underscript[(lim ), Δx -> 0]) Δ(y/Δ)x.   Therefore, to find the slope of a function at a given point, find the derivative of the function and evaluate it at that point.

Example:  Find the slope of y = f(x) = (x^2)+ x - 5 at x = 2.
Solution:  The slope of the function at x = 2 is f '(2).  The derivative of the function is f '(x) = 2x + 1.  Evaluated at x = 2, f '(2) = 5.  
Using Mathematica,  The slope of the function at x = 2 is calculated as,
Clear[x]
D[x^2 + x - 5, x] /. x -> 2
5

Example:  Demand Function 
Demand for a product is given as Q = (100/(P^(. 8))).  Find the slope of the demand function at P = 12.
Solution:  Find the derivative of Q with respect to P and evaluate it at P = 12.  The derivative is Q' = (dQ/(dP )) = - (80/(P^1.8)).  Evaluated at P = 12, (dQ/dP) = -. 91.  (Note:  Conventional market theory assumes P as the vertical axis and Q as the horizontal axis for demand and supply functions.  With this assumption, the slope of the demand curve would be (dP/dQ) = ((-1)/(. 91)).)  
To solve the problem using Mathematica,
Clear[Q, p]
Q = 100/p^( .8);
slope =  D[Q,  p] /. p -> 12
-0.9131954608429032`

Example: Price Elasticity of Demand
Demand for a product is given as Q = (100/(P^2)).  Find the price elasticity of demand at P = 2.
Solution:  At P = 2, Q = 25.  The price elasticity of demand is defined as (Subscript[ϵ, p]) = (dQ/dP).(P/Q) where, (dQ/dP) is the slope of the demand curve or derivative of Q with respect to P.  Therefore, find (dQ/dP) and evaluate it at P = 2 then multiply it by (P/Q).
Clear[Q, p]
Q  =  100/(p^2);
D[Q,  p]*(p/Q) /. p -> 2
-2

Example:  Production Function and Marginal product of Labor
For a single-input production function, Q = 100(L^(. 8)) find marginal product of labor.  
Solution: Marginal product of labor (MPL) is the derivative of output with respect to labor, (dQ/dL).  Therefore, MPL is (dQ/dL)= 80(L^(- .2)).
Using Mathematica,
Clear[Q,  L]
Q  =  100 (L^ .8);
D[Q, L]
\(80.`\/L\^0.19999999999999996`\)

Example:  Perfectly Competitive market
The long-run cost function of a firm in a perfectly competitive market is given as  TC = 26Q - 3.5Q2 + (1/3)Q3.  Find the long-run equilibrium output and price.
Solution: In a perfectly competitive market profit maximizing quantity is decided by setting marginal cost (MC) equal to price (P).   Also, in the long-run equilibrium, prices are expected to fall to the lowest point of average total cost (ATC), where only a normal profit is left for the businesses.  Since the marginal cost curve always passes through the minimum average cost point (see the graphs below), in the long-run, P = MC = ATC.  Therefore, find the long-run equilibrium quantity and price by setting MC = ATC and solving the resulting equation.  MC is the derivative of TC with respect to Q, MC = 26 -7Q + (Q^2) and ATC = (TC/Q) = 26 - 3.5Q + (1/3)(Q^2).  Set MC = ATC and solve for Q.  This yields Q = 5.25.  Since at any optimum solution P = MC, evaluate MC at Q = 5.25 to find P = 16.81.


To solve the problem using Mathematica,
Clear[Q,  tc,  atc,  mc, sol]
tc  =  26  Q  -  3.5  Q^2  +  (1/3) Q^3;
atc  =  tc/Q;
mc  =  D[tc,  Q];
sol = N[Solve[mc  ==  atc,  Q]]
{{Q -> 0.`}, {Q -> 5.25`}}
mc/. sol

{26.`, 16.8125`}
The long-run equilibrium price is P = 16.81 with a quantity of  Q = 5.25.  To see the graphs of ATC and MC, plot them together as follows
atcplot = 
            Plot[atc,  {Q,  0.5,  30}, PlotLabel -> "ATC",  
              AxesLabel -> {"Q",  "$"}];
mcplot=Plot[mc,  {Q,  0,  15},  
                PlotLabel -> "MC",  
                AxesLabel -> {"Q",  "$"}]; 
Show[mcplot,  atcplot]



⁃  Graphics  ⁃

Problems
1  For the following functions find  the average rate of change of f(x) with respect to x for the given change in x from (Subscript[x, 1]) to (Subscript[x, 2]).
        a)   f(x) = 5;                       (Subscript[x, 1]) = 10,  (Subscript[x, 2]) = 15
        b)   f(x) = 2x + 3;               (Subscript[x, 1]) = 4,    (Subscript[x, 2]) = 6
        c)   f(x) = x2 - 4x + 5;         (Subscript[x, 1]) = 4,    (Subscript[x, 2]) = 8
        d)   f(x) = (6/x);                     (Subscript[x, 1]) = 3,    (Subscript[x, 2]) = 5 
        e)   f(x) = (8/(2  x  -  1))   ;           (Subscript[x, 1]) = 0,    (Subscript[x, 2]) = 1
        f)   f(x) = (3/((x^2)  -  x  +  1));           (Subscript[x, 1]) = 1,    (Subscript[x, 2]) = 3
2   For the functions (a) - (f) of the problem 1find  the instantaneous rate of change of the function at the corresponding (Subscript[x, 1])values.
3.  Find the derivative of the following functions:
       a)  y = f(x) = x3 + 4x2 - 2x + 8
       b)  y = f(x) = (x4 + 3x3 - 5x)5
       c)  y = f(x) = (((((x^3)  -  1))^4)/(x^2))
       d)  y = f(x) = (Sqrt[(x^3)  +  2  x])
       e)  y = f(x) = ln(x3 + x)2
       f)  y = f(x) = ln((10/x))
       g)  y = f(x) = log10(x2 - 1)
       h)  y = f(x) = e10x
       i)  y = f(x) = 105x   
 4.  Find the slope of the following functions at the given  points.  
        a)  y = f(x) = 2x + 10;        	P(1, 12)
        b)  y = f(x) = x3 - 3x + 2;    	P(1, 0)
        c)  y = ((1  +  x)/(1  -  x));       			P(0, 1)
        d)  y = e2x;                		P(0, 1)
        e)  y = (x/((x^2)  +  1));       			P(-1, -(1/2))
        f)  y = log x;	           	 	P(10, 1)          
5.  Market demand and supply for a perfectly  competitive industry is given as Qd = 7000 - 80P,  Qs = 3000 + 120P.  A firm in this market has the following  total cost (TC) function TC = 10 + 26q - 3.5q2 + (1/3)q3 .
a- What is the equilibrium price and quantity in this market?
b- Find the profit maximizing level of the output for the firm. What is the total profit? (Hint:  For a firm in a perfectly competitive market the profit-maximizing quantity is decided by setting marginal cost (MC) equal to market price)
c-  Is this firm in its long-run equilibrium?  
6-  Suppose the market in question 5 above is monopolized with a monopolist that produces the same good with a total cost of, TC = 1685000 + 22.239q - (Q^2) + .0003(Q^3).  
a- What will be the level of output in the market? (Hint:  A monopolist profit-maximizing quantity is decided by setting marginal cost (MC) equal to marginal revenue (MR))
f- At what price will the monopolist sell the product?
g- What will be the profit of the monopolist?
7.  Find price elasticity of demand for the following demand functions. (Hint: Price elasticity of demand, (Subscript[ϵ, p]), is defined as (Subscript[ϵ, p]) = (dq/dp).(p/q)). 
       a) q = 100 - p2
       b) q = (100/(P^3))
8.   A monopolist sells its product in two different markets, A and B, with differing price elasticities of demand, (Subscript[ϵ, A]) and (Subscript[ϵ, B]). Prove that the profit maximizing condition requires that:  ((Subscript[P, A])/(Subscript[P, B])) = \(TraditionalForm\`\(1\  - \ 1\/\( ∈ \_B\)\)\/\(1\  - \ 1\/\( ∈ \_A\)\)\) where,  (Subscript[P, A]) and (Subscript[P, B]) are market prices at A and B.
9.  Prove that if demand for a product is elastic, an increase in price will decrease total revenue of the sellers and a decrease in price will increase total revenue.
10.  Solve problem 7 replacing consumer spending for total revenue.
11.  Total output of a firm as the function of labor input is given as Q = 100 + 20L + 10(L^2) - .2(L^3).  Find the average rate of change of Q with respect to L as L changes from: (i)  20 to 30, (ii) 20 to 25.  Find the instantaneous rate of change of Q with respect to L at L = 20.
12.  The following relation,  C = a + blnY,  a representation of  the Engel curve, shows the relationship between the expenditure (C), and income (Y) of a consumer.  Find the income elasticity. (Note:Income elasticity of demand is defined as  (Subscript[∈ , Y]) = (dC/dY). (Y/C).
13.  Let's assume that a researcher estimates the Engel curve of the problem 11 using an equation of the form lnC = a + blnY.   What will be the income elasticity in this case.
14.  Find the short-run labor elasticity of output for the following production function,  Q = 100\(TraditionalForm\`L\^ .75\)\(TraditionalForm\`K\^ .25\), assuming that K = 2401 units. (Note:  Elasticity of output with respect to labor input is defined as (Subscript[ϵ, L])  = (dQ/dL).(L/Q).

III. Higher Order Derivatives:  The D [f(x), {x, n}] Command
If  f  is a differentiable function, then its derivative  f '  is also a function that may have a derivative.  Given y = f(x), (dy/dx) defines the first derivative of y with respect to x.  If we differentiate (dy/dx) with respect to x, we obtain the second derivative of y with respect to x.  The second derivative is denoted by f "(x) or y" or (((d^2) y)/(dx^2)), or by f'xx.  Derivatives of order higher than two are defined similarly.

Example:  Find the first, second, and third derivatives of  y = f(x) = (x3 - 1)2
Solution: The first derivative is (dy/dx) = y' = f'(x) = f'x = 6x2(x3 - 1), the second derivative is (((d^2) y)/(dx^2)) = y" = f"(x) = f'xx = 30x4 - 12x, and the third derivative is (((d^3) y)/(dx^3))= y"' = f"'(x) = f'xxx = 120x3 - 12.             
The Mathematica command for the (n^th) derivative of f(x) is D [f(x), {x,  n}].  This command is used below to find the (1^st), (2^nd), and (3^rd) derivatives of the function given in the example.
Clear[y,  x]
y  =  (x^3 - 1)^2;
D[y, {x, 1}]
6 (x^2) (-1 + (x^3))
D[y, {x, 2}]
18 (x^4) + 12 x (-1 + (x^3))
D[y, {x, 3}]
108 (x^3) + 12 (-1 + (x^3))

Example:  Find the first, second, and third derivative of y = f(x) = (1/x).
Solution:   The first derivative is (dy/dx)= y' = f'(x) = f'x  = - (1/(x^2)), The second derivative is (((d^2) y)/(dx^2)) = y" = f"(x) = f'xx  =  (2/(x^3)), and the third derivative is (((d^3) y)/(dx^3)) = y"' = f"'(x) = f'xxx =((-6)/(x^4)) .  
Using Mathematica, 
Clear[y,  x]
y  =  1/x; 
D[y, {x, 1}]
-(1/(x^2))
D[y,  {x,  2}]
(2/(x^3))
D[y,  {x,  3}]
-(6/(x^4))
Since the first derivative of a function represents rate of change, the second derivative represents rate of change of a rate of change.  In other words, the first derivative of a function is the slope function.  The second derivative is the slope of the slope function.  
In physical science, the second derivative represents acceleration.  That is, if y = f(t) represents the position of an object that moves in a straight line, the first derivative f '(t) represents the velocity of the object as a function of time, and f ''(t) represents acceleration.  In business and economics, the second derivative represents scale of a change.  For example, in the production process, if output is increasing, it may be increasing with an increasing rate or decreasing rate.  The sign of the second derivative will show whether the increase is at an increasing rate or a decreasing rate.   The cases that may occur are as follows:

Case 1: f '((Subscript[x, o])) > 0 and f "((Subscript[x, o])) > 0. This implies that, at (Subscript[x, o]), f is increasing at an increasing rate.  

Example: Total Product, Marginal Product, and Economies of Scale  
The relation between labor input (L) and output (Q) is given as Q = q(L) = 100(L^(1.  5)).  Find the first derivative and the second derivative of the function at (Subscript[L, o]) = 25 and comment on the scale effect at this point. 
Solution:  The first derivative of the function with respect to labor input (L) is q '(L) = 150(L^(. 5)) .  This is the marginal product function.  The second derivative of Q is q "(L) = 75(L^(-. 5)).  This function represents the slope of the marginal product function.  The first derivative of q at (Subscript[L, o])= 25 is q '(25) = 750 > 0.  The second derivative evaluated at (Subscript[L, o]) = 25 is q "(25) = 15 > 0.  Therefore, at (Subscript[L, o])  =  25, q(L) is increasing at an increasing rate.  That is, at (Subscript[L, o])  =  25 not only the marginal product of labor is positive, the marginal product of labor will increase as extra units of labor are employed.  This means that at (Subscript[L, o])  =  25production process is increasing return to scale or the function exhibits economies of scale.  The graph below is the graph of Q = 100(L^(1.  5)) which is increasing and convex upward. 


To solve the problem using Mathematica,
Clear[Q, L]
Q = 100  L^1.5;
D[Q, L] /. L -> 25
750.`
D[Q, {L, 2}] /. L -> 25
15.`
Plot[Q, {L, 0, 30},  AxesLabel -> {"L", "Q"}]

Case2: f '((Subscript[x, o])) > 0 and f "((Subscript[x, o])) < 0. This implies that, at (Subscript[x, o]), f is increasing at a decreasing rate.  

Example: Total Product, Marginal Product, and Diseconomies of Scale  
The relation between labor input (L) and output (Q) is given as Q = q(L) = 100(L^( . 5)).  Find the first derivative and the second derivative of the function at (Subscript[L, o]) = 25 and comment on the scale effect at this point. 
Solution:  The first derivative of the function is q '(L) = 50(L^(-. 5)) .  This is the marginal product function.  The second derivative is q"(L) = -25(L^(-1.  5)).  The first derivative of Q at (Subscript[L, o])= 25 is q '(25) = 10 > 0.  The second derivative evaluated at (Subscript[L, o]) = 25 is q "(25) = - .2 < 0.  Therefore, at (Subscript[L, o])  =  25, q(L) is increasing at a decreasing rate.  That is, the function exhibits decreasing return to scale or diseconomies of scale.  The graph of the function, below, shows that the function is increasing and convex downward.



The Mathematica solution to the problem is given below,
Clear[Q, L]

        Q = 100  L^ .5; 
D[Q, L] /. L -> 25
10.`
D[Q, {L, 2}] /. L -> 25
-0.2`
Plot[Q, {L, 0, 30},  AxesLabel -> {"L", "Q"}]

Case3: f '((Subscript[x, o])) < 0 and f "((Subscript[x, o])) > 0. This implies that, at (Subscript[x, o]) f is decreasing at an increasing rate.  

Example: Average Variable Cost 
Average variable cost of a firm (AVC) as a function of its output (Q) is given as AVC(Q) = f(Q) = 180 - 4.8Q + .08(Q^2).  Find the slope of the AVC curve at (Subscript[Q, o]) = 10.  How does AVC change as output increase at the neighborhood of (Subscript[Q, o ]) = 10.
Solution:   The first derivative of the function gives the slope of the AVC.  That is, f '(Q) = -4.8 + .16Q.   At (Subscript[Q, o]) = 10, f '(10) = -3.2 < 0.  This implies that AVC is a decreasing function of Q at (Subscript[Q, o]) = 10.  The second derivative of AVC is f ' '(Q) = .16 > 0.   That is, as Q increases at the neighborhood of (Subscript[Q, o]) = 10, AVC decreases with an increasing rate.  As the graph of the function shows, at the neighborhood of (Subscript[Q, o]) = 10, the function is decreasing with an increasing rate (convex upward).


The Mathematica solution to the problem is given below, 
Clear[AVC, Q]
AVC = 180  -  4.8  Q  +   .08  Q^2  ;
D[AVC, Q] /. Q -> 10
-3.1999999999999997`
D[AVC, {Q, 2}] /. Q -> 10
0.16`
Plot[AVC, {Q, 0,  50}, AxesLabel -> {"Q", "$"}]

Case4: f '((Subscript[x, o])) < 0 and f "((Subscript[x, o])) < 0. This implies that, at (Subscript[x, o]), f is decreasing at a decreasing rate.  

Example:  Average Product   
Average product (AP) of a firm as a function of labor input (L) is given as AP(L) = f(L) = 200 + 5L -.3(L^2).   Find the slope of the AP at (Subscript[L, o]) = 20.  How does AP change as labor input increase from (Subscript[L, o]) = 20.
Solution:   The first derivative of the AP function is f '(L) = 5 - .6L.  At (Subscript[L, o]) = 20, f '(20) = -7 < 0.  That is, AP has a negative slope at (Subscript[L, o]) = 20.  The second derivative of AP is f "(L) = -.6 < 0.   That is as L increases from (Subscript[L, o ]) = 20, AP deceases at a decreasing rate.  The graph of the function, below, shows this fact.  As L increases from (Subscript[L, o]) = 20, AP decreases with a decreasing rate (convex downward). 


The Mathematica solution to the problem is given below,
Clear[AP, L]
AP = 2005  +  5  L  -  .3  L^2 ; 
D[AP, L] /. L -> 20
-7.`
D[AP, {L, 2}] /. L -> 20
-0.6`
Plot[AP, {L, 10, 30}, AxesLabel -> {"L", "AP"}]

Example:  Three Phases of Production Function
One of the conventional models of the production function is a third degree polynomial function that shows all three phases of production.  Phase one is the starting or the low levels of input.  In this phase,  as input increases output increases with an increasing rate due to division of labor.  Phase two is the middle phase, where the law of diminishing return sets in.  In this phase, as input increases, output increases with a decreasing rate.  The third phase is the output levels beyond the maximum level of output.  In this phase as input increases, output decreases.  The following graph is the presentation of such model given the relationship between labor input (L) and output (Q) expressed as Q = f(L) = 900L + 75(L^2) - (L^3).


The following commands in Mathematica graph the function and finds the derivatives at different levels of label input that corresponds to three phases of production.
Clear[Q,  L]
Q  =  900  L + 75  L^2 - 2  L^3 ;
Plot[Q, {L, 0, 35}, AxesLabel -> {"L", "Q"}]

Phase one starts from labor input of zero to 12.  At any point in the first phase, where output increases with increasing rate, the first derivative (the slope of the curve) and the second derivative (slope of the slope curve) has to be positive.  We can test this for an input level of (Subscript[L, o]) = 10.  The first derivative and second derivatives are f '(L) = 900 + 150L -3(L^2) f "(L) = 150 - 6L, respectively.  A (Subscript[L, o]) = 10, f '(10) = 1800 > 0 and f"(10) = 30 > 0.  Since both f ' and f " are positive, at this point the function is increasing with an increasing rate.  The Mathematica solution is given below.
D[Q, L] /. L -> 10
1800
D[Q, {L, 2}] /. L -> 10
30
In the second phase, the first derivative (slope of the curve) is positive but the second derivative is negative.  We can test this for an input level of (Subscript[L, o]) = 20. At this point f '(20) = 1500 > 0 and f "(20) < 0.  The function is increasing with a decreasing rate.  The mathematica solution is given below,
D[Q, L] /. L -> 20
1500
D[Q, {L, 2}] /. L -> 20
-90
In the third phase, the first derivative (slope of the curve) is negative.  We can test this for an input level of (Subscript[L, o]) = 35.  At this point f'(35) =  -1200 < 0.  The Mathematica calculation is given below.
D[Q,  L] /. L -> 35
-1200

Case 5:  f '(x) = 0 and or f "(x) = 0.  This will gives the critical points (maxima, minima, inflection point) of the function.  This subject will be studied in the next chapter. 

Taylor Series Expansion:  Given a functional relation y = f(x), Taylor series expansion is a polynomial approximation to f(x) at a given point x = (Subscript[x, o]).  That is, f(x ) = f( (Subscript[x, o]))+ ((f'( (Subscript[x, o]))(x-(Subscript[x, o])))/1)+ ((f''((Subscript[x, o]))(((x- (Subscript[x, o])))^2))/2)+ ((f'''((Subscript[x, o]))(((x- (Subscript[x, o])))^3))/6)+ ....... + (Subscript[R, n]), where, (Subscript[R, n]) is the remainder term.  In general, Taylor series can be expressed as, f(x ) ≈ f( (Subscript[x, o]))+\(TraditionalForm\`\(Σ\+\(i = 1\)\%n\) 1\/\(i!\)\) (((d^i)f'( (Subscript[x, o]))(((x-(Subscript[x, o])))^i))/((dx^i))), where i! is the factorial of i, as n! = n(n-1)(n-2)........ 3.2.1.  The choice of i is arbitrary.  The higher is i, the more accurate is the approximation.  The two most common and frequently used approximations are linear and quadratic approximations.  The linear approximation can be expressed as, f(x ) ≈ f( (Subscript[x, o]))+ ((f'( (Subscript[x, o]))(x-(Subscript[x, o])))/1), or f(x ) ≈ f( (Subscript[x, o]))+ f'( (Subscript[x, o]))(x-(Subscript[x, o])) ≈ f'( (Subscript[x, o]))x+[f( (Subscript[x, o]))- (Subscript[x, o])f'((Subscript[x, o]))], or f(x) = mx + b.  The quadratic approximation is, f(x ) ≈  f( (Subscript[x, o]))+ ((f'( (Subscript[x, o]))(x-(Subscript[x, o])))/1)+ ((f''((Subscript[x, o]))(((x- (Subscript[x, o])))^2))/2).

Example: Find a linear approximation to y = (x^2)-4x +5, at (Subscript[x, o])= 1.
Solution:  f(x) ≈ f(1) + f '(1)(x-1).  Here, f '(x) = 2x - 4, f '((Subscript[x, o])) = -2, and the linear approximation of f(x) ≈ 2-2(x-1) = 4 - 2x.

Example:  Find linear and quadratic approximations for y = f(x) = (Sqrt[x  -  1])at (Subscript[x, o]) = 5.
Solution:  f '(x) = ((((x - 1))^(-1/2))/2), and f"(x) = -((((x - 1))^(-3/2))/4).  Therefore, the linear approximation at x = 5 is f(x) ≈ 2+(1/4)(x-5), and the quadratic approximation is f(x) ≈ f(5) + f'(5)(x-5) + (1/2)f"(5)(x-5) ≈ 2+(1/4)(x-5) -(1/(4 ( 16^(1/3))))(((x - 5))^2).
Problems
1.  Find f '(x), f "(x), and f "'(x) for the following functions:
       a) f(x) = 2x3 - 3x2 + 5x - 8
       b) f(x) = 3x4 - 3x-2 - 5
       c) f(x) = (2x - 3)5((1/x) - 3x2)-4
       d) f(x) = ln((x  +  1)/((x^(2 )) +  1)) + e2x
       e) f(x) = ALα
2.  For the cost function TC = 20 + 50 q-3.75(q^2)+0.10(q^3) show that TC increases with a decreasing rate at the output level of Q = 10 and TC increases with an increasing rate at the output levels of Q = 20.
3.  The total cost of repaying a home loan at an interest rate of r % per year is C = f(r).
a)  What is the meaning of the derivative f '(r)?
b)  What does the statement f '(10) = 800 mean?
c)  Is f '(r) always positive or does it change in sign?
4.  Find linear and quadratic approximations for the following functions at the given points.
a)  y = f(x) = ln x;     (Subscript[x, o]) = 1
b) y = f(x) = (1/x);       (Subscript[x, o]) = 1
c)  y = (x^3) - 1;           (Subscript[x, o]) = 0
d)  y = (Sqrt[(x^2)  -  1]);   (Subscript[x, o]) = 1, and  (Subscript[x, o]) = 2.

IV. Some Helpful Rules:  The Dt Command    
There are many cases in which a function does not yield itself to a direct application of derivative formulas discussed in the earlier sections.  The following rules help to differentiate such functions.

Chain Rule:  Let  f  be given by y = f(z) and  g  by z = g(x).  One way to obtain (dy/dx) is to substitute for z in y = f(z), find a relation between y and x, and differentiate y with respect to x.  However, it is often convenient to apply the following rule, which is known as the chain rule: (dy/dx) = (dy/dz). (dz/dx).

Example: Let  f  be given by y = f(z) = 2z3 + 5z and  g  by z = g(x) =  (x3 - 1)2.  Find (dy/dx).
Solution:  Using the chain rule, (dy/dx) = (dy/dz).  (dz/dx) =  (6z2 + 5)[6x2(x3 - 1)].  You may substitute for z to find (dy/dx) in terms of x, (dy/dx) = (6((((x^3)  - 1))^4)  +  5)[6x2(x3 - 1)] = 6 (x^2) (-1 + (x^3)) (5 + 6 (((-1 + (x^3)))^4)).
In Mathematica, as long as the functions are defined, the command D [f(x), x] can be used to find the derivative of a function with respect to the variable of interest.  For the same example as above, the Mathematica solution is:
Clear[x,  y,  z]
y  =  2  z^3  +  5  z;
z  =  (x^3  - 1)^2;
D[y, x]
30 (x^2) (-1 + (x^3)) + 36 (x^2) (((-1 + (x^3)))^5)
The commands Simplify[ expr ]  or  Factor[ expr ]  may be used to simplify or factor the solution as follows                     
Simplify[%]
6 (x^2) (-1 + (x^3)) (5 + 6 (((-1 + (x^3)))^4))
Note that Mathematica substitutes for the value of z and differentiates y with respect to x.
 
Example:  Let  f  be given by y = f(z) = z2 + 1, g  given by z = g(x) = lnx2, and h given by x = h(t) = t.  Find (dy/dt).
Solution:  (dy/dt)= (dy/dz).(dz/dx).(dx/dt) = 2z.(2/x).1 = 4(z/x)= 4ln ((x^2)/x) = 4((ln (t^2))/t). 
Using  Mathematica,
Clear[x,  y,  z,  t]
y  =  z^2  + 1;
z  =  Log[E, x^2];
x  =  t;
D[y,  t]
((4 Log[(t^2)])/t)

Implicit Differentiation:  Given an implicit function F(x, y) = 0, the chain rule can be applied to find the derivative of the function without writing y as an explicit function of x.

Example:  Let F(x, y) = 2x + 3y = 0.  Find (dy/dx).
Solution:  (d/dx)F(x, y) = 2 + 3(dy/dx) = 0.  Therefore, (dy/dx) = -(2/3).   
In  Mathematica, Use the command  Dt[f(x, y), x] to find the total derivative of the function and solve for Dt[y, x].  In the solution, Dt[y, x] is the same as (dy/dx).  For the example above the Mathematica solution is,
Clear[x,  y]
Dt[2  x  +  3  y, x]
Solve[% == 0,  Dt[y, x]]
2 + 3 Dt[y, x]
{{Dt[y, x] -> -(2/3)}}

Example:  Let F(x, y) = 9(x^2)x2 + 4(y^2)- 81 = 0.  Find (dy/dx).
Solution:  (d/dx)F(x, y) = 18x + 8y(dy/dx) = 0.  Therefore, (dy/dx) = - ((9  x)/(4  y)).  
In Mathematica,
Clear[x,  y]
Dt[9  x^2  +  4  y^2  - 81, x];
Solve[% == 0,  Dt[y, x]]
{{Dt[y, x] -> -((9 x)/(4 y))}}

Example: Production Possibilities Frontier
Production possibilities frontier (PPF) shows the maximum amount of goods and services that a firm or a country can produce if all the available resources are used efficiently.   Suppose that in a simple two-goods model of an economy PPF is represented by (x^2)+ 9(y^2) = 81, where x and y are quantities of the two goods, food and fun, respectively.  Find slope function of the PPF and prove that PPF is a decreasing function and is concave downward (that is, as more of x is produced the opportunity cost of producing it increases).
Solution:  Differentiate the function and solve it for (dy/dx).  That is 2x + 18y(dy/dx) = 0, or (dy/dx) = ((-x)/(9  y)).  The slope of the PPF is m = (dy/dx) = ((-x)/(9  y)).  Since, x and y are positive numbers, m < 0.  To prove that the function is concave downward, we have to prove that the slope of the slope function or the second derivative of the PPF is always negative.  Differentiate m with respect to x, m' = (((d^2) y)/(dx^2)) = ((-9 y  +   9  x  (dy/dx))/(81  (y^2))).  Substitute for (dy/dx) to get m' = ((-9 (y^2) -  (x^2))/(81  (y^3))) = ((-81)/(81  (y^3))) = ((-1)/(y^3)) < 0.  That is, the PPF slopes downward and is concave downward.  
To solve the problem and to graph it using Mathematica, use the following commands,
Clear[x, y]
sol  =  
          Solve[Dt[x^2 + 9  y^2 - 81,  x] == 0,  Dt[y, x]]
m  =  sol;

{{Dt[y, x] -> -(x/(9 y))}}
The derivative of m with respect to x evaluated for (dy/dx) is,
Dt[m, x]/.sol 
{{{Dt[y, {x, 2}] -> -((x^2)/(81 (y^3))) - 
                (1/(9 y))}}}
To observe the shape of the PPF , graph the function using the ContourPlot command as,
ContourPlot[
          x^2 + 9  y^2 - 81,  {x,  0,  9},  {y,  0,  3}, 
          ContourShading -> False]

⁃  ContourGraphics  ⁃

Differential of a Function:  So far,  we have interpreted (dy/dx) as a single symbol and not as a quotient of dy and dx.  We now assign separate meaning to dy and dx.  We define the differential of a function  f  defined by  y = f(x) as dy = f'(x)dx.  In this definition, dy, the differential of  f, depends not only on x but also on dx.  That is, to find a particular value of dy it is necessary to assign a value for x and a value for dx.  

Example:  Find the differential of y = f(x) = x2 - 2x  when  x = 2 and dx = 1.
Solution:  dy = (2x - 2)dx.  By substituting for the values of x and dx, dy = 2.   
In Mathematica, use the command  Dt[f(x, y)] to find the differential of the function.  Note that, the command is used without defining the variable for which differentiation is done.  Then solve for Dt[y], which is the same as dy, or solve for Dt[x], which is the same as dx.                        		       
Note that, although dx and dy are interpreted as separate variables, the ratio (dy/dx) is still equal to f'(x).
Clear[x,  y]
sol1  =  Dt[y - x^2 + 2  x];
sol2  =  Solve[sol1 == 0,  Dt[y]];
sol2 /. {x -> 2,  Dt[x] -> 1}
{{Dt[y] -> 2}}
The concept of differential of a function provides a convenient way of finding derivatives.  This is specially true, when a function is in implicit form or the independent variable of a function is a function of other variables. The following examples illustrate derivatives of such functions.

Example:  Find (dy/dx) if x2 + y2 - 9 = 0.
Solution:  Differential of the function is  2xdx + 2ydy = 0.  Therefore, (dy/dx) = -(x/y).  
In Mathematica,  the command "Dt[f(x, y), x]" finds differential of the function with respect to x.  The command "Solve" then can be used to find Dt[y, x], which is the derivative of y with respect to x.
Clear[x,  y]
Dt[x^2  + y^2  - 9,  x];
Solve[% == 0,  Dt[y, x]]
{{Dt[y, x] -> -(x/y)}}

Example: Find (dy/dt) if y = f(x) = x2 + 2x + 3 and x = g(t) = t2 + 1.
Solution:  dy = f'(x)dx = 2xdx + 2dx and dx = g'(t)dt = 2tdt.  Therefore,  dy = 4xtdt + 4tdt,  and (dy/dt) = 4xt + 4t = 4t(x + 1) = 4t((t^2)+ 2).  
In Mathematica, define both functions and use the command "Dt[y, t]" to find the derivative of y with respect to t.
Clear[x,  y,  t]
y  =  x^2  + 2  x  + 3;
x  =  t^2  + 1;
D[y, t]
Simplify[%]
4 t + 4 t (1 + (t^2))
4 t (2 + (t^2))

The symbol "d" can be interpreted as the differential operator for the function to which it is applied.  The operator  follows the rules that apply to derivative rules (Differential Formulas).  Therefore, if u and v are differentiable functions of x, we can write,
1-  dc = 0, if c is constant.
2-  d(u + v) = du + dv
3-  d((u^m)) = m(u^(m - 1))du
4-  d(uv) = udv + vdu
5-  d((u/v)) =((vdu  - udv)/(v^2)) 
6-  d(lnu) = (du/u)
7-  d((e^u)) = (e^u)du

Example:  If y = f(x) = ((((x^3) -   1))^4)((((x^2)  + x  +   10))^3), find dy.
Solution:  Let u =  ((((x^3) -   1))^4) and let v = ((((x^2)  + x  +   10))^3).     Using the formulas 3 and 4 above, dy = udv + vdu, where du = 12x2(x3 - 1)3dx,  and dv = 3(2xdx + dx)((((x^2)  + x  +   10))^2) = 3(2x + 1)((((x^2)  + x  +   10))^2)dx.  Hence,  dy=(x3 - 1)4[3(2x + 1)((x^2) + x + 10)\(TraditionalForm\`\^2\)]dx + ((((x^2)  + x  +   10))^3)[12(x^2)((x^3) - 1)\(TraditionalForm\`\^3\)]dx.  
In  Mathematica,

Clear[x,  y]
Dt[y - (x^3 - 1)^4 (x^2 + x + 10)^3];
Solve[% == 0,  Dt[y]]
Simplify[%]
{{Dt[y] -> 
            12 (x^2) (((10 + x + (x^2)))^3) (((-1 + (x^3)))^3) Dt[x] + 
              3 (((10 + x + (x^2)))^2) (((-1 + (x^3)))^4) (Dt[x] + 
                    2 x Dt[x])}}
{{Dt[y] -> 
            3 (((10 + x + (x^2)))^2) (((-1 + (x^3)))^3) (-1 - 
                  2 x + 40 (x^2) + 5 (x^3) + 6 (x^4)) Dt[x]}}

Problems
1  Use the following functions to find (dy/dx):
       a) y = f(z) = z2 - z;          	 z = g(x) = x2 + 2x
       b) y = f(z) = ln(z2 - z);       z = g(x) = ln(x2 + 2x)     
       c) y = f(z) = (1/(z + 1));           	z = g(x) = (x/((x^(2 )) +  1))       
       d) y = f(z) = (3z3 + 2z2 + 10)4;   z = g(w) = (w4 - 20)2;  and w = 5x3 - 3x
2 For the following functions, find (dy/dx) by implicit differentiation:
       a) y = 2x3 - 2y-2 	 b) x2 + xy + y2 = 5      
       c) y = ln ((x  +  1)/((x^2)  +  y))        d) (1/x) + (1/y) = 3
3  Find dy for the following functions:
       a)  y = f(x) = x2 + 3x + 12
       b)  y = f(x) = (((x^2) +  1)/(x  +  1)) 
       c)  y = f(x) =  (2x + 1)4(x2 + x + 1)3
       d)  y = f(x) = ln (x2 - 1)
       e)  y = f(x) = e4x     
4.  For the  following demand functions find the slope of the demand curve and the price elasticity of demand at the given prices.
        a)  Q = 100 - 2P;     	 P = 8
        b)  Q = (100/p);        	 P = 2
        c)  Q = (100/(p^3))	  	 P = 2
        d)  Q = 100 - lnP    	 P = 10
        e)  Q = 100 - 3lnP    	 P = 10

V.  Differentiation of Functions of Two or More variables:  The Dt[f(x, y), x] Command
A real-valued function of two real variables, defined by the expression  z = f(x, y), is a mapping of set of ordered pairs (x, y) of real numbers to a set of f(x, y) of real numbers.  The pairs (x, y) are the domain of the function and the set f(x, y) is the range of the function.

The definition of a real-valued function of n variables, defined by the expression u = f(x, y, z, ....), is the same as that of a function of two variables except that the domain of the function consists of ordered variables of more than two (x, y, z, .....) rather than ordered pairs (x, y).

Partial Derivatives:    Let  y = f((Subscript[x, 1]), (Subscript[x, 2]), ........., xn) define a function of n variables.  If all the n variables except xj are fixed, y becomes a function of the one variable xj.  The derivative of y with respect to xj is called partial derivative of y with respect to xj and is denoted by ((∂y)/(∂xj)) or fxj.  

Example:  Let z = f(x, y) = x2y2 - xy + y + 5.  Find partial derivatives of z with respect to x and y.
Solution:  Partial derivative of z with respect to x is (Subscript[f, x]) = ∂(z/∂)x = 2xy2 - y and partial derivative of z with respect to y is (Subscript[f, y]) = ∂(z/∂)y = 2x2y - x + 1.  
In Mathematica, use the derivative command "D".  Use the variable for which the partial derivative is derived as the argument of the command.  
Clear[x,  y,  z]
z  =  x^2  y^2  -  x y  +  y  +  5;
D[z, x]
-y + 2 x (y^2)
The partial derivative of z with respect to x is ∂(z/∂)x = -y + 2x(y^2).  To find the partial derivative of z with respect to y, use the command D[z, y] as below,
D[z, y]
1 - x + 2 (x^2) y
the partial derivative of z with respect to y is ∂(z/∂)y = 1 - x + 2(x^2)y.

Example:  Cobb-Douglas Production Function
Consider a Cobb-Douglas production function, Q = A(L^a)(K^b).  The partial derivative of Q with respect to L, ((Subscript[Q, L])), is the marginal product of labor.  This can be derived by holding the level of capital fixed and differentiating with respect to L.  The partial derivative of Q with respect to K, ((Subscript[Q, K])), is the marginal product of capital.   This can be derived by holding the level of labor fixed and differentiating with respect to K  In Mathematica,
Clear[Q,  L,  K]
Q  =  A L^a K^b;
QL  =  D[Q,  L]
a A (K^b) (L^(-1 + a))
Qk  =  D[Q, K]
A b (K^(-1 + b)) (L^a)
If the function is an implicit function of several variables, to find the partial derivatives, implicitly differentiate with respect to the variables and solve for the partial derivatives of interest.

Example:  Let x2z2 + y2z2 - 2xy - 2zy + 2z = 0.  Find ∂(z/∂)x and ∂(z/∂)y.
Solution:  To find ∂(z/∂)x, let y be fixed and implicitly differentiate with respect to x.  This gives, 2xz2 + 2∂(z/∂)xzx2 + 2y2z∂(z/∂)x - 2y - 2y∂(z/∂)x = 0.  Solving for ∂(z/∂)x, results in ∂(z/∂)x = \(TraditionalForm\`\(y\  - \ xz\^2\)\/\(zx\^2\  + \ zy\^2\  - y\  + \ 1\)\).  To find ∂(z/∂)y, let x be fixed and implicitly differentiate with respect to y.  This gives, 2x2z∂(z/∂)y + 2yz2 + 2y2z∂(z/∂)y - 2x - 2z - 2y∂(z/∂)y + 2∂(z/∂)y = 0.  Solve for ∂(z/∂)y to get ∂(z/∂)y = \(TraditionalForm\`\(x\  + \ z\  - \ y\)\/\(\(x\^2\) z\  + \ \(y\^2\) z\  - \ y\  + \ 1\)\).  
In Mathematica, use the implicit differentiation command "Dt" to differentiate the function with respect to the variable of interest, say x.  Since the y variable is assumed to be fixed, set the partial derivatives of the z with respect to y equal to zero and solve for ∂(z/∂)x.  To solve the problem using Mathematica, 
Clear[x,  y,  z]
Dt[
            x^2  z^2  + y^2  z^2 -  2  x y  -  2  z y  + 2  z,  x];
Solve[% == 0,  Dt[z, x]]/.Dt[y, x]->0

{{Dt[z, 
              x] -> -((-y + x (z^2))/(1 - y + (x^2) z + 
                    (y^2) z))}}
To find ∂(z/∂)y, differentiate the function with respect to the y variable.  Since the x  variable is assumed to be fixed, set the partial derivatives of the z with respect to x equal to zero and solve for ∂(z/∂)y.  
Clear[x,  y,  z]
Dt[
            x^2  z^2  + y^2  z^2 -  2  x y  -  2  z y  + 2  z,  y];
Solve[% == 0,  Dt[z, y]] /. Dt[x, y] -> 0
{{Dt[z, 
              y] -> -((-x - z + y (z^2))/(1 - y + (x^2) z + 
                    (y^2) z))}}

Taylor Series Expansion of Multivariate Functions:  The Taylor series expansion, discussed earlier in this chapter, can be applied to multivariate function also.  For a multivariate function y = f(x) = f((Subscript[x, 1]), (Subscript[x, 2]), . . . . (Subscript[x, n])), the gradient vector f '(x) is, f '(x) = ((df(x))/(dx)) = (({{∂(y/∂)x1}, {∂(y/∂)x2}, {.}, {∂(y/∂)xn}})) = (({{(Subscript[f, 1])}, {(Subscript[f, 2])}, {.}, {(Subscript[f, n])}})), and the second derivatives results in the Hessian matrix which is a square, symmetric matrix with the elements as, (({{(∂^2) 
                      (y/(∂x1 ∂x1)), (∂^2) 
                      (y/(∂x1 ∂x2)), ., ., (∂^2) (y/(∂x1 ∂xn))}, {., ., ., ., .}, {(∂^2) 
                      (y/(∂xn ∂x1)), (∂^2) 
                      (y/(∂xn ∂x2)), ., ., (∂^2) (y/(∂xn ∂xn))}})) = (({{(Subscript[f, 11]), (Subscript[f, 12]), ., ., (Subscript[f, 1  n])}, {(Subscript[f, 21]), (Subscript[f, 22]), ., ., (Subscript[f, 2  n])}, {., ., ., ., .}, {(Subscript[f, n1]), (Subscript[f, n2]), ., ., (Subscript[f, nn])}})).  The first-order or linear Taylor series approximation of the function is y ≈ f((Subscript[x, o])) + [((df((Subscript[x, o])))/(Subscript[dx, o]))]'(x - (Subscript[x, o])) = f((Subscript[x, o])) + f '((Subscript[x, o]))(x - (Subscript[x, o])) or y ≈ [f((Subscript[x, o])) - f '((Subscript[x, o]))(Subscript[x, o])] + f '((Subscript[x, o]))x = (Subscript[β, o]) + \(TraditionalForm\`\(β\_1\%'\)\)x.  

The second-order or quadratic approximation is y ≈ f((Subscript[x, o])) + f '(x - (Subscript[x, o])) + (1/2)(x - (Subscript[x, o]))'(Subscript[H, o])(x - (Subscript[x, o])).  Multiplication and collection of the terms results in y ≈ (Subscript[β, o]) + \(TraditionalForm\`\(β\_1\%'\)\)x + (1/2)x'(Subscript[H, o])x where, (Subscript[β, o]) = f((Subscript[x, o])) - \(f\^'\)((Subscript[x, o]))(Subscript[x, o]) + (1/2)\(TraditionalForm\`\(x\_o\%'\)\)(Subscript[H, o])(Subscript[x, o]) and (Subscript[β, 1]) = -\(TraditionalForm\`\(f\^'\)\)((Subscript[x, o])) + (Subscript[H, o])(Subscript[x, o]).

Example:  Find linear approximation for z = f(x, y) = (x^2) - xy + (y^2) at (Subscript[x, o]) = (Subscript[y, o]) = 1.
Solution:  The gradient vector is f '(x) = (({{2  x  -  y}, {-x  +  2  y}})).  Evaluated at the given point, f '((Subscript[x, o])) = (({{1}, {1}})), and f((Subscript[x, o])) = 1.  The linear approximation of the function is z ≈ f((Subscript[x, o])) + f '((Subscript[x, o]))(x - (Subscript[x, o])) ≈ 1 + (({{1, 1}}))(({{x  -  1}, {y -  1}})) = x + y + 1.

Example:  Find the linear and quadratic approximation for z = f(x + y) at (Subscript[x, o]) = 0, (Subscript[y, o]) = 1.
Solution:  The linear approximation of z ≈ f((Subscript[x, o])) + f '((Subscript[x, o]))(x - (Subscript[x, o])).  f((Subscript[x, o])) = ln(0 + 1) = 0, f '(x) = (({{(1/(x + y))}, {(1/(x + y))}})), and f '((Subscript[x, o])) = (({{1}, {1}})).  Therefore, z ≈ 0 + (({{1, 1}}))(({{x}, {y - 1}})) ≈ x + y -1.  For the quadratic 
approximation, we need to find H = (({{((-1)/(((x + y))^2)), ((-1)/(((x + y))^2))}, {((-1)/(((x + y))^2)), ((-1)/(((x + y))^2))}})).  Evaluated at the given point,  (Subscript[x, o]) = 0, (Subscript[y, o]) = 1, (Subscript[H, o]) = (({{-1, -1}, {-1, -1}})).  The quadratic approximation of z ≈ f((Subscript[x, o])) + f '((Subscript[x, o]))(x - (Subscript[x, o])) + (x - (Subscript[x, o]))'(Subscript[H, o])(x - (Subscript[x, o])) = 0 + (({{1, 1}}))(({{x}, {y - 1}})) + (1/2)(({{x, y - 1}}))(({{-1, -1}, {-1, -1}}))(({{x}, {y - 1}})) = -(1/2)(((x + y))^2) + 2(x + y) -(3/2).

Example:  Find the linear and quadratic approximation of z f(x, y) = (e^xy) at (Subscript[x, o]) = 0, (Subscript[y, o]) = 1.
Solution:  f((Subscript[x, o])) = 1, f '(x) = (({{(ye^xy)}, {(xe^xy)}})), f '((Subscript[x, o])) = (({{1}, {0}})), (({{(y^2) (e^xy), (e^xy) + (xye^xy)}, {(e^xy) + (xye^xy), (x^2) (e^xy)}})), and (Subscript[H, o]) = (({{1, 1}, {1, 0}})).  Therefore, the linear approximation of z ≈ 1 + (({{1, 0}}))(({{x}, {y - 1}})) = 1 + x and the quadratic approximation of z ≈ 1 + (({{1, 0}}))(({{x}, {y - 1}})) + (1/2)(({{x, y - 1}}))(({{1, 1}, {1, 0}}))(({{x}, {y - 1}})) = (1/2)(x^2) + xy +1.

Problems:
1.  Find partial derivatives of the following functions with respect to x and y:
a)  z = (x^2) + xy + (y^2)		b)  z = (e^xy)
c)  z = \(TraditionalForm\`\(2  x\^\(\(.\)\(\ \)\(5\)\)\)\/y\^\(\(.\)\(\ \)\(8\)\)\) 			d)  z = 5 (x^(1.  2))(y^(. 6))
e)  Z = ln ((x  +  y)/(y^2))		f)  z =  10 (((1  +  xy))^2) - (x^2)y
2.  The relationship between labor input (L), capital input (K) and output (Q) is given as Q = 100 (L^(. 7))(K^(. 3)).  Find marginal product of labor and marginal product of capital.  (Hint:  marginal product of labor is partial derivative of Q with respect to L.  Marginal product of capital is partial derivative of Q with respect to K)
3.  A consumer's utility (U) for two goods X and Y is a function of quantities of X and Y consumed.  If the utility function is given as U = ln xy, find marginal utility of x and marginal utility of y. (Hint:  Marginal utility of x is ∂(U/∂)x and marginal utility of y is ∂(U/∂)y)
4.  Demand for a product is estimated as Q = 25(P^(-. 8))(Y^(1.  2)) where, Q is the quantity demanded, P is the price, and y is the income.  Find the price and income elasticities of the demand.
5.  Find the labor and capital elasticities of output for the production function Q = 100\(TraditionalForm\`L\^ .75\)\(TraditionalForm\`K\^ .25\). (Note:  Elasticity of output with respect to labor input is defined as (Subscript[ϵ, L])  = (dQ/dL).(L/Q).
6.  Find linear and quadratic approximations for the following functions at the given points.
a)  z = f(x, y) = ln xy;               (Subscript[x, o]) = 1, (Subscript[y, o]) = 1.
b)  z = f(x, y) = (x^3) - xy + (y^3);   (Subscript[x, o]) = 1, (Subscript[y, o]) = 1.
c)  z = f(x, y) = (e^x) + (e^y);            (Subscript[x, o]) = 1, (Subscript[y, o]) = 1.

VI. Special Topics in Differential Calculus
Jacobian Determinant:   If two or more functions share a set of common variables, the partial derivatives of functions arranged into a determinant in a prescribed order is called the Jacobian determinant and is denoted byDet[J]. More formally, if we have n differentiable functions in n variables:
     y1 = f1((Subscript[x, 1]), (Subscript[x, 2]), ........., xn)
     y2 = f2((Subscript[x, 1]), (Subscript[x, 2]), ........., xn)
       ..      ..................
     yn = fn((Subscript[x, 1]), (Subscript[x, 2]), ........., xn)
the Jacobian determinant is calculated as, 
  
Det[J]| = \(TraditionalForm\`∂\((y1, \ y2, \ \(\(\(...\) \(...\)\) ... \) yn)\)\/∂\((x1, \ x2, \ \(\(\(...\) \(...\)\) ... \) .. , \ xn)\)\) = (({{∂(y1/∂)x1, ∂(y1/∂)x2, ., ., ., ., ∂(y1/∂)xn}, {., ., ., ., ., ., .}, {., ., ., ., ., ., .}, {∂(yn/∂)x1, ∂(yn/∂)x2, ., ., ., ., ∂(yn/∂)xn}}))              

The Jacobian is used for testing the existence of linear or nonlinear dependence among functions.  If Det[J] = 0, the functions are said to be dependent.

Example: Verify the independence of the following functions:
     y1 = 2x1 + 3x2
     y2 =  x1 + 2x2
Solution: The Jacobian determinant is Det[J] = \(TraditionalForm\`∂\((y1, \ y2)\)\/∂\((x1, \ x2)\)\)= Det(({{2, 3}, {1, 2}})) = 1.  Since Det[J] ≠ 0, the equations are independent.  
To use Mathematica, define the functions and formulate the Jacobian determinant as defined above and find the determinant,
Clear[x1,  x2,  y1,  y2]    
y1  =  2  x1  +  3  x2;
y2  =   x1  +  2  x2;
Det[(({{D[y1, x1], D[y1, x2]}, {D[y2, x1], D[y2, x2]}}))]
-15

Example:  Verify the independence of the following functions:
     y1 = x12 - x1x2
     y2 = x12 + x22
Solution:  The Jacobian determinant is Det[J] = \(TraditionalForm\`∂\((y1, \ y2)\)\/∂\((x1, \ x2)\)\)= Det(({{2  x1 - x2, -x1}, {2  x1, 2  x2}})) = 4x1x2 -2(x2^2)+ 2(x1^2).  Since Det[J] ≠ 0, the equations are independent.  Using Mathematica, the solution is,
Clear[x1,  x2,  y1,  y2]
y1  =  x1^2  -  x1 x2;
y2  =  x1^2  +  x2^2;
Det[(({{D[y1, x1], D[y1, x2]}, {D[y2, x1], D[y2, x2]}}))]
2 (x1^2) + 4 x1 x2 - 2 (x2^2)

Example:  Verify the independence of the following equations:
     y1 =  (Subscript[x, 1])2 + 2(Subscript[x, 1])(Subscript[x, 2]) + (Subscript[x, 3])2
     y2 =  (Subscript[x, 1])x1 + (Subscript[x, 2])x2 + (Subscript[x, 3])x3
     y3 = 2(Subscript[x, 1])(Subscript[x, 3]) + 2(Subscript[x, 2])(Subscript[x, 3]) + (Subscript[x, 2])2
The Jacobian determinant is Det[J] = \(TraditionalForm\`∂\((y1, \ y2, \ y3)\)\/∂\((x1, \ x2, \ x3)\)\)= Det(({{2  x1 + 2  x2, 2  x2, 2  x3}, {1, 1, 1}, {2  x3, 2  x2 + 2  x3, 2  x1 + 2  x2}})).  If evaluated, this determinant equals zero.  Therefore, the equations are not independent from each other.  
This can be verified by Mathematica as, 
Clear[x1,  x2,  x3,  y1,  y2,  y3] 
y1  =   x1^2  +  2  x1 x2  +  x3^2;
 y2  =   x1  +  x2  +  x3;
\(\(\ \)\(y3\  = \ 
            2  x1\ x3\  + \ 2  x2\ x3\  + \ x2^2;\)\(
\)\)
Det[(({{D[y1, x1], D[y1, x2], D[y1, x3]}, {D[y2, x1], D[y2, x2], D[y2, x3]}, {D[y3, x1], D[y3, x2], D[y3, x3]}}))]

	
0
Since Det[J] = 0, the three equations are not independent.  In fact, an inspection of equations shows that  y3 =  y22 - y1. 

Partial Derivatives of Higher Order and the Hessian Determinant:   Given the function  f  defined by z = f(x, y), the partial derivatives of  f  with respect to x and y are functions of x and y.  Continued partial differentiation of the function yield partial derivatives of higher order.  Denoting the partial derivative of z = f(x, y) with respect to x as (Subscript[f, x])(x, y) = ∂(z/∂)x and the partial derivative of z with respect to y as (Subscript[f, y])(x, y) = ∂(z/∂)y, the following notations are generally employed for the second-order partial derivatives:

Partial derivative of  fx (x, y) with respect to x is donated by,  (∂/∂)x∂(f/∂)x = (∂^2) (f/∂)(x^2)=  fxx.

Partial derivative of  fx (x, y) with respect to y is donated by,\(TraditionalForm\`\(\(\ \)\(∂\/\(\(\ \)\(∂x\)\)\)\)\)∂(f/∂)y = (∂^2) (f/(∂x ∂y))= fxy.

Partial derivative of  fy (x, y) with respect to x is donated by, (∂/∂)y∂(f/∂)x = (∂^2) (f/(∂y ∂x))= fyx.

Partial derivative of  fyy (x, y) with respect to x is donated by, (∂/∂)y∂(f/∂)y = (∂^2) (f/∂)(y^2)=  fyy.

A determinant whose elements are the second-order partial derivatives is called a Hessian determinant and is denoted by |H| or Det[H].  For the function  f, defined by  z = f(x, y), the Hessian determinant is,

     |H| = Det[H] = (({{fxx , fxy}, {fyx ,  fyy}}))
      
Example:  If z = f(x, y) = x3 - xy + y3, find the second-order partial derivative of the function and evaluate the Hessian determinant at P(1, 2, 7). 
Solution:  fx = ∂(f/∂)x = 3x2 - y,   fy = ∂(f/∂)y = -x + 3y2 ,   fxx = (∂^2) (f/∂)(x^2) = 6x,  fxy = (∂^2) (f/(∂x ∂y)) = -1,  fyx = (∂^2) (f/(∂y ∂x)) = -1, and fyy = (∂^2) (f/∂)(y^2)= 6y.  The Hessian determinant is Det[H] = (({{6  x, -1}, {-1, 6  y}})).  Evaluated at P(1, 2, 7),  Det[H] = (({{6, -1}, {-1, 12}})) = 71.  
To evaluate Det[H]through Mathematica,
Clear[x,  y,  z]
z  =  x^3  -  x y  +  y^3;
Det[(({{D[D[z, x],  x], D[D[z,  x],  y]}, {D[D[z,  y],  x], D[D[z, y],  y]}}))]/.{x -> 1,  y -> 2}

71
Note that, by what is called the Young's Theorem fxy = fyx, for every x and y.  Young's Theorem assures that the order of differentiation is immaterial in cross derivatives.

Differential of a Function of Two or More Variables:  Let z = f(x, y) define a differentiable function of x and y.  The differential of the function is defined as dz = fxdx + fydy,  where dx and dy are arbitrary real numbers.

Example:  Given z = f(x, y) = x2y + y2 - x, find dz.
Solution:  dz = 2xydx + x2dy + 2ydy - dx.  
Using Mathematica, define the function and use the "D" command without an argument.  
Clear[x,  y,  z]
z  =  x^2 y  +  y^2  -  x;
Dt[z]
-Dt[x] + 2 x y Dt[x] + (x^2) Dt[y] + 2 y Dt[y]

Example:  Indifference Curve and Marginal Rate of Substitution
Given the utility function, U = U(x, y), find the marginal rate of substitution (MRS) of x for y.
Solution:  Marginal rate of substitution of x for y (MRS) is the trade off  rate between x and y on indifference curve in such a way that the consumer's utility stays unchanged.  That is, MRS is the slope of the indifference curve at a point on indifference curve.  Differential of U yields  dU = Uxdx + Uydy  where, Ux and Uy are the marginal utilities of x and y, respectively. For a given level of utility, (dU = 0).  Therefore,  (dy/dx) = -((Ux)/Uy) = MRS.

Example:  MRS in a Cobb-Douglas Utility Function
For the Cobb-Douglas utility function U = A(x^α)(y^β) find marginal rate of substitution (MRS).
Solution:  Marginal Rate of substitution of x for y is defined as (dy/dx) = -((Ux)/Uy), where (Subscript[U, x]) and (Subscript[U, y]) are marginal utilities of x and y, respectively.  For the given Cobb-Douglas utility function, (Subscript[U, x]) = Aα(x^(α - 1))(y^β) and (Subscript[U, y]) = Aβ(x^α)(y^(β - 1)).  Therefore, MRS = -α(y/β)x.
Using Mathematica,
Clear[x, y]
U = A x^α y^β;
Ux = D[U, x];
Uy = D[U, y];
MRS = -Ux/Uy
-((y α)/(x β))

Example:  IS-LM model of Economy
A very standard and powerful tool of analyzing the effect of monetary and fiscal policy on output (y) and interest rate (r) is a simple model called IS-LM model.  IS is downward sloping curve representing all the combination of  y  and  r  that the goods market is in equilibrium.  LM is an upward sloping curve representing all the combination of  y  and  r  that the money market is in equilibrium. Suppose that the IS model of an economy is expressed by y = D(y, r) where D(y, r) is the aggregate demand as a function of income (y) and interest rate (r).  Find the slope of the IS curve and prove that the slope is negative.
Solution:  Differential of the function yields Dydy + Drdr = dy,  where the slope (dr/dy) is, (dr/dy) = ((1 - Dy  )/( Dr)).   (Subscript[D, y ])is the derivative of aggregate demand with respect to income, which is marginal propensity to consume (MPC).  Since 0 < MPC < 1, then 1 - (Subscript[D, y]) > 0.  (Subscript[D, r]) is the derivative of the aggregate demand with respect to interest rate, which conventionally is assumed to be negative, (Subscript[D, r]) < 0.  Therefore, ((1  -  (Subscript[D, y]))/(Subscript[D, r])) < 0.  

 Example:  Find the second differential of z = f(x, y).
Solution:  The first differential of z yields  dz = fxdx + fydy.   The second differential is a measure of the change in dz,                   
     d(dz) = d2z = (∂/∂)x(fxdx + fydy)dx + (∂/∂)y(fxdx + fydy)dy                    
     d(dz) = d2z = (fxxdx + fyxdy)dx + (fxydx + fyydy)dy = fxxdx2 + 2fxydxdy + fyydy2
Or, in the matrix notation  d(dz) = d2z = (({{dx, dy}}))(({{fxx, fxy}, {(Subscript[f, yx]),  (Subscript[f, yy])}}))(({{dx}, {dy}})).

Total Derivative:    The differential of the function z = f(x, y) is dz = fxdx + fydy.  Dividing both sides of this equation by dx yields (dz/dx) = fx + fy (dy/(dx )).  Since the ratio (dz/dx) may be interpreted as the derivative, we can regard it as a measure of the instantaneous rate of change of z with respect to x.  The expression (dz/dx) = fx + fy (dy/dx) is called total derivative, and the process of finding it is called total differentiation.       

Example:  Find total derivative (dz/dx), given that  z = f(x, y) = 2x3 - 5xy + y2  and  y = (x - 1)2.
Solution:  dz = fxdx + fydy,  and  (dz/dx) = fx + fy(dy/dx) = 6x2 - 5y + 2(-5x + 2y)(x - 1).  
Using Mathematica,
Clear[x,  y,  z]
z  =  2  x^3  -  5  x y  +  y^2;
y  =  (x - 1)^2;
D[z, x];
Simplify[%]
-9 + 32 x - 21 (x^2) + 4 (x^3)

Example: Output Growth 
Suppose that the real output of an economy (Q) is a function of labor (L) and capital (K), Q = f(L, K).  If the labor and capital are growing over time at the rates given by  L = g(t) and K = h(t) respectively, find the rate of change of Q over time.
Solution: dQ =fKdK + fLdL, where dL = gtdt and dK= htdt.  Thus, (dQ/dt) = fKht + fLgt, where fL and fK are marginal products of labor and capital, respectively.

Differential Calculus in Matrix Notation:  The rules for differentiation of vectors and matrices are given below.  Students are required to verify them using simple numerical examples.

Rule1.   ((∂a'x)/(∂x)) = a, where a and x are each  nx1 vectors and the operation of differentiation is done with respect to the elements of the x vector.  Therefore, partial derivatives of a'x with respect to the scalar xi gives n elements of the vector a.

Example:  Find ((∂a'x)/(∂x)), where a' = (({{5, 3, -1}})) and x' = (({{x1, x2, x3}})).
Solution:  ((∂a'x)/(∂x1)) = 5,  ((∂a'x)/(∂x2)) = 3, and ((∂a'x)/(∂x3)) = -1.  Therefore, ((∂a'x)/(∂x)) = (({{5, 3, -1}})).

Rule 2.  ((∂x'Ax)/(∂x)) = 2Ax or ((∂x'Ax)/(∂x)) = 2x'A, where x is a nx1 vector and A is a nxn symmetric matrix.  The choice between the 2Ax and 2A'x is usually determined by the context in which differentiation takes place, and conformity of the resulting matrix with other matrices in equations.

Example:  Find ((∂x'Ax)/(∂x)), where x = (({{x1, x2, x3}})) and   A = (({{1, -1, 0}, {-1, 5, 3}, {0, 3, 1}}))   
Solution:  x'Ax = x12 - 2x1x2 + 6x2x3 + 5x22 + x32 .   ((∂x'Ax)/(∂x1)) = 2x1 - 2x2,   ((∂x'Ax)/(∂x2)) = -2x1 + 10x2 + 6x3,  and  ((∂x'Ax)/(∂x3)) = 6x2 + 2x3.  Therefore, ((∂x'Ax)/(∂x))= 2(({{1, -1, 0}, {-1, 5, 3}, {0, 3, 1}}))(({{x1}, {x2}, {x3}}))
  
Rule 3.   y = f(x),  where y is a nx1 vector each element of which is a function of m elements of vector x.  That is,  yi = fi(x1, x2 ......, xm),  i = 1, ...., n.
            
  ((∂y)/(∂x)) =   (({{∂(y1/∂)x1, \(∂y2\/∂x1\), ., ., ., ∂(yn/∂)x1}, {∂(y1/∂)x2, \(∂y2\/∂x2\), ., ., ., ∂(yn/∂)x2}, {., ., ., ., ., .}, {., ., ., ., ., .}, {., ., ., ., ., .}, {∂(y1/∂)xm, \(∂y2\/∂xm\), ., ., ., ∂(yn/∂)xm}}))

Each yi is differentiated partially with respect to each xj  giving an mxn matrix of partial derivatives.

Example:  Find ((∂y)/(∂x))for the following system of equations 
     y1 = 2x1 + 7x2 + 2x3
     y2 = 3x1 + 3x2 +  x3
     y3 = 2x1 + 6x2 + 3x3
     y4 = 4x1 + 2x2 +  x3
     y5 = 6x1 +  x2 
((∂y)/(∂x)) = (({{2, 3, 2, 4, 6}, {7, 3, 6, 2, 1}, {2, 1, 3, 1, 0}}))
((∂y)/(∂x)) can also be calculated using Mathematica as, 
Clear[x1, x2, x3, y1, y2, y3, y4, y5] 
y1  =  2  x1  +  7  x2  +  2  x3;
 y2  =  3  x1  +  3  x2  +   x3;
 y3  =  2  x1  +  6  x2  +  3  x3;
 y4  =  4  x1  +  2  x2  +   x3;
 y5  =  6  x1  +   x2;
  MatrixForm[(({{D[y1, x1], D[y2, x1], D[y3, x1], D[y4, 
                      x1], D[y5, x1]}, {D[y1, x2], D[y2, x2], D[y3, x2], D[y4, 
                      x2], D[y5, x2]}, {D[y1, x3], D[y2, x3], D[y3, x3], D[y4, 
                      x3], D[y5, x3]}}))]
 
(({{2, 3, 2, 4, 6}, {7, 3, 6, 2, 1}, {2, 1, 3, 1, 0}}))

Problems
1.  Given the utility function  U = U(x, y) and the budget constraint PxX + PyY = M, find the equilibrium condition for the consumer. (Hint: At the equilibrium point, the budget constraint is tangent to the indifference curve. Therefore, at the equilibrium point, the  slope of the budget constraint  should be equal to the slope of the indifference curve).  
2.  Find  the  first-order and second-order differentials of the Cob-Douglas production function Q = ALaKb
3.  In the IS-LM model of the economy LM represent all the combination of output (y) and interest rate (r) where the money market is in equilibrium.  Suppose that, the LM model of the economy is expressed as ((Subscript[M, s])/p)= L(y, r), where ((Subscript[M, s])/P)is the real money supply and L(Y, r) is the demand for real balances.  Find the slope of the LM curve and prove that slope of the LM curve is positive.  (Hint:  Demand for money is positively related with income and negatively related with interest rate.)
4.  The production function of an economy is given as Q = Q(L, K)= 20L.75K.25,  where the labor input (L) and the capital input (K) are growing at the rates L = L(t) = .2t, and K = k(t) = .3t.  Find (dQ/dt).
5.  Find the input elasticities for the Cob-Douglas production function Q = ALaKb.  (Hint: Elasticity of output with respect to labor (L) is defined as (Subscript[ζ, L]) = ∂(Q/∂)L(L/Q).    
6.  For the production function, Q = AK.25L.75
a) Prove that the function is homogenous of degree one.(Hint: Prove that an m multiple of inputs will results in m multiple of output.)
b) Find the  marginal  product of labor, QL, and the marginal product of capital, QK.
c) Prove that if labor and  capital  are paid according to the value of their marginal products, total revenue will be exhausted, and the profit will be zero (Euler's Theorem).  (Hint:  The value of marginal product of labor or marginal revenue product of labor is equal to the marginal product of labor times the price of the product.)              
7.  For the following constant elasticity of substitution (CES) production function,  Q = A(a(K^(-r)) + b(L^(-r)))\(TraditionalForm\`\( . \^\(\(-1\)\/r\)\)\)
a) Prove that  the production function is homogenous of degree one.
b) Find the marginal product of capital and the marginal product of labor.
c) Prove that, if labor and capital are paid according to the value of  their marginal products, total revenue will  be exhausted and the profit will be zero.
8.  For the following production functions find the elasticity of technical substitution of labor (L) for capital (K). (Hint: elasticity of technical substitution of labor for capital is defined as the ratio of percent change in (L/K) to percent change in (r/w), where w and r are wage and rental cost of capital, respectively).      
	a-  Q = ALaKb
	b-  Q = 100 L1/2K1/2
9.  Find ((∂a'x)/(∂x)), where a' = (({{3, 1, -1}}))and x' = (({{x1, x2, x3}})).
10. Find ((∂x'Ax)/(∂x)), where  x' = (({{x1, x2, x3}})) and A = (({{0, 2, 3}, {2, 1, -1}, {-1, 0, 1}}))
11.  For  the  function  Y = f(X) = XB + u  where,  Y  is a  nx1 vector, x is a nxk matrix, B is a kx1 vector, and u is a nx1 vector,
a-  Find the  first derivative of u'u with respect to B.
b-  Find the second derivative of u'u with respect to B.