comphw1

4
Mathematics for Economists 3610-E Computer Homework Assignment #1 * HUYNH NGOC PHUONG DUYEN 1. Consider the following profit function p(Q)=(a - α)Q - (b + β)Q 2 , (1) where Q = output level and a, α, b, β are positive constants. (a) this function in Mathematica. Then, for a =1.5, α =6.5, b =0.1, β =0.5, plot it (as a function of the output Q) together with its first derivative, in one figure, on the interval from -20 to 5. Add the legend. Insert your code and graph as an image in Figure 1 p[Q_, a_, alpha_, b_, beta_] := (a - alpha)*Q - (b + beta)*Q^2 Plot[Evaluate[{p[Q, 1.5, 6.5, 0.1, 0.5], D[p[Q, 1.5, 6.5, 0.1, 0.5], {Q, 1}]}], {Q, -20, 5}, PlotLegends -> "Expressions"] (b) Based on the graph, answer the following five questions: 1) For what value of Q (approximately) does p(Q) achieve its maximum? Let’s call this point Q 0 . 2) Is the value of the derivative, p 0 (Q), at Q 0 zero? 3) Is the sign of the derivative to the left of Q 0 positive or negative? 4) Is the sign of the derivative to the right of Q 0 positive or negative? 5) In your own words, can you explain phenomena described in questions/answers 2-4? Answer(s): It would achieve its maximum value when the first derivative of p (Q) = 0, that means when Q equals 4.166666667 The value of p’ (Q) at this point equals 0 The sign to the right is negative and the sign to the left is positive. This happen because a equation would reach it maximum value when it has an U shape or a bell shape. And these shapes has a tangent line which is a straight line parallel with the x - axis - meaning the slope equals = 0. That’ s why we also equal the first derivative of a function to 0 when we want to find the maximum or minimum value. The sign of function * Due date: 3pm, Fri, 18/09/2015. Please, upload this .tex and the corresponding .pdf to Moodle. 1

Upload: phuong-duyen-huynh-ngoc

Post on 03-Dec-2015

212 views

Category:

Documents


0 download

DESCRIPTION

computer homework

TRANSCRIPT

Page 1: CompHW1

Mathematics for Economists 3610-E

Computer Homework Assignment #1 ∗

HUYNH NGOC PHUONG DUYEN

1. Consider the following profit function

p(Q) = (a− α)Q− (b+ β)Q2, (1)

where Q = output level and a, α, b, β are positive constants.

(a) this function in Mathematica. Then, for a = 1.5, α = 6.5, b = 0.1,β = 0.5, plot it (as a function of the output Q) together with itsfirst derivative, in one figure, on the interval from −20 to 5. Add thelegend. Insert your code and graph as an image in Figure 1

p[Q_, a_, alpha_, b_, beta_] := (a - alpha)*Q - (b + beta)*Q^2

Plot[Evaluate[{p[Q, 1.5, 6.5, 0.1, 0.5],

D[p[Q, 1.5, 6.5, 0.1, 0.5], {Q, 1}]}], {Q, -20, 5},

PlotLegends -> "Expressions"]

(b) Based on the graph, answer the following five questions: 1) For whatvalue of Q (approximately) does p(Q) achieve its maximum? Let’scall this point Q0. 2) Is the value of the derivative, p′(Q), at Q0

zero? 3) Is the sign of the derivative to the left of Q0 positive ornegative? 4) Is the sign of the derivative to the right of Q0 positiveor negative? 5) In your own words, can you explain phenomenadescribed in questions/answers 2-4?

Answer(s): It would achieve its maximum value when the firstderivative of p (Q) = 0, that means when Q equals 4.166666667 Thevalue of p’ (Q) at this point equals 0 The sign to the right is negativeand the sign to the left is positive. This happen because a equationwould reach it maximum value when it has an U shape or a bellshape. And these shapes has a tangent line which is a straight lineparallel with the x - axis - meaning the slope equals = 0. That’ swhy we also equal the first derivative of a function to 0 when wewant to find the maximum or minimum value. The sign of function

∗Due date: 3pm, Fri, 18/09/2015. Please, upload this .tex and the corresponding .pdf toMoodle.

1

Page 2: CompHW1

[scale=0.5]

Figure 1: Plot of p(Q) and p′(Q), where p(Q) is a profit function given byequation (1).

change when we move from left to right is because of the nature ofthe U shape or bell shape as we can see in figure 1

2. An exponential function with base a, a > 0, is defined as

f(x) = ax. (2)

(a) Declare this function in Mathematica. Then, plot it (as a function ofx) for several values of a, a ∈ {0.5, 2, 2.7182, 4} in one figure, on theinterval from −2 to 2. Add the legend. Insert your code and graphas an image in Figure 2

f[x_, a_] := a^x

f1 := f[x, 0.5]

f2 := f[x, 2]

f3 := f[x, 2.7182]

f4 := f[x, 4]

Plot[{f1, f2, f3, f4}, {x, -2, 2}, PlotLegends -> "Expressions"]

(b) Plot the derivative of f(x) for several values of a, a ∈ {0.5, 2, 2.7182, 4}in one figure, on the interval from −2 to 2. Add the legend. Insertyour code and graph as an image in Figure 3

Plot[Evaluate[

D[{f[x, 0.5], f[x, 2], f[x, 2.7182], f[x, 4]}, {x, 1}], {x, -2, 2},

2

Page 3: CompHW1

Figure 2: Plot of the exponential function from equation (2) for several valuesof a.

PlotLegends -> "Expressions"]]

Figure 3: Plot of the derivative of the exponential function from equation (2)for several values of a.

(c) Based on the graphs from exercises 2a-2b, for which base a doesthe derivative f ′(x) looks exactly like f(x)? Can you say somethingabout this number?

3

Page 4: CompHW1

Answer(s): the second graph has the derivative graph nearly thesame with the orginial one. It is because its base is nearly e andlne=1

(d) The exponential function with base a has the following property

f ′(x) =

f(x)︷︸︸︷ax ·f ′(0).

For the base a you selected in exercise 2c, what is the value of f ′(0)?

Answer(s): nearly equal 1

4