>
y:=x^3-3*x^2-24*x;
>
y1:=diff(y,x);
>
solve(y1,x);
Determine if the above function is convex or concave using the definition on page 65 of the text. Take second derivative and evaluate at x=-2, and x=4.
>
y2:=diff(y1,x);
>
eval(y2,x=-2);
The second derivative at x=-2 is negative, implying that the function is concave. Now evaluate at x=4.
>
eval(y2, x=4);
The second derivative at x=4 is positive, implying that the function is convex. Now let us graph the function and verify the above the results.
>
plot(y, x=-10..10);
>
eval(y,x=-2);
>
eval(y,x=4);
>
plot({y,28,-80},x=-4..8);
>
If the second derivative is negative, a relative maximum has been found. Conversely, if the second derivative is positive, a relative minimum has been detected. When the second derivative is equal to zero, we have found an inflection point.
>
solve(y2,x);
>
eval(y1,x=1);
The Difference between optimization and maximimization? Optimization without constraints = maximization.
An Example: Optimize the following total revenue (Tr) function-- find critical values and test for max or min points.
>
Tr:=2*q^3-30*q^2+126*q+59;
>
Tr1:=diff(Tr,q);
>
solve(Tr1, q);
>
Tr2:=diff(Tr1,q);
>
eval(Tr2, q=3);
>
eval(Tr2, q=7);
>
eval(Tr,q=3);
>
eval(Tr,q=7);
>
plot({Tr,221,157},q=0..10);
>