Chapter 2
FUNCTIONS AND THEIR GRAPHS

The concept of functions plays a major role in mathematics.  It is also an important tool in formulating and analyzing economic relationships.  Economic relationships, generally, follow a certain functional form.   In this chapter, after defining functions, different types of single-variable and multi-variable functions are presented, their graphs are shown, and their relevance to economic theory is discussed.  The last section of this chapter presents parametric functions and their graphs. 

TOOL BOX
Mathematica Commands				Function
f[x] 						Defines f as an expression or a function with an argument x
f[x, y]						Defines f as an expression or as a function with arguments x & y
f[x_]: = 						Defines f with any argument, named x
Table [x^2, {x, 0, 10}				Makes a table of  (x^2) value for x-values from 0 to 10.  
ListPlot [data, PlotJoined->True]		Plots the list of points called data and joins the points.            
Plot[f(x), {x, x1, x2}]				Plots y = f(x) in the x-range, x1 to x2.
Plot3D[f(x, y), {x, x1, x2}, {y, y1,y2}]		3D Plot of a z = f(x, y) in the x-range x1- x2 and y rage y1- y2
ContourPlot[f(x,y),{x,x1,x2},{y,y1,y2}]		Contour plots the relation between x & y for given value of z in z = 						f(x, y)
ParametricPlot[{f(x), f(y)}, {t, t1, t2}]		Graphs a parametric plot of f(x), y(x) for t-range t1-t2
ParametricPlot3D[{f(x),f(y),f(z), {t, ..  ]		Graphs a 3D Parametric Plot of f(x), f(y), f(z) for t-range t1 - t2

I.   Functions: The f[x] and f[x_] Expressions
Let X and Y be sets of real numbers.  A real-valued function f of a real variable x from X to Y is a correspondence that assigns to each number x in X exactly one number y in Y.  The set X is called the domain of f.  A subset of Y that consists of all images of numbers in X under f is called the range of the function.  This relation can be denoted as y = f(x).  The variable x is called independent variable, its image under f, is called dependent variable (y).

A function is a special kind of relation.  A relation is an arbitrary set of ordered pairs.  Whereas, a function is a set of ordered pairs such that no two distinct pairs have the same elements.  For example, the pairs (1, 2) and (1, 3) can be pairs of a relation, but not pairs of a function.  

Example: Which of the following two graphs represents a functional relationship?


                                      Graph 1: y = (x^2)

                                       Graph 2:  (y^2) = x
Solution:  It is apparent from graph 1 that for every value of x there is only one value of y.  In other words, any vertical line will cross the graph 1 only at one point.  Therefore, the first graph represents a function.  Any vertical line will cross  the second graph in two points.  Therefore,  the second graph does not represent a function.  
When a variable y is a function of a variable x,  the y in y = f(x) represents the value of the function.  The values of a function are the numbers in its range.  In Mathematica, a function of x is defined by "f[x_]".  That is y = f(x) = (x^2) + 2x is define as f[x_] := x^2 + 2x or f[x_] = x^2 + 2x.  The ":" preceding equality sign suppresses the output during operation.

Example:  Find the values of the function y = f(x) = x3 - 3x2 + 5 for x = 3 and x = -10.
Solution:  By substituting for x in y = f(x), the corresponding values of y can be found as, y = f(3) = (3^(3 ))- 3(3^2) + 5 = 5 and y = f(-10) = (((-10))^3)-3(((-10))^2)+ 5 = -1295.
In Mathematica, define the function as f[x_] = x^3 - 3x^2 + 5 and find the y values by finding f[3] and f[-10].  Note that, if you define the function as f[x_] :=  the output will be suppressed during the calculation.
Clear[x]
f[x_] =  x^3  -  3  x^2  +  5
5 - 3 (x^2) + (x^3)
f[3]
5
f[-10]
-1295

Implicit Functions:  A relation between x and y may be given in explicit form as y = f(x).  A relation may be given by an equation of the form  F(x, y) = 0  where, F denotes a real function of two real variables x and y.  For this equation to hold, it is clear that x and y are not independent of each other.  For every value of x there is one or more value for y.  The equation F(x, y) = 0 determines a relation.  However, it may give rise to one or more functions.  Such functions are called implicit function.

Example: The equation 2x - 3y + 6 =0 is an implicit relationship between x and y. Write the function in explicit from and find the values of y for x = 10 and x = -1.  
Solution:  The explicit function can be derived from this relation by solving the equation for y,  y = (2/3)x + 2.  By substituting for the given x values, y = (26/3) for x = 10 and y = (4/3) for x = -1.  
In Mathematica, solve the equation for x and define a function whose argument is the solution to the equation.
Clear[x,  y,  sol]
sol=Solve[2  x - 3  y + 6 == 0,  y] 
{{y -> ((2 (3 + x))/3)}}
The preceding command solves y in terms of x and sets the results equal to sol.  To express the functional from so that it can be evaluated for the given values of x , use the following command to form y = f(x) = solution of the equation (sol)
y[x_] = y /. sol[[1]]
((2 (3 + x))/3)
now that y is defined in terms of x, its values for x = 10 or x = -1 or any other number can be evaluated through y[10] and y[-1] or other values of x.
y[10]
(26/3)
y[-1]
(4/3)

Example:  Using the following implicit relationship between x and y,  y - xy + 2x - 10 = 0, define y as an explicit function of x .  Find the values of y for x = 105 and x = 1. 5.
Solution:  Factor out y as y(1-x) + 2x - 10 = 0 and solve the equation for y, y = ((10  -  2  x)/(1  -  x)).  Substitute for the given x values to find the corresponding y values.  For x = 105, y = (25/13)and for x = 1.5, y = -14.  
In Mathematica, solve the equation for x and define a function whose argument is the solution to the equation.  Then, find the value of the function for x = 105 and x = 1.5.  
Clear[x,  y,  sol]
sol  =  
            Solve[y  -  x y  +  2  x  -  10  ==  0,  y];
y[x_]=y/.sol[[1]]

((2 (-5 + x))/(-1 + x))
y[105]
(25/13)
y[1.5]
-14.`

Example:  The equation  y2 - xy + x2 - 10 = 0  gives rise to two explicit functions as shown in solution below.  Write the two explicit function for y and find the two values of y for x =  3.  
Solution:  y = \(TraditionalForm\`\(x\ \( + \&_\)\ \@\(x\^2\  - \ 4 \((x\^2\  - \ 10)\)\)\)\/2\) = \(TraditionalForm\`\(x\ \( + \&_\)\ \@\(\(-\ 3\) x\^2\  + \ 40\)\)\/2\).  By substituting for x = 3, (Subscript[y, 1]) = ((3   -  (Sqrt[13]))/2)and (Subscript[y, 2]) = ((3  +  (Sqrt[13]))/2).
In Mathematica, solve the implicit equation for x and define two functions whose arguments are the solutions to the equation.  The following commad solves the equarion for x.
Clear[x,  y,  sol]
sol = Solve[y^2  -  x y  +  x^2  - 10 == 0,  y]
{{y -> (1/2) (x - (Sqrt[40 - 3 (x^2)]))}, {y -> 
            (1/2) (x + (Sqrt[40 - 3 (x^2)]))}}
The following commands sets y1[x_] and y2[x_] equals to the solution one and solution two of the equation.
y1[x_] = y /. sol[[1]]
y2[x_] = y /. sol[[2]]
(1/2) (x - (Sqrt[40 - 3 (x^2)]))
(1/2) (x + (Sqrt[40 - 3 (x^2)]))
The followwing commands finds the  values of the y1 and y2 for x = 3.
y1[3]
(1/2) (3 - (Sqrt[13]))
y2[3]
(1/2) (3 + (Sqrt[13]))
Note that, since the equation has two solutions, two different functions are produced, one for each solution.  y1[x_]=y/.sol[[1]] is the function generated from the first solution and y2[x_]=/.sol[[2]] is the function produced for the second solution. 

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.  At any point on PPF, the slope of the PPF represents the relative price or the opportunity cost of attaining an extra unit of one good at the cost of giving up some units of the other goods.  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.  Graph the PPF.  Given that the slope of the PPF is m = ((-x)/(9  y)), find the slope at x quantities of 1, 2, and 3.  Show that when more x is produced it has higher opportunity cost in terms of the number of units of y that must be given up to produce one more unit of x
Solution:  The function represents an ellipse with x intercept of 9 and y intercept of 3.  Finding few other points helps to graph the function.  The following graph shows the trade-off  between x and y on the PPF.


To find the slope at the given points, find the y values corresponding to the given x values and substitute for x and y in m = ((-x)/(9  y)).  At x = 1, y = 2.98, and m = -.037.  That is the opportunity cost of producing one more unit of x at this point is to give up .037 units of y.  At x = 2, y = 2.92, and m = -.076.  That is, at this point to have one more unit of x, .076 units of y should be sacrificed.  At x = 3, y = 2.85, and m = -.118, which means at this point .116 units of y must be given up to have one extra unit of x.  The changes in m show that as more and more of x is produced the opportunity cost of producing it increases.  That is the PPF is an inceasing opportunity cost PPF.
To graph the PPF using Mathematica, first solve y in terms of x then graph y.
Clear[x,  y,  sol]
sol  =  Solve[x^2 + 9  y^2 == 81,  y];
y2[x_] = y /. sol[[2]];
Plot[y2[x], {x,  0,  9},AxesLabel -> {"X", "Y"} ]

To find the y values corresponding to x = 1, 2, and 3, use the following commands
N[y2[1]]
N[y2[2]]
N[y2[3]]
2.9814239699997196`
2.9249881291307074`
2.8284271247461903`
To evaluate the slope m at (1, 2.98), (2, 2.92). and (3, 2.63), first define m then evaluate it at the given points.
m =  -x/(9  y);
m /. {x -> 1, y ->  2.98}
m /. {x -> 2,  y -> 2.92}
m /. {x -> 3,  y -> 2.83}
-0.037285607755406416`
-0.076103500761035`
-0.11778563015312132`

Do More Practice:
1-  Change the constant in the PPF above from 81 to 144.  Find the y values corresponding to x = 1, 2, and 3.  Find the solpe of the PPF at x = 1, 2, 3 and their corresponding y values.  Show that, although the size of the economy (represented by the PPF) is grown, the slope at the given points have not changed.  
2-  Change the PPF function to  9(x^2)+ (y^2) = 81.  Graph the PPF.  Find the y values corresponding to x = 1, 2, and 3.  Find the solpe of the PPF at x = 1, 2, 3 and their corresponding y values.  Compare the results with case 1.   
3- Suppose the PPF is given as x + 3y = 9.  
a- Graph the PPF
b- Find the values of y for x = 1, 2, and 3.
c- How much of y is given up each time to have one more unit of x?
d- Find slope of the PPF at the given points above.  Show that this PPF is a constant opportunity cost PPF.

Problems:
1- Write consumption as a function of income.  Define the domain and the range of the function.
2- Write a demand function expressing quantity demanded as a function of price. Define the domain and the range of the function.
3- Express the trade-off between inflation and unemployment in a functional form. Define the domain and the range of the function.
4.  Write the following relationships between x and y in the explicit forms and evaluate y for the values of x = 1 and x = 5.
	a)  3x + 2xy + 6y + 10 = 0
	b)  (x^2) y +  2x - xy + 2(x^2) - 4y + 10 = 0
	c)  \(TraditionalForm\`\(\(x\^2\  - \ xy\  + \ 
          y\^2\)\(\ \)\(=\)\(\ \)\(10\)\(
\)\)\)
	d)  2x + (x^(2 ))- (x^2) (y^2) + 3(y^2) - 5 = 0
5- Suppose that the production possibilities frontiers (PPF) of an economy is represented by 25(x^2)+ 9(y^2) = 2025, where x and y are quantities of the two goods, food and fun, produced given the limited resources.  Graph the PPF.  Given that the slope of the PPF is m = ((-25 x)/(9  y)), find the slope at x quantities of 1, 2, and 3.  Show that the PPF is an increasing opportunity cost PPF.	

II.  Types of Functions and Their Graphs: The Plot Command
Functions are mainly of two types:  Algebraic functions,  generated by algebraic operations on a variable.  Examples of algebraic functions are polynomial functions, rational functions, and other explicit algebraic functions.  Transcendental functions include logarithmic, exponential, and periodic functions.  

Plotting a function without using graphic calculator or computer program requires finding the intercepts of the function (y-intercept and x-intercept), finding critical points of the function (maxima, minima, and inflection points), and finding the asymptotes of the function (convergence to a horizontal, vertical, or slant line as x or y converges to infinitely large numbers).  A more systematic way of graphing functions will be discussed in later chapters.  Here, we will utilize Mathematica to graph different types of functions to have a better understanding of the shape of the functions as their algebraic form or parameters change.  To graph the relationship between x and y of y = f(x) in the x-range of (Subscript[x, 1]) to (Subscript[x, 2]), use the command Plot[y, {x1, x2}] or Plot[f(x), {x, x1, x2}].   The command  "AxesLabel -> {"X", "Y"}" may be used for labeling the axes.  

Polynomial Functions  are the simplest of algebraic functions.  Such functions have the property of being smooth and continuous.  A polynomial function has the following form  y = f(x)  = a1xn  +  a2xn-1  + ......... +  anxn-n .  The highest exponent of the polynomial function defines its degree.  For example, y = f(x) = 3x + 6, y = f(x) = 2(x^2) - x - 5, and  y = (x^3) + 2(x^2) + 3x +10 are first degree, second degree, and third degree polynomials, respectively.  In the following examples several polynomial functions are graphed and their shapes are explained. 

Example: First-Degree Polynomial - Equation of a Line 
Graph the relationship between x and y for y = f(x) = 3x + 6 in the x-range of -10 to 10. 
Solution:  A first-degree polynomial is the equation of a line.  To draw the line, find two points of the line and join them.  Set x = 0 to find the y-intercept (y = 6).  Set y = 0 to find x-intercept (x = -2).  Given the two points, draw the line.   
Using Mathematica command "Plot" the line can be graphed as, 
Clear[x,  y]
y = 3  x + 6
Plot[y, {x,  -10, 10}, AxesLabel -> {"X", "Y"}]
6 + 3 x

⁃  Graphics  ⁃
Do More Practice:
1.  Change the slope coefficient to . 3 and draw the line.
2.  Change the slope coefficient to -3 and draw the line.
3.  Change the intercept to zero and draw the line.
4.  Change the intercept to -6 and draw the line.

Example: Linear Demand Function
An airline has been selling its round-trip tickets for flight between Los Angeles and Chicago at $450 each.  At this rate the company has been selling 800 round-trip tickets a week.  A survey indicates that for each $20 rebate offered, the number of round-trip travelers will increase by 50 per week.  Find the demand function of the airline and graph it.  Find the total revenue function for the flights between Los Angeles and Chicago.
Solution:  Conventional demand function assumes price to be presented by the vertical axes and quantity by the horizontal axes.  The equation of the demand can be written as P = mQ + c, where P is the price, Q is the quantity, m is the slope of the demand line and c is the P intercept.  The slope of a line is the ratio of rise to run, or m = (((Subscript[P, 2]) -  (Subscript[P, 1]))/((Subscript[Q, 2]) -  (Subscript[Q, 1]))) = ((430  -  450)/(850  -  800)) = ((-20)/50) = -.4.  To find c, substitute in P = mQ + c for a point and m as, 450 = -.4 (800) + c or c = 770.  Therefore, the demand function is P = -.4Q + 770.  Total revenue (TR) is, TR = P.Q.  Multiply P by Q to get the total revenue as TR = -.4(Q^2) + 770Q.  The demand function can be graphed by finding two points of the line and drawing the line.  Below the demand function is graphed using Mathematica.
Clear[P, Q]
Plot[- .4 Q + 770,{Q, 0, 1000}, AxesLabel -> {"Q", "P"}]

⁃  Graphics  ⁃

Second-Degree Polynomial: A second degree polynomial has a standard shape, a parabola.  The function is either concave upward or concave downward, with a vertex and a symmetry about the y-axis or a line parallel to y- axis.  The function, also called quadratic function, is of the general form y = f(x) = a(x^2) + bx + c.  This function has a y-intercept of (0, c), x-intercepts (derived by setting a(x^2) + bx + c = 0 and solving for x), (((-b + (Sqrt[(b^2) - 4  ac]))/(2  a)), 0) and  (((-b - (Sqrt[(b^2) - 4  ac]))/(2  a)), 0), and the vertex of (((-b)/(2  a)), f(((-b)/(2  a)))).  The vertex of the functions lies on the line of symmetry  x = ((-b)/(2  a)).  If b= 0, the y-axis is the line of symmetry. If a > 0, the parabola is concave upward.  If a < 0, the parabola is concave downward. Once the intercept points and the vertex are located, the function can be graphed by joining the points and using the symmetry property of the parabola around the line paralell to y-axis and passing through the vertex x = ((-b)/(2  a)).

Example:  Graph the relationship between x and y for y = 2(x^2) - x - 5 in the x-range of -3 to 3.  
Solution:  For this function , the y intercept is (0, -5), the x-intercepts are (((1 + (Sqrt[41]))/4), 0) and (((1 - (Sqrt[41]))/4), 0), the line of symmetry is x = (1/2), the vertex is ((1/2), -5), and the parabola is concave upward.
Using Mathematica command "Plot", the function is graphed below for the x range -3 to +3,  
Clear[x,  y]
y = 2  x^2  - x  - 5
Plot[y, {x,  -3, 3}, AxesLabel -> {"X", "Y"}]
-5 - x + 2 (x^2)

⁃  Graphics  ⁃

Do More Practice:
1. Change the coefficient of (x^2) to -2 and graph the function.  Observe the changes in concavity (the new function will be concave down).
2.  Change the coefficient of x to zero and graph the function.
    
Example: Total Revenue Function of a Linear Demand Function
For the linear demand function of the example above (Linear Demand Function) graph the demand and total revenue functions.  Graphically show that total revenue is maximum at the middle point of the linear demand line.  What is the price elasticity of demand at this point? (Note: price elasticity of demand (Subscript[ξ, p])= ((ΔQ  %)/(ΔP  %)) = Δ(Q/Δ)P.(P/Q))
Solution:  The demand function of the example is P = -.4Q + 770 and the total revenue function is TR = -.4(Q^2) + 770Q.  The total revenue function is a second degree polynomial.  To graph the total revenue, the function has a vertex and line of symmetry of Q = ((-b)/(2  a)) = (770/(. 8)) = 962.5.  Since a < 0, the parabola is concave downward.  The parabola has Q-intercepts of zero and 1925.  Using these information the total revenue function can be graphed.
Below the total revenue and demand functions are graphed for the Q range 0 to 2000 using Mathematica command "Plot".
Clear[P, Q, TR]
TR = - .4 Q^2 + 770  Q;
P = - .4 Q + 770;
Plot[TR,{Q, 0, 2000}, AxesLabel -> {"Q", "TR"}]
Plot[P,{Q, 0, 2000}, AxesLabel -> {"Q", "P"}]


⁃  Graphics  ⁃

⁃  Graphics  ⁃
The graphs clearly show that TR is maximum at the middle of the linear demand curve.  The Q-intercept of the demand line is Q = 1925 units, where (1925/2)= 962.5 units.  The vertex of the TR is also at Q = 962.5 units.  
To find the price elasticity of demand, the revenue-maximizing quantity is Q = 962.5 and the revenue-maximizing price is P = $385 (the mid-point between zero and P-intercept).  The slope of the demand line is Δ(P/Δ)Q= -.4 or Δ(Q/Δ)P= -2.5.  Therefore, (Subscript[ζ, P]) = Δ(Q/Δ)P.(P/Q)= -2.5(385/9625)= -1.  

Example:  Third-Degree Polynomial
Graph y = (x^3) + 2(x^2) + 3x + 10 in the x-range -5 to 5.
Solution:  A third degree polynomial has a general form y = f(x) = a(x^3)+ b(x^2) + cx + d, with a y-intercept of (0, d) and a rotational symmetry of (180^o) around x = ((-b)/(3  a)).  The point of symmetry is (((-b)/(3  a)), f(((-b)/(3  a)))).    If a > 0, the function starts from the from South-west of the third quadrant and rises up to the north-east of the first quadrant, with possible vertices in between.  If a < 0, the function starts from the north-west of the second quadrant and declines to south-east of the fourth quadrant, with possible vertices in between.  For the function above the y-intercept is (0, 10) and the point of symmetry is (((-2)/3), (232/27)).  Since a > 0, the function's extreme points will be in the third and first quadrant.  These information and few other points of the function are list in table below.  The table helps with plotting the function.
({{x, -∞, -1, ((-2)/3), 0, 1, +∞}, {f (x), -∞, 8, 8.59, 10, 16, +∞}})
Using Mathematica, the function is graphed for the x range -5 to +5 as,   
Clear[x,  y]
y = x^3  +  2  x^2  +  3  x  +  10;
Plot[y, {x,  -5,  5}, AxesLabel -> {"X", "Y"}]

⁃  Graphics  ⁃

Do More Practice:
1.  Change the coefficient of (x^3) to -1, keeping others coefficients the same as in the example.  Graph the function and compare it to the graph in the example.
2.  Change the coefficient of x to -3, keeping other coefficients the same as in the example.  Graph the function and compare it to the one in the example.
3. Change the coefficient of (x^2) to zero, keeping other coefficients the same as in the example.  Graph the function and compare it to the one in the example.
4.  Change the coefficient of x to zero, keeping other coefficients the same as in the example.  Graph the function and compare it to the one in the example.

Example:  Higher-Degree Polynomials
Graph the functions y = f(x) = 2(x^4) - (x^3)+ 5x  + 12 and y = f(x) = (x^(5 ))+ 2(x^4)- 5(x^3)+ 2(x^2) -10.
Solution:  Polynomials of higher degree where the highest exponent is an even number have a shape similar to second-degree polynomials.  The shape of the higher degree polynomials where the highest exponent is an odd number is similar to the shape of third-degree polynomials.  Business and economic problems randomly utilize polynomials of higher than third degree.   The graph of the functions are as shown below using the Mathematica command "Plot" for the x-range -10 to +10. 
Clear[x,  y]
y  =  2  x^4 - x^3 + 5  x + 12;
Plot[y,  {x,  -10,  10}]

(Null^2) (⁃  Graphics  ⁃)
Clear[x,  y]
y  =  x^5 + 2  x^4 - 5  x^3 + 2  x^2 - 10;
Plot[y, {x,  -10,  10},AxesLabel->{"X", "Y"}]
 

⁃  Graphics  ⁃

Do More Practice:
1.  Graph y = f(x) = (x^4)+ 2(x^3)-3(x^2)+ 5x -10.
2.  Change the coefficient of (x^4) in the function of practice 1 to -1 and graph the function.
3.  Graph y = f(x) =  (x^5)+ 3(x^4)+ 2(x^3)-3(x^2)+ 5x -10.
4.  Change the coefficient of (x^5)in the function of practice 3 to -1 and graph the function.

Polynomial functions have many applications in economic theory.  For example, the relationship between variable input and output or total cost and output are, generally, best expressed by a third-degree polynomial.  The relationship between total revenue and sales is usually a second-degree polynomial.

Example:  Production Function
The production function, Q = 5000L2 - 80L3, expresses output (Q) in terms of labor input (L).  Plot the production function and find the value of Q at L = 30.
Solution:  The function is a third degree polynomial with a rotation symmetry around ((-b)/(3  a)) = (5000/2400) and Q-intercept of (0, 0).  Finding few more points helps to have a better sketch of the graph.  The general shape of the function in the L-range -100 to 100 is as follows,


However, since Q represents a production function and Q and L are both positive numbers, the function should be graphed in the acceptable range of L, say the L-range of 0 to 50.  


Using Mathematica command "Plot", the function can be graphed as,
Clear[L,  Q]
Q =  5000  L^2 - 80  L^3;
Plot[Q, {L,  0,  50}, AxesLabel -> {"L",  "Q"}]

To find the value of Q at L = 3, substitute for L in the equation to find Q = 2340000.  Using Mathematica,
Q/.L->30

2340000

Example: Cost Function
Total cost (TC) of a firm as a function of output (Q) is given as TC = .1(Q^3)-3.6(Q^2)+ 45Q + 100.  Graph the function and find the total cost of producing 30 units of output.
Solution:  The function is a third degree polynomial with a TC intercept of (100, 0), rotational symmetry at ((-b)/(3  a)) = (3.6/(. 3))= 12, and point of symmetry (12, 294.4).  Since a is positive, the curve moves up from third to first quadrant.  By finding few more points, the function can be graphed.


However, since Q >0, using Mathematica the total cost function is graphed in the acceptable range of Q as,
Clear[TC,  Q]
TC  =   .1  Q^3 - 3.6  Q^2 + 45  Q + 100;
Plot[TC, {Q,  0,  40},AxesLabel->{"Q", "TC"}]

⁃  Graphics  ⁃
To find TC corresponding to 30 units of Q, substitute for Q in the equation to get TC = 910.  Using Mathematica, TC is found as 
TC /. Q -> 30
910.`

Example:  Revenue Function
Demand for a product is given as Q = 100 -10P, where Q is quantity demanded and P is the price.  Find the total revenue as a function of price and graph the function.  Find the revenue corresponding to P = $4.
Solution: Total revenue (TR) is equal to price times quantity, TR = P.Q.  Therefore, TR = 100P -10P2 .  This is a second degree polynomial with a line of symmetry P = ((-b)/(2  a))= 5 and a vertex (5, 250), and TR-intercept (0, 0).  Using this information the function can be graphed.  Using Mathematica, the graph is,


Clear[p,  tr]
Clear[p,  tr]
tr =  100  p  -  10  p^2
Plot[
            tr,  {p,  0,  10},   AxesLabel -> {"P",  "TR"}]

To find total revenue corresponding to P = 4, substitute for P in the TR equation to get TR = 240.   
tr/.p->4				
240

Rational functions:  Rational functions are derived by forming ratios of polynomial functions.  Examples of rational functions are  y = f(x) =((x   -  1)/(x  +  1)), x ≠ -1, and  y = f(x) = ((x  -  1)/((x^2)  -  x  -  2)) ,   x ≠ -1 & 2.  There is not a single shape that describes the graphs of all rational functions.  The shape of the graphs depends on the degree of the polynomial on the numerator and denominators, the zeroes of the polynomials in the denominator, and the asymptotes of the function.  

The horizontal asymptotes of a function are the y-values of the function as x approaches to \(TraditionalForm\`+\&_\) ∞ . They are derived by finding the limit of f(x) as x->\(TraditionalForm\`+\&_\) ∞.  The limits of the functions will be studied in chapter 6.  The vertical asymptotes of a function are the x-values of the function as y approaches to \(TraditionalForm\`+\&_\) ∞.  They are found by finding the zeroes of the polynomial in the denominator.  Here, it helps to know that, in general, if the numerator and denominator of a rational function are of the same degree, as x->\(TraditionalForm\`+\&_\)∞, lim f(x) approaches to the ratio of the coefficients of xs that have the largest exponent in the numerator and the denominator.  If the degree of the polynomial in the denominator is larger than the degree of the polynomial in the numerator, the function has y = 0 as its horizontal asymptote.  If the degree of  the polynomial in the numerator is larger than the degree of the polynomial in the denominator, the function may have a slant asymptote. 

Example:  Graph y = f(x) = ((x   -  1)/(2  x  +  1)).
Solution:  The function has a vertical asymptote at x = -(1/2) (this is derived by finding the zeroes of the denominator), and a horizontal asymptote at y = (1/2) (this is found by finding Lim (Subscript[(f(x)), x -> ∞]), which is the ratio of the x-coefficients in the numerator and denominator).  The function has an x-intercept of (1, 0) and y-intercept of (0, -1).  These information are summarized in table below.  
({{x, -∞, -(1/2), 0, (1/2), 1, +∞}, {f (x), (1/2), +∞ | -∞, -1, -(1/4), 0, (1/2)}})  
The table helps with graphing the function as shown below.


Using Mathematica, the function can be graphed as,
Clear[x,  y]
y  =  (x - 1)/(2  x + 1);
Plot[y, {x,  -10,  10},AxesLabel -> {"X", "Y"}]

Example:  Graph y = f(x) = ((x  +  2)/((x^2)  - 5 x  +  4)).
Solution:  The function has two vertical asymptote at x = 1 & 4 (these are derived by finding the zeroes of the denominator), and a horizontal asymptote at y = 0 (this is found by finding Lim (Subscript[(f(x)), x -> ∞]).  Since the degree of the polynomial in the enumerator is larger than the degree of the polynomial in the numerator, as x->\(TraditionalForm\`+\&_\) ∞, y->0).  The function has an x-intercept of (-2, 0) and y-intercept of (0, (1/2)).  These information are summarized in table below.  
({{x, -∞, -2, 0, 1, 2, 3, 4, +∞}, {f (x), 0, 0, (1/2), +∞ | -∞, -2, -2.5, -∞ | +∞, 0}})
The table helps with graphing the function as shown below.


Using Mathematica, the function is graphed as,
Clear[x,  y]
y  =  (x + 2)/(x^2 - 5  x + 4);
Plot[y, {x,  -8, 8},AxesLabel->{"X", "Y"}]	

Do More Practice:
1. Change the denominator of the function to (x^2)- 4x + 4.   This give the denominator a multiple zero of x = 2.  Graph the function and observe the changes.
2. Change the denominator of the function to (x^2)- 4x + 5.   In this case the denominator has no zeroes.  Graph the function and observe the changes.  
3. Graph y = (((x^3) +  1)/((x^2)  +  3  x   -  4)).  This function has slant asymptote y = x - 3.  
  
Example: Present Value of Constant Cash Flows
Suppose a constant stream of income at the amount of $R is accrued at the end of each year for the next n years.  The present value of this cash flow at a discount rate of r can be formulated as PV = \(TraditionalForm\`∑\+\(t = 1\)\%n R\/\^\(\((1\  + \ r)\)\^t\)\) .  If the stream of income is accrued forever, the present value of the perpetuity equals to PV = (R/r).  That is, PV is an inverse function of r.  With a numerical values of  R = $100, the relation between PV and can be graphed at the r range of 1% to 100as,


Using Mathematica, the problem can be formulated and graphed as follows. 
Clear[R, r, PV]
PV=(100/r);
Plot[PV, {r,   .01,  .2},  
          AxesLabel -> {"r", "PV"}]

Example: Constant Elasticity Demand Function
Demand for a product is given as Q = (100/P).  Graph the demand function and find the price elasticity of demand. 
Solution: The conventional demand shows P in the vertical axes and Q in the horizontal axes.  Following this convention, the function can be written as P = (100/Q).  This function has a horizontal asymptote at Q = 0 and a vertical asymptote at the P = 0.  The function is a decreasing function as Q increases.  The plot of function is shown below.   
Clear[p,  Q]
Plot[100/Q, {Q,   .1,  5},AxesLabel->{"Q", "P"}]

⁃  Graphics  ⁃
 Note: To avoid division by zero, the domain of the function is defined from .1 to 5.  
The demand function above has a property that price elasticity of demand, defined as (Subscript[e, p]) = ((ΔQ  %)/(ΔP  %)) is the same everywhere along the demand curve, ((Subscript[e, P]) = 1).  This is because (Subscript[e, p]) = ((ΔQ  %)/(ΔP  %)) = Δ(Q/Δ)P.(P/Q), where Δ(Q/Δ)Pis the slope of the demand function.  Since P.Q = 100, Δ(Q/Δ)P= (Q/P) and the elasticity (Subscript[e, p]) = 1.   

Explicit Algebraic Functions:  Algebraic functions are generated by the application of some of the algebraic operations on x.  Examples are y = f(x) = (Sqrt[(x^2)  -  4])  and Y = f(x) = ((Sqrt[1  +  x])/(Sqrt[1  +  (x^2)])).  To graph the algebraic functions, define the domain of the function, find the asymptotes if any exists, find the x and y intercepts and sketch the graph.  The following examples show the graphs of the few explicit algebraic functions.

Example:  Graph y = f(x) = (Sqrt[(x^2)  -  4]).
Solution:  The domain of the function is x ≤ -2 and x ≥ 2.  For -2 < x < 2 the function is not defined.  The function has x-intercepts at x = -2 & 2.  Finding few more points helps to graph the function.  
Using Mathematica, the graph of the function is,
Clear[x,  y]
y = Sqrt[x^2  -  4];
Plot[y,{x, -5, 5},AxesLabel -> {"X", "Y"}]

⁃  Graphics  ⁃

Example:  Graph y = f(x) = ((Sqrt[1  +  x])/(Sqrt[1  +  (x^2)])).
Solution:  The domain of the function is x ≥ -1.  For x < -1 the function is not defined.  The function has an x-intercept at x = - 1 and an asymptote at y = 0 .  This is because the degree of the polynomial in the denominator is larger than the degree of the polynomial in the numerator.  As x->\(TraditionalForm\`+\&_\) ∞, y->0.  Finding few more points helps to graph the function.  
Using Mathematica, the graph of the function is,
Clear[x,  y]
y  = Sqrt[1 + x]/Sqrt[1 + x^2];
Plot[y, {x, -1, 20},AxesLabel -> {"X", "Y"}]

⁃  Graphics  ⁃

Exponential Functions:   The general form of exponential functions is y = f(x) = bx, where  b  is positive and x is a real number.   This function has the property that the range of y is the set of positive real numbers.  Exponential functions of this form are  continuous and strictly increasing if b >1, and continuous and strictly decreasing if b < 1.  

Example:  Graph y = (2^x).
Solution:  Since b > 1, the function is strictly increasing.  As x -> +∞, y -> +∞.  As x -> -∞, y -> 0.  Therefore, y = 0 is the horizontal asymptote.  At x = 0, the y-intercept is y = 1.  Using these information the function can be graphed as,  


Using Mathematica, the graph of the function is,
Clear[x,  y]
y  =  2^x;
Plot[y,{x, -5, 5},AxesLabel -> {"X", "Y"}] 

⁃  Graphics  ⁃

Example:  Graph y = ((((1/2)))^x).
Solution:  Since 0 < b < 1, the function is strictly decreasing.  As x -> +∞, y -> 0.  Therefore, y = 0 is the horizontal asymptote.  As x -> -∞, y -> +∞.  At x = 0, the y-intercept is y = 1.  Using these information the function can be graphed as, 


 Using Mathematica, the graph of the function is,
Clear[x,  y]
y  =  (1/2)^x;
Plot[y,{x, -5, 5},AxesLabel->{"X", "Y"}]

⁃  Graphics  ⁃
                      
Example:  Investment
Plot the time path of the values of $100 invested at an annual rate of 5%.  What is the value of the investment after 5 years?
Solution:  Use the compounding formula S = A(((1 + r))^t), where S is the compounded value after t years, A is the initial value, and r is the interest rate, to formulate the problem as S = 100(1 + .05)t .  Since b = 1.05 > 0, the exponential function is increasing function with a S intercept of (0, 100).  The function is graphed below.
Clear[S,  t]
S  =  100 (1 +  .05)^t;
Plot[S, {t,  0,  30},AxesLabel->{"t", "S"}]

⁃  Graphics  ⁃
For t = 5, S = 127.63.
S /. t -> 5
127.62815625000002`

Example:  Depreciation
The half-life of a machine with an initial value of $120000 is 5 years.  Find a model that shows the value of the machine after t years.  Find the depreciated value of the machine after 20 years.
Solution:  The half-life of five years means that every five years the machine loses half of its value.  Therefore, the value of the machine is depreciating according to an exponential function model V = 120000((((1/2)))^((t/5))).   At this rate of depreciation, the value of the machine is $60000 after 5 years, $30000 after 10 years and so on.  After 20 years, the value of the machinery is V = 12000((((1/2)))^4) = $750.  Using Mathematica, the graph of the function is 
Clear[V, t]
V = 12000 (1/2)^(t/5);
Plot[V, {t, 0, 60}]

⁃  Graphics  ⁃
After 20 years, the depreciated value of the machine is $750.
V /. t -> 20
750

Logarithmic Functions:   Every exponential function of the form  y = f(x) = bx  can be transformed to (Subscript[log, b])y = x.  The graph of logarithmic functions are similar to the exponential functions.  In graphing logarithmic functions, you need to interchange only the x and y axis in the corresponding exponential functions.   The following figures compares graphs of  y = ex and lny = x.
Clear[x]
Plot[E^x,{x, -2, 2},AxesLabel->{"X", "Y"}]

⁃  Graphics  ⁃

Clear[y]
Plot[Log[y],{y, 0, 7},AxesLabel -> {"y", "x"}]

⁃  Graphics  ⁃
Example: Investment 
Plot the time path of an initial investment of $100 deposited at a continuously compounded interest rate of 5%.  What is the value of the investment after 5 years?
Solution:  The compounded value of an initial investment of A at a rate of r after t years can be found using equation y = A(e^rt).  Plot y = 100e.05t and find the value of y for t = 5.  Note that, you may graph y = 100e.05t or lny = ln100 + .05t.  The latter graph will provide you with a graph of lny.  To find y at time t = 5, substitute for t in the equation to get lny = ln100 + .25 = 4.86.  Take the anti log of 4.86 to find y = 128.40.
Clear[t,  y]
y  =  100  E^( .05  t);
Plot[y, {t,  0,  8},AxesLabel->{"t", "Y"}]


⁃  Graphics  ⁃
To find the value of y after 5 years substitute for t in the equation to get y = 129.40.
y /. t -> 5
128.40254166877415`

Example: Sales
The sales (y) of a new product is estimated as y = 28000(e^(((-4.62)/t))), where t is the number of years that the product has been in the market.  Graph the sales function and find how many units will be sold after thirty, forty, and fifty years.  Find the market saturation point. 
Solution:  To graph the function you may substitute few values for t and find the corresponding y values and plot the points.  It is clear that as t approaches infinitely large numbers, (e^(((-4, 62)/t)))approaches to one and y approaches 28000 units.  This is the market saturation quantity.  To find y after 30, 40, and 50 years, either substitute for t in the equation above and find the corresponding y values or find lny = ln28000 -(4.62/t) then substitute for the t-values of 30, 40, and 50.  In this case, you have to take anti log to find the corresponding values of y.
Using Mathematica, the graph and the solution of the problem is as follows,
Clear[y,  t]
y = 28000  E^(-4.62/t);
Plot[y,  {t,  1,  60}]

⁃  Graphics  ⁃
To find the value of y at thirty, forty, and fifty,
y /. t -> 30
y /. t -> 40
y /. t -> 50
24003.61658832081`
24945.776022638187`
25528.730652430775`
the number of units sold after 30, 40, and 50 years are 24003, 24945, and 25528, respectively.  To estimate the market saturation point, the graph of y shows that the S-shaped sales graph flattens around 25000 units of sale or after 40 years.  In the extreme case, as t->∞, y->28000.

Graphing Exponential Functions with Negative Base:  If the base of an exponential function is a negative number, the value of the function will oscillate as the exponent values changes from odd numbers to even numbers.  Graphing the function follows the same rules of graphing exponential functions with positive base, except for the fact that the function here will not be a smooth function.  

Example:  Graph y = (((-2))^x).
Solution:  For values of x = 0, 1, 2, 3, 4, ..., the values of the corresponding values of y = 1, -2, 4, -8, 16, ....  The graph of the function is,

In Mathematica, use the command  Table to generate the values for exponential function then use the ListPlot command to graph the function.
Clear[x,  y,  data]
data = Table[(-2)^x,  {x,  0,  10}];
ListPlot[data, PlotJoined -> True, AxesLabel -> {"x", "Y"}]


⁃  Graphics  ⁃

Example:  Graph y = (((((-1)/2)))^x).
Solution:  Since the base of the exponential function is a negative number, the function will oscillate with the odd and even values for x.  Find several values of y by substituting numbers for x and graph the function.  


Using Mathematica, make a table of values for y and ListPlot the data.
Clear[x, y, data]
data = Table[(- .5)^x, {x, 0, 10}];
ListPlot[data, PlotJoined -> True, 
          AxesLabel -> {"x", "Y"}]

⁃  Graphics  ⁃

Compound Functions:  A function that is specified by more than one expression is called compound function.  

Example:  Let f(x) = {({{\(2, \ \ \ \ \ \ \ \ \ \ \ \ \(\(if\ x\)\(\ \)\(≤\)\(\ \)\(0\)\(\ \)\)\)}, {2  -  x,  if x  >  0}}),  find f(-2), f(0), f(2) and graph the function.
Solution.  Here the value of x determines which expression to be used.  For x = -2 and x = 0, the values of f(-2) and f(0) are determined from the first expression and are equal to 2, respectively.  For x = 2, the value of f(2) is determined from the second expression and is equal to 0.  Below is the graph of the compound function.


To graph the function using Mathematica,
Clear[x,  p1,  p2]
p1 = Plot[2, {x, -5, 0}]
p2 = Plot[2 - x, {x, 0, 5}]
Show[p1, p2]

⁃  Graphics  ⁃


⁃  Graphics  ⁃


⁃  Graphics  ⁃

Example:  Sales
A manufacturer of T-shirts has three rates for the wholesale price of its popular Halloween T-shirts.  For quantities 0-100, the price is $5 each.  For quantities 101-320, the price follows p(q) = 5.  ((( .999))^((q - 100))), where q is the quntity.  Beyond 320 units, T-sirts are sold at the price $4.00 each.  Express the price quantity relations in the compund function form and graph the relation.
Solution:  Here the price is a function of  of quantity sold.  The compound function can be expressed as p(q) = {({{\(5, \ 
                    if\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0 < q\  ≤ 100\)}, {5.  ((( .999))^((q - 100))),  
                    if 101  < q ≤ 320}, {\(4, \ 
                    if\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ q > \ 320\)}})
The graph of the price function is as:


  
  Clear[q,  p1,  p2,  p3]
p1  =  Plot[5,  {q,  0,  100}]
p2  =  
          Plot[5 ( .999)^(q - 100),  {q,  100,  320}]
p3  =  Plot[4,  {q,  320,  400}]
Show[p1,  p2,  p3]

Periodic Functions:  Many business and economic variables have patterns that repeat.  A repeating pattern can best be represented by a periodic function.  A function  f  is periodic if there exists a positive real number  (c) such that  f(t + c) = f(t).  The smallest repeating portion of the periodic function is called cycle.  The reciprocal of the period ((1/period)) is called frequency.  The distance between the highest or lowest point of the graph of a periodic function and its axis is called amplitude.

An example of periodic function is sine and cosine functions.  A sine function, y = sin x has a period of 360o , frequency of (1/360), and amplitude of 1.

Example: Graph y = sin x
Solution:  The sine function has a values of zero at x = 0, π, & 2π, an amplitude of one at x = (π/2)& ((3  π)/2)and a periodicity of (350^o).  Using these information the graph of the function is as follows:


Using Mathematica, the function can be graphed as,
Clear[x]
Plot[Sin[x], {x,  0, 2  Pi},AxesLabel -> {"X", "Y"}]

Do More Practice:
1.  Graph the function in the example for x = 0 to x = 4π.
2.  Graph the function in the example for x = -2π to x = 2π.
3.  Graph y = 2sinx for x = 0 to x = 2π and compare it to the graph of y = sinx.
4.  Graph y = -sin x for x = 0 to x = 2π and compare it to the graph of y = sinx.
5.  Graph y = sin2x for x = 0 to x = 2π and compare it to the graph of y = sinx.
6.  Graph y = sin3x for x = 0 to x = 2π and compare it to the graph of y = sinx.
7.  Graph y = cosx for x = 0 to 2π.  Compare it to the graph of y = sinx.

Example: Graph y = tan(x)
Solution:  The tan function has a value of zero at x = 0 & π, values of 1 and -1 at x = (π/4) and x =((3  π)/4), respectively, and an asymptote at x = (π/2).  The function has a periodicity of (180^o).



Using Mathematica, the function can be grpahed as,
Clear[x]
Plot[Tan[x], {x,  0, Pi},AxesLabel -> {"X", "Y"}]

Do More Practice:
1.  Graph the function in the example for x = 0 to x = 2π.
2.  Graph the function in the example for x = -π to x = π.
3.  Graph y = 2tanx for x = 0 to x = π and compare it to the graph of y = tanx.
4.  Graph y = - tanx for x = 0 to x = π and compare it to the graph of y = tanx.
5.  Graph y = tan2x for x = 0 to x = π and compare it to the graph of y = tanx.
6.  Graph y = tan3x for x = 0 to x = π and compare it to the graph of y = tanx.
7.  Graph y = cotx for x = 0 to π.  Compare it to the graph of y = tanx.


Example:  GDP Growth
Plot the time path of GDP for an economy which is growing at an average annual rate of 6% and experiences the standard business cycles of expansions and recessions with peaks and troughs of +  25% average growth.
Solution:  The GDP growth function (y) has a trend growth of 6% which can be expressed as y = .06t plus cycles with amplitudes of 25% over and below the trend.  Thus, the overall function can be expressed as y = .06t + .25sint.  By substituting values for t the function can be graphed as,


Using Mathematica, the graph of the function is,
Clear[t]
Plot[ .06  t  +   .25  Sin[t], {t,  0,  30},AxesLabel->{"t", "Y"}]

Problems
1- If y = f(x) = 2x2 - x + 1, find
       a) f(0)          c) f(-1)          e) f(x + h)
       b) f(1)          d) f(a)           f) f(x + h) - f(x)
2-  If y = f(x) = (((x^2)  -  9)/(x  -  3)),  find 
       a) f(0)      c) f(3)        e) f(x + h)
       b) f(1)      d) f(a)        f) f(x + h) - f(h)
3-  State the degree of each of the following polynomials
a)   3x4 + 2x2 - 5        
b)   2x + 5       
c)   10
5-  Find f(-1), f(0), f(1) for the following compound function, f(x) = {({{\(5, \ \ \ \ \ \ \ \ \ \ \ \ \(\(if\ x\)\(\ \)\(≤\)\(\ \)\(0\)\(\ \)\)\)}, {5  +  x,  if x  >  0}}).  Graph the function
6- Find f(-5), f(-1), f(0), f(1), and f(5) for the following Compound function, f(x) = {({{\(0, \ 
                    if\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x\  ≤ 0\)}, { .5  (x^2)  - 3  x ,  
                    if           0 < x ≤ 1.5}, {\(1.5, 
                    if\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x > \ 3\)}}).  Graph the function.
4- A movie theatre with a capacity of 350 seats has been selling tickets at a price of $7.50 each.  At this rate the theatre has been selling 150 tickets a day.  A survey indicates that for each 50 cents rebate offered, the number of tickets sold will increase by 30 per day.  Find the demand function of the movie theatre and graph it.  Find the total revenue function and graph it.  At what price the movie theatre will maximize its revenue? What is the price elasticity of demand at the revenue-maximizing price? (Note that, with linear demand function, revenue is maximized at the mid point of the demand line)
5-  Price elasticity of demand for a product with a market price of P = $10 is ϵ = -.5.  At this price, the firm is selling 6000 units of the good.  Find the demand function of the firm.  Find the total revenue function and graph it.  At what price the firm will maximize its total revenue?
6-   Graph the following functions,
a)   y = x2 + 2       
b)   y = ((2  x  -  1)/(x  +  2))
c)   y = x3 - x + 1    
d)  y = 10+ x2 - x3
e)  y = (Sqrt[1 + x])   
f)  y = (.1)x
g)  y = 3x           
h)  y = (-1/2)x
i)   y = log10x          
j)   y = (-2)x
7- For the following total cost functions
TC = .3q2 + 3q + 30
TC =  q2 + 30q + 100
TC =  q3 -59q2 + 1315q + 2000
TC = .1q3 - 2q2 + 20q + 100
where, TC is total cost and q is the output level, plot the total cost and variable cost functions.  Plot average total cost, average variable cost, and average fixed cost functions.
8- For the following demand functions plot the demand functions.  For each function, find total revenue as a function of price (p) and plot them.
q = (20/P)		  
q =   20 - .5p
q = (1000/(P^3))			
p = 10 - .1q
9-  A firm depreciates its machine which was purchased at a price of $250000 at an annual rate of 15%.  Plot the depreciation function and find the depreciated value of the machine after ten years.  After how many years the machine will be worth half of its initial value?
  10- The sales (S) of a new product is estimated as S = 40000(1 - (e^kt)), where t is the number of years that the product has been in the market.  Find S as a function of t given that 10000 units are sold after 2 years.  What is the market saturation quantity?   Graph the sales function and find how many units will be sold after five years. 
11- Graph the following functions.  Find the cycle, frequency, and the amplitude of the functions.
a--y = 4sin x		b-  y = sin4x			c-  y = 4sinx + 5		
d- y = sin4x + 5	e-  y = sin( - 45o)		f-  y = sin(x + 45 o)	
g- y = .25sinx - 1	h-  y = .25sin(x + 45 o) - 1	i- y = -sinx	
12- Graph the functions in problem 11 replacing sine with cosine.	

III. Multi-Variable Functions and Their Graphs:  The Plot3D & ContourPlot Commands
Most real world business and economic problems involve more than one variable.  For example, demand for goods depends on consumer income, price of substitute goods, price of complement goods and many other variables as well as the price of the product.  In every production process, quantity output depends on labor input, capital input, technology, and other variables.  

The analytic approach to multi-variable functions will be discussed later.  Here, the three dimensional graphs of the functions and their contours will be used to study the relationship among the variables for certain economic relationships.  The three dimensional graph of z = f(x, y) maps the set D (domain of the function) to set R (range of the function).  A contour plots the relationship between x and y for a given value of z.  Contour plots are useful in analyzing indifference curves in consumer theory or in studying isoquants and isocosts in theory of production.

Example: Production Function
In a simple linear production technology the relationship between output (Q) and labor input (L) and capital input (K) is given as Q = 6L + 4K.   Graph the production function and the isoquants (contour) representing the trade off between L and K for different levels of output.
Solution:  The production function shows the most efficient values of Q for different combinations of K and L.  The contour plot shows the trade-off between labor input and capital input (isoquants) for the given levels of output.  Here, the graph of the production function is a surface in L, K, and Q space.  By substituting values for L and K and finding their corresponding Q values the output function can be graphed in three dimensions.  To graph the contour plots, set Q to a fixed values, find K in terms of L and graph the relationship between K and L in K-L space. 
Clear[L,  K]
Plot3D[6  L  +  4  K, {L,  0,  10}, {K,  0,  10},AxesLabel -> {"L", "K", "Q"} ,
 PlotLabel -> 
              FontForm["Linear Production",  {"Helvetica-Bold",  
                  12}]]

⁃  SurfaceGraphics  ⁃
ContourPlot[6  L + 4  K, {L, 0, 10}, {K, 0, 10},AxesLabel -> {"L", "K"},ContourShading -> False , 
 \(PlotLabel -> 
              FontForm["Isoquants of Linear Production", \ {"Helvetica-Bold", \ 12}]\)]

⁃  ContourGraphics  ⁃

Example: Cobb-Douglas Production Function
One of the best known functions in the economic theory is the Cobb-Douglas function.  Cobb-Douglas function has a general form of  Z = AXαYβ .  One very nice property of Cobb-Douglas function is that α and β are elasticities.  That is, if the function represented a demand function, Q = A(P^( α)) (y^β), where Q is quantity, P is price, and y is income, α would be price elasticity of demand and β would be income elasticity of demand.  If the function was a production function, Q = A(L^α) (K^β), where Q is output, L is labor input and K is capital input, α would be labor elasticity of output and β would be capital elasticity of output.   The function has been successfully used in empirical studies of markets, production, and consumer theory .  Suppose the relationship between output (Q), labor input (L), and capital input (K) is given as Q = 10L.75K.25.  The following two graphs show the production function and its contour plot.  The contour plots shows the trade-off between labor input and capital input (isoquants) at every fixed level of output.
Clear[Q,  L,  K]
Plot3D[10  L^( .75)  K^( .25), {L,  0, 50},{K,  0,  50},AxesLabel -> {"L", "K", "Q"},
 \(PlotLabel -> 
              FontForm["Non-Linear Production", \ {"Helvetica-Bold", \ 12}]\) ]

⁃  SurfaceGraphics  ⁃
ContourPlot[10  L^( .75)  K^( .25),{L,  0, 50}, {K,  0,  50}, ContourShading -> False, AxesLabel -> {"L", "K"}, \(PlotLabel -> 
              FontForm["Isoquants of Non-Linear Production", \ {"Helvetica-Bold", \ 12}]\)]

⁃  ContourGraphics  ⁃
In the production function above, α and β adds up to one, .75 + .25 = 1.  Such production function is called a constant return to scale production function.  That is changing inputs by k proportion will change output by k proportion.  However, if α + β > 1, the function is called increasing return to scale.  Increasing return to scale (or economies of scale) implies that changing inputs by k proportion will change the output by more than k proportion.  If α + β < 1, the function is decreasing return to scale.  A decreasing return to scale (or diseconomies of scale) implies that changing inputs by k proportion will change output by less than k proportion.  

Do More Practice:
1.  Change The function to Q = 10\(TraditionalForm\`\(L\^1.2\) L\^ .8\).  Graph the function and its contours.  Compare the graphs to ones in the example.  Comment of the shape of the graphs and the scale of operation.
2.  Change The function to Q = 10(L^(. 5)) 
        (L^(. 3)).  Graph the function and its contours.  Compare the graphs to ones in the example.  Comment of the shape of the graphs and the scale of operation.

Example:  Market
Demand for a product is given as Q = 10((y^2)/p) .  5  where, Q is quantity, y is income, and p is the price of the product.  Graph the demand function and comment on the relationship between the variables.  What are the price and income elasticities of demand? 
Solution: It is clear from the graph that as income increases Q also increases and as price increases, Q decreases.
Clear[y,  p]
Plot3D[(10  y^2)/(P^ .5), {y,  1,  50}, {P,  1,  10}, AxesLabel -> {"Y", "P",  "Q"}, \(PlotLabel -> 
              FontForm["Demand as a Function of Income and Price", \ {"Helvetica-Bold", \ 12}]\)]

⁃  SurfaceGraphics  ⁃
These relationships can be clearly observed by plotting the relationship between Q and Y for given levels of P and by plotting the relationship between Q and P for given levels by Y.  To observe the relationship between y and Q, plot contours of Q-Y relations for fixed values of P.  This is done by solving the demand equation above for P and plotting the contours of the resulting equation as,
Clear[p,  q,  y,  sol]
sol  = Solve[q ==  10  y^2/p^( .5),  p]
{{Null (p -> ((100.` (y^4))/(q^2)))}}
p[q_,  y_] = p /. sol[[1]]
((100.` (y^4))/(q^2))
ContourPlot[p[q, y],   {y,  1,  50},  {q,  1,  20},  
          ContourShading -> False]

⁃  ContourGraphics  ⁃
Obviously, the relationship between income and quantity demanded is a positive relation, as shown by the contours.  However, what is interesting is that, at lower levels of income, the function is concave downward and at higher levels of income the function is concave upward.  This implies that, given a fixed price, as income increases, Q increases at a decreasing rate up to a certain level of income.  Beyond this level of income, as income increases, Q increases with an increasing rate (note that here, demand is income elastic, (Subscript[e, y]) = 2.  Check this property for an income inelastic demand in the following "Do More Practice").   
To observe the relationship between p and q, plot contours of Q-P relations for fixed values of y.  This is done by solving the demand equation for y and plotting the contours of the resulting equation as,
\(Clear[p, \ q, \ y, \ sol]

        sol\  = Solve[q == \ 10  y^2/p^\(( .5)\), \ y]\)
\({{Null\ \((y -> \(-0.31622776601683794`\)\ p\^0.25`\ \@q)\)}, {Null\ \((y -> 0.31622776601683794`\ p\^0.25`\ \@q)\)}}\)
y[q_,  p_]=y /. sol[[1]]
-0.31622776601683794` (p^0.25)` (Sqrt[q])
ContourPlot[y[q, p],   {p,  1,  10},  {q,  1,  20},  
          ContourShading -> False]

⁃  ContourGraphics  ⁃
the contours above show the inverse relationship between price and quantity demanded for different levels of income (y).  the price elasticity of demand is (Subscript[e, p])= . 5 and demand is price inelastic.  Note that in a Cobb-Douglas demand function of the form Q = A(P^α)(Y^β), α and β are price and income elasticities, respectively.  

Do More Practice:
1.  Change the demand function of the example above to Q = 10((y^( , 7))/p) .  5.  Graph the demand function and its Y-Q and Y-P contours.  Comment on the behavior of Q with respect to y and P.  What are the income and price elasticities and how do they affect the Y-Q and P-Q relationships?
2.  Change the demand function of the example above to Q = 10((y^( , 7))/p2).  Graph the demand function and its Y-Q and Y-P contours.  Comment on the behavior of Q with respect to y and P.  What are the income and price elasticities and how do they affect the Y-Q and P-Q relationships?


Problems:
1- Plot the following production functions and the contours of the functions (isoquants).
a)   Q = 5L + 2K	
b)   Q = 50K2L2 - K3L3		
c)   Q = .3L - .01L2 + .4K2 -.02K3
d)   Q = 100K.5L.5	
e)   Q = 40K1.2L2.2			   
f)   Q = 10(2K-.5+ 3L-.5)(-(8/5))		
2- Plot the following utility functions and the contours of the functions (indifference curves).
a)   U = (Sqrt[xy])		
b)   U = (Sqrt[(x^2)  +  (y^2)])	
c)   U = (5x.5 + 4y.5)2			
d)   U = Log xy	

IV. Parametric Function:  The ParametricPlot & ParametricPlot3D Commands
In the previous sections y coordinate of each point was defined as a function of x coordinate or x and other coordinates in case of multi-variable functions.  In a parametric function x and y coordinates of each point are a function of some other variable.  Suppose x and y are both a function of a third variable, say t.  That is, x = g(t) and  y = h(t).  The functions relating x and y to t are called parametric functions and t is called a parameter.  Equation relating y to x may be derived by solving x = g(t) for t and substituting it in y = h(t) to obtain y as a function of x,  y = f(x).  In business or economic problems, you may think of t as representing time, and the parametrization as describing the time path of the variables.  The point (x(t), y(t)) describes a point on x, y coordinates reached at time t.

At times, parametric equations help with graphing complicated functions that are difficult to graph otherwise.  For example, to graph x = (y^4)- 4(y^2),the function should be solved for y as functions of x and each function to be graphed independently.  However, if we define y = t and write x = (t^4)- 4(t^2), the parametric functions can be graphed by substituting values for t and finding the corresponding values of x and y and graphing the function or by using the ParametricPlot function of calculators or computer programs.  In general, if we are to graph an equation of the form x = f(y), we can use the parametric equations x = g(t), y = t and parametric plot of the equations.  

Example:  Graph x = (y^4)- 4(y^2).
Solution: Set y = t and x =  (t^4)- 4(t^2).  Find x and y for the given values of t and graph the x-y relations.
({{t, -2, -1, 0, 1, 2, 3, 4}, {y, -2, -1, 0, 1, 2, 3, 4}, {x, 0, -3, 0, -3, 0, 45, 192}})


To graph the function using Mathematica, use the command ParametricPlot as follows.
Clear[t]
ParametricPlot[{t^4 - 4  t^2,  t}, {t,  -2,  10}, AxesLabel -> {"X", "Y"}]

Example:  Graph the parametric functions x = f(t) = (t^3)+ 2t, y = g(t) = t + 4 and identify the relationship between x and y.
Solution:  Substitute for values for t and find the corresponding values of x and y and graph the x-y values on the x-y plane.
({{t, -3, -2, -1, 0, 1, 2, 3, 4}, {y, 1, 2, 3, 4, 5, 6, 7, 6}, {x, -33, -12, -3, 0, 3, 12, 33, 72}})

The relationship between x and y can be derived by finding t from y = t + 4 and substituting it in the equation of x.  This will give x = (y^3) + 12(y^2) + 14y +72.
Using Mathematica,the function can be graphed as
Clear[t]
ParametricPlot[{t^3 + 2  t, t + 4}, {t, -5, 5}, 
          AxesLabel -> {"X", "Y"}]
Note that, in parametric equations, each value of t determines a point (x, y) which can be plotted in x-y coordinate system.  As t varies, the point (x, y) = (f(x), g(x)) varies and traces out a curve, called parametric curve.  

Example: Production and Growth 
Labor force in a cyclical farming sector of an economy is growing at a rate of 10% from an initial number of 10 million, L = 10e.1t The real production of the sector (RP) has a time path given by RP = 20t + 100sin . 9t.  Plot the time path of L, RP, and the relationship between labor force and RP.  Derive RP as a function of L.
Solution:  The labor force and the real production equations are both expressed in terms of t.  Substitute values for t and find the corresponding values of L and RP and graph the relationship between RP and L.  To find RP in terms of L, using logarithmic transformation find t from the first equation , LogL = Log10 + .1t or t = 10(LogL - Log10).  Substitute t in the RP equation to find RP in terms of L, RP = 200(LogL - Log10) + 1000sin . 9(LogL - Log10).   
({{t, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {L, 10, 11.05, 12.21, 13.50, 14.92, 16.49, 18.22, 20.14, 22.26, 24.60}, {RP, 0, 90.33, 137.38, 102.74, 35.75, 2.25, 42.72, 141.68, 239.36, 276.99}})
The graph of the parametric curve is 

Using Mathematica,  the following graphs show the graphs of the labor equation as a function of time, real production as a function of time, and the parametric plot, respectively. 
Clear[t]
Plot[10  E^( .1  t), {t,  0,  10}, AxesLabel -> {"t", "L"}, \(PlotLabel -> 
                FontForm["Labor Growth Over Time", \ {"Helvetica-Bold", \ 12}]\)]


⁃  Graphics  ⁃
Clear[t]
Plot[20  t  + 100 Sin[ .9  t],{t,  0,  10},AxesLabel -> {"t", "RP"},
 PlotLabel->FontForm["Real Production Growth Over Time", {"Helvetica-Bold",  12}]]


⁃  Graphics  ⁃
Clear[t]
ParametricPlot[{10  E^( .1  t),  20  t  +  100  Sin[ .9  t]},{t,  0,  10},
	AxesLabel -> {"L", "RP"}, PlotLabel->FontForm["Real Production as a Function of Labor",
			{"Helvetica-Bold",  12}]];

Example: Production Function
A very fast growing business starts with one unit of labor and one unit of capital and grows at an annual rate of 30% and 80% for labor and capital, respectively.  The output (Q) of the business is cyclical and is growing as Q = t + sin(t).  Graph the parametric equations.
Solution: Labor is growing as L = e.3t , capital is growing as K = e.8t, and Q = t + sint.  Substitute values for t and find the corresponding L, K, and Q.  The plot will be a three dimensional plot which is hard to graph.  Using Mathematica, the parametric plot of the equations is shown below.  
Clear[t]
ParametricPlot3D[ {E^( .3  t),  E^( .8^t),  t  +  Sin[t]}, {t,  0,  5},
	AxesLabel -> {"L", "K", "Q"}, PlotLabel->FontForm["Parametric Plot of Output as Function of Inputs\
",  {"Helvetica-Bold", 12}]];


Problems:
1.  Graph the following equations.
a)  x = (y^5) + (y^3)
b)  x = (y^3) - 3(y^2)
c)  x = (Sqrt[(y^3)  +  3  y])
d)  x = (((t^2)  -  t)^(1/3))
e)  x = (((y^4)  -  4  (y^2))^(1/3))
2.  Graph the following parametric equations.
a)   x = 10(t^2)-3t + 8  and y = 5t + 6
b)   x = (t^3)-3t + 4  and y = 2t + 5
c)   x = (t^4)- 3(t^3) + t  and y = -t + 8
d)   x = (Sqrt[t  +  2])+ 8  and y = (t^2)
e)   x = .5t and  y = 10 + t2					
f)   x = 10et  and  y = t - .5t2
g)   x = sin t  and  y = sin 2t		
h)   x = cos t  and  y = tsin t