Math 132

Profit From Two Markets and Partial Derivatives

S. R. Lubkin, based on work by R. White

Application

At the beginning of the course we were trying to sell a product and figure out how many units to sell to gain the largest profit. The model was based on the idea that the price per unit declines as more and more are sold, so that there is a point at which we have sold so many that it doesn't pay to keep selling. We will extend that model to the case where we are selling in more than one market, and the price in

Math Model

Suppose we are selling the same product in both the US and Canada. In general, the price will not be the same in these two different markets, so our profit will depend on how many are sold in both places. As in the previous lesson, let us assume that the price declines linearly, as we sell more and more.

As before, we model profit with a word equation

profit = revenue - cost
and
revenue = (revenue in US) + (revenue in Canada)
= (price per unit in US)*(# sold in US) + (price per unit in Canada)*(# sold in Canada)
Further,
cost = (startup cost) + (cost per item)*(number manufactured)
Assuming that the number manufactured for each market is the same as the number sold in each market,
cost = (startup cost) + (cost per item)*(# sold in US + # sold in Canada)
When would this be a good assumption and when would it be a bad assumption?

Definitions

Let's define
x := number of units sold in US market
y := number sold in Canadian market
P(x,y) := profit, as a function of the levels of sales in the two markets
Let us suppose that our research has told us that the prices are expected to decline in a specific way:
price in US = $97 - $0.10*x
price in Canada = $85 - 0.07*y
and that the startup cost is $10,000, and the manufacturing cost is $3.50 per item. Then we can make our

Translation

cost = $10000 + $3.50*(x+y)
revenue =  ($97 - $0.10*x)*x + ($85 - 0.07*y)*y
P(x,y) = ($97 - $0.10*x)*x + ($85 - 0.07*y)*y - ($10000 + $3.50*(x+y))
or, combining terms,
P(x,y) = 93.5*x - 0.10*x2 + 81.5*y - 0.07*y2 - 10000

Goal

Our task is to optimize the profit. That is, we need to find the values of x and y which will maximize P(x,y). We call P(x,y) our objective function. In this problem, we don't have a constraint.

Method of Solution

Graphical Method

It is a lot harder this week to graph our objective function. Last time, it was a function of one variable, and we could easily graph f(x) against x. But this week we have a function of two variables. Fortunately, Maple can easily handle graphing a function of two variables. In Maple, first define your objective function
> P:=(97-.10*x)*x+ (85-.07*y)*y-(10000+3.5*(x+y));
     P := (97 - .10 x) x + (85 - .07 y) y - 10000 - 3.5 x - 3.5 y
Then you must tell Maple to load a library of specialized plotting routines:
> with(plots):
Warning, the name changecoords has been redefined
To see a 3D plot of P, type
> plot3d(profit,x=0..700,y=0..800);
and you will see a curved surface. It has pretty colors, but it isn't that informative, except that we can see that there is a mountaintop on that mountain. Click on the surface and you'll see that you have new options available at the top of the Maple window. Go to Axes and try the available options. Choose the style you prefer. It's still hard to read numbers off the graph. Try grabbing the graph with click-hold-drag, and see what happens. Cool! But it's still hard to read numbers off this graph. That is why we often use contour maps for the graph of a function of two variables. Type
> contourplot(P,x=0..1000,y=0..1000)
This is easier to read numbers off of. We can see at a glance that the maximum profit is found when x is around 400-500 and y is around 600. To see the peak more precisely, we can change the limits of the plot from, say, 0-1000 to, say, 400-600 for each variable, etc.

Derivative Method

But let's be more systematic. To be at the maximum of P(x,y), we have to have dP/dx = 0 and dP/dy = 0. Note that these are partial derivatives, since P is a function of more than one variable. But partial derivatives are no problem for Maple. Type
> diff(P,x);
                           -.20 x + 93.5
> diff(P,y);
                           -.14 y + 81.5

Now we can solve the two simultaneous equations dP/dx = 0 and dP/dy = 0:

> solve({-.20*x+93.5 = 0, -.14*y+81.5 = 0},{x,y});

                 {x = 467.5000000, y = 582.1428571}

So the maximum profit will occur when we have sold 467.5 units in the US and 582.1 units in Canada. (Half a unit is silly for some products, like cars, but it makes sense for some products, like tons of wheat.) Reality check: This solution is consistent with what we found on the graphs.

What will the profit actually be when it is a maximum? Let's at least round x and y to the nearest unit. In Maple:

> subs(x=467,y=582,P);
                              35577.92

So we can expect a profit target of $35,578.

Numerical Method

We can also find solutions to optimization problems in Excel, through its Solver feature. To optimize P(x,y), make a table which includes a reasonable guess for x, a reasonable guess for y, and the function P(x,y).
A B C
1 x y P(x,y)
2 500 500 = 93.5*A2 - 0.10*A2^2 + 81.5*B2- 0.07*B2^2- 10000

You will then need the Solver feature, which is usually loaded as an Add-In. Go to Tools -> Add-Ins, and in the menu box, scroll till you find the Solver option, click that you want to load it, and click OK. Now when you go to Tools, you have the Solver option available. Do it now: Tools -> Solver. Fill in the blanks. You want to minimize the contents of target cell C2 by changing cells A2:B2, subject to no constraints (this time). Then click Solve, and notice that your numbers in cells A2:C2 have changed. They should have changed to

A B C
1 x y P(x,y)
2 467.5 582.1 $35578
or something very close to that. If you believe the numbers, click that you should keep the Solver solution.

The way Solver works is very different from the derivative method we used above. Solver is looking for the highest point the way you would try to find the top of a hill by walking. You would walk, look around, and see if you need to go any further to get there, changing direction if necessary. Many highly complicated optimization problems in the real world are solved in more or less this fashion. We will do more optimization in the last three lessons.