Apple Cider


Reminiscing about the old country drive

Johnny and Sara were just sitting and chatting as they did routinely after school. They were reminiscing about all sorts of things when Sara started this conversation.

Sara:  Johnny, do you remember our last drive to the countryside where we stopped by at an apple orchard.

Johnny: Yes, the orchard owner was a poor guy but he was really nice.  Remember, we figured out for him the number of apple trees he could plant to get the best possible yield.  This way, he could improve his income,  May be we should see him again.

Sara:  It’s only been a month.  It takes 2-4 years before an apple seedling grows up and starts bearing fruit.  So nothing would have changed by now.

Johnny:  I want to go for a drive anyway if I can borrow mom’s car.

Johnny’s mom let him use her car.  The weather was nice. The sky looked just like the Microsoft Windows picture – bright and shiny with enough clouds spread all over.

The apple farmer had built a shed

They drove to the orchard.  To their surprise, the farmer was not just sitting on a chair and selling apples.  Instead, he had built a shed.  Of course he had bushels of apples in the shed but he also had a number of cans on a shelf behind him. The farmer immediately recognized the two of them and greeted them. He also thanked them for the suggestion they had given him the last time they came, and in appreciation he gave them free apples to bite on – one to Sara and another to Johnny.

Johnny: What is with this shed ?  Are you starting a store now ?

Farmer:  I have planted extra apple seedlings just like you suggested the last time you came here but it will be three years before I get any apples from them.  I decided to put up this stall.  It is more visible to the customers driving by on the road. Also, because I have some shelf space, I will also sell apple cider.  Some cider cans are on the shelf behind me but I have to put more.

Johnny: They are not all from your farm.  Some of them look like the brand we buy in our supermarket.

Farmer:  Yes, I will keep both.  It is a good thing that you came because I need your help again. One of my nephews came and wrote some jumbo mumbo.  I have no idea what it means.  This is the note he left. How much should I price the two types of cider cans?

How much to charge for different ciders?

“Our own cider costs 15 cents per can but a national brand can of cider costs us 30 cents.  We should sell our cider at a price of x cents per can and the national brand at y cent per can. That way, on a daily basis, we can sell 70 – 5x + 4y cans of our own cider and 80 + 6x -7 y cans of the national brand.  I have no idea what this means.”

Johnny:  Sara, can we help him ?

Sara:  It’s a simple Calculus problem.

Johnny: Yes, these days you think everything is a Calculus problem. Don’t you?

Farmer: I will give you two free cans of the cider from my farm if you can help me.

Sara:   To me, the first issue is whether I can trust what your nephew told you.

Farmer:  My nephew is very smart.  He must be right.  Tell me the selling price for each type of can thinking that he is right.

Sara: Johnny and I will figure it out in our car and then tell you in 5 minutes.

They both went to the car where Johnny started with the simple algebra.  Let’s say he sells the cider from his farm at x cents per can. Then the profit P from his own cider will be the number of cans sold times x minus the cost which is 15 cents each.

P(x) = (70 – 50 x + 4y)(x-15)

The same way the profit from the national brand alone will be

P(y) = (80 + 6x – 7y)(y-30).

Therefore, the profit from the sale of all the apple cider cans will be

P(x,y) = (70 −5x+4y)(x−15)+(80+6x−7y)(y−30)

Okay Sara, then what?

Optimization using partial differentials

Sara; Do you remember when we did the last optimization problem, we had set the value of the first derivative to be zero and solve the equation?  Here, we have two variables which are interdependent.  The number of local cans you sell depends on their own price and on the price of the national brand.  The same way the number of the national brand cans you sell depends on the price of both the local and the national brand.  You  can still take the derivatives but they have to be partial derivatives.

Johnny:  What on earth is a partial derivative ? Are we going to learn it in our course?

Sara:  Yes, but I browsed over the book ahead of time.  To get the partial derivative with respect to one variable, we will assume the other to be a constant.  This way we will get two partial derivatives with the symbol del (∂).

P(x,y)=(70 −5x+4y)(x−15)+(80+6x−7y)(y−30) or

P(x,y) = – 35 x -5 x2 +10xy +230y-7 y2-3450.

Taking y to be constant

∂P(x,y)/ ∂x = -35-10x+10y, and similarly

∂P(x,y)/ ∂y = 230 +10 x -14 y.

Now at maxima, both the partial derivatives will have a value of zero.  Therefore, we have

-35-10x+10y = 0 and 230 +10 x -14 y = 0.

Johnny:  I get it.  Now, if we add the left hand sides the two equations, we will get

195 – 4 y = 0 or y = 48.75.  Then we can also  solve for x and get x = 45.25.

Sara:  Don’t get too excited.  This solution could be a minima or a maxima, you must also get the second partial derivatives and show that they are negative

Johnny: ∂P(x,y)/ ∂x = -35-10x+10y.  Therefore, ∂2P(x,y)/ ∂2x = -10 because y will be considered to be constant.

Also,    from ∂P(x,y)/ ∂y = 230 +10 x -14 y, ∂2P(x,y)/ ∂2y = -14.

They are both negative. So should we tell him what to do ?

Sara:  Yes, but round up the prices to avoid confusion.

The verdict on the price of different ciders

Johnny to the Farmer:  Here, we have it all figured out. We don’t know if your nephew was right.  But if he was right, you should sell your own cider for  45 cents a can and the national brand at 49 cents a can.

Sara:  That way, on a daily basis, you will sell 41 cans of your own cider making a profit of 30 cents/can, and you will sell only 7 cans of the national brand with a profit of 19 cents/can.  That means a total daily profit of $13.63 on an average day.  I guess, this is not much.  I hope you are not disappointed.

Farmer:  Thanks Miss,  I am happy.  I will still sell apples and make my money but this will be on top of that. So this will be good.  Here are two cans of cider for you.

Johnny:  These numbers also mean that you would not waste your money on buying too many of the national brand cider cans for your inventory. Does that make sense?

Farmer:  Thank you Mister  You helped me a lot.  The advice you gave me on growing more apples last time, will also begin to add to my profits in 2-3 years.  Also, more people may come for cider next year when they find that I sell it.  Thank you.

Johnny:  May be you should put a better sign on your stall too.  Bye for now.

Sara and Johnny continued for the drive and then went home.  Sara didn’t care much for the cider and gave her can to John. When at home, Johnny and his mom had a chat.  Johnny told mom the whole story and then said, ” I learn something new every time I go for a drive with Sara,  May be you should let me borrow your car more often.”  Mom said that he could ask for it more often if he wanted but each time she will make her own decision.


Barak says that from where he stands, he could go either a distance x North or walk a distance  y towards West. The height of the mountain H is given by the function H(x,y) = 4x2 + y2 − 8xy + 4x + 6y + 10.

What is the slope at a given point x,y?


The slope is the first derivative of the function.

For H(x,y) = 4x2 + y2 − 8xy + 4x + 6y + 10

∂P(x,y)/ ∂x = 8x – 8y + 4.  This is the slope towards North.

∂P(x,y)/ ∂y = 2y -8x +6y.  This is the slope towards West.