1 Maxima and Minima on finite closed intervals
1.1 Solution 1
\(a + b = 3\)
\(N^2 = a^2 + 3^2\)
\(M^2 = a^2 + 3^2\)
Total cables $ = N + M + b$
\(= \sqrt{a^2 + 3^2} + \sqrt{a^2 + 3^2} + 3-a\)
\(f(a) = 2\sqrt{a^2 + 9} + 3 - a\)
We need to find the local minima of the function.
Domain: \([0,3]\)
Let's write GNU Octave code to solve this further:
pkg load symbolic syms a f = 2* sqrt(a^2 + 9) + 3 - a df = simplify(diff(f,a)) solve(df == 0,a)
f = (sym)
________
╱ 2
-a + 2⋅╲╱ a + 9 + 3
df = (sym)
2⋅a
─────────── - 1
________
╱ 2
╲╱ a + 9
ans = (sym) √3
So the critical number is \(\sqrt{3}\). Let's find the values of the function at the endpoints and the critical point:
fh = function_handle(f) [fh(0), fh(sqrt(3)), fh(3)]
fh = @(a) -a + 2 * sqrt (a .^ 2 + 9) + 3 ans = 9.0000 8.1962 8.4853
So the minimum value for the function occurs at \(a = \sqrt{3}\) which is at point \((0, \sqrt{3})\)
1.2 Solution 2
Cost to produce gallon of maple syrup = \(30\) dollars.
If they charge x dollar per gallon, then they could sell \(1000 - 10x\) gallons.
\(30 \leq x \leq 1000\)
Let's express in terms of function.
x = Rate in dollars. x is the selling price.
\(f(x) = 1000 - 10x\)
\(f(x)\) represents gallons sold.
1.2.1 Solution (a)
To maximize the revenue, they should sell lots of gallons.
\(f(x) = 1000 - 10x\)
Total gallons sold = f(x)
Revenue = Selling price = \(x.f(x) = x(1000 - 10x)\)
Cost \(= 30.f(x)\)
Revenue = Cost + Profit
Let's write some GNU Octave code to find which value of \(x\) will maximize revenue.
\(r(x) = x(1000 - 10x)\)
clear pkg load symbolic syms x r = x*(1000 - (10*x)) dr = simplify(diff(r,x)) solve(dr == 0, x)
r = (sym) x⋅(-10⋅x + 1000) dr = (sym) -20⋅x + 1000 ans = (sym) 50
Let's fine the value of \(x\) at which the function \(r(x)\) is maximized:
rh = function_handle(r) [rh(30), rh(50), rh(1000)]
rh = @(x) x .* (-10 * x + 1000) ans = 21000 25000 -9000000
So they should set the price to $50 to maximize their revenue.
1.2.2 Solution (b)
p = x*(1000 - (10*x)) - 30*(1000-(10*x)) dp = simplify(diff(p, x)) solve(dp == 0, x)
p = (sym) x⋅(-10⋅x + 1000) + 300⋅x - 30000 dp = (sym) -20⋅x + 1300 ans = (sym) 65
Now let's see if \(x\) is maximum at value \(65\):
ph = function_handle(p) [ph(30), ph(65), ph(1000)]
ph = @(x) x .* (-10 * x + 1000) + 300 * x - 30000 ans = 0 12250 -8730000
So the price should be set at $64 per barrel for the profit to be maximized:
1.3 Solution 3
Total area = 600 square inches
Margin at sides and top = 1 inch
Margin at bottom = 2 inches
Poster is rectangular.
Objective: Find dimension of poster to maximize printed area.
\(a.b = 600\)
Printed area \(= (a-2)(b-3)\)
\(f(a) = (a-2)(\dfrac{600}{a} - 3)\)
Let's write some GNU Octave code to find which value of \(a\) at which the function attains it's maximum value.
clear pkg load symbolic syms a f = (a-2)*(600/a - 3) df = simplify(diff(f,a)) solve(df == 0, a)
f = (sym)
⎛ 600⎞
⎜-3 + ───⎟⋅(a - 2)
⎝ a ⎠
df = (sym)
1200
-3 + ────
2
a
ans = (sym 2×1 matrix)
⎡-20⎤
⎢ ⎥
⎣20 ⎦
Since we know that the dimension cannot be negative, let's check if \(20\) makes the function maximum:
fh = function_handle(f) [fh(0), fh(20), fh(600)]
fh = @(a) (-3 + 600 ./ a) .* (a - 2) warning: division by zero warning: called from eval>@<anonymous> at line 1 column 19 ans = -Inf 486 -1196
So we know that at \(20\) the function achieves it's maximum value. The other dimension is \(30\).
1.4 Solution 4
1.5 Solution 5
Permiter of window = P
Let's assume \(l\) be the length of rectangle and \(w\) be the width of the rectangle.
Area of rectangle \(= l * w\)
Radius of circle \(= \dfrac{w}{2}\)
Area of circle \(= \dfrac{\pi * (\dfrac{w}{2})^2}{2} = \dfrac{\pi}{2} * \dfrac{w^2}{4} = \dfrac{w^2 \pi}{8}\)
Area of norman window \(= l.w + \dfrac{w^2 * \pi}{8}\)
Permiter of norman window \(= l + l + w + \pi . \dfrac{w}{2}\)
\(P = 2l + w(\dfrac{\pi}{2} + 1)\)
Assuming that the permiter is constant, we need to find dimensions to maximize the are.
\(P = 2l + w(\dfrac{\pi}{2} + 1)\)
\(l = \dfrac{P}{2} - \dfrac{2}{2}*(\dfrac{\pi}{2} + 1)\)
\(A = l.w + \dfrac{w^2 * \pi}{8}\)
\(f(w) = \dfrac{w^2\pi}{8} + w(\dfrac{P}{2} - \dfrac{w}{2}(\dfrac{\pi}{2} + 1))\)
\(f(w) = \dfrac{w^2\pi}{8} + w(\dfrac{P}{2} - (\dfrac{w\pi}{4} + \dfrac{w}{2}))\)
\(f(w) = \dfrac{w^2\pi}{8} + w(\dfrac{P}{2} - (\dfrac{w\pi + 2w}{4}))\)
\(= \dfrac{w^2\pi}{8} + w(\dfrac{P}{2} - (\dfrac{w(\pi + 2)}{4}))\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms w P PI # using Q for pi, P for permiter, w for width f = (w^2* PI)/8 + w*(P/2 - ((w*(PI + 2))/4)) df = simplify(diff(f,w)) solve(df == 0, w)
octave> octave> f = (sym)
2
PI⋅w ⎛P w⋅(PI + 2)⎞
───── + w⋅⎜─ - ──────────⎟
8 ⎝2 4 ⎠
octave> df = (sym)
P PI⋅w
─ - ──── - w
2 4
ans = (sym)
2⋅P
──────
PI + 4
Let's check if at \(\dfrac{2.P}{\pi + 4}\), the function assumes it's maximum values. Let's take double derivate:
dff = simplify(diff(df, w)) dffh = function_handle(dff) [dffh(pi)]
dff = (sym) PI - ── - 1 4 dffh = @(PI) -PI / 4 - 1 ans = -1.7854
Since the value is less than \(0\), we know from second derivate test that the function achieves it's local maximum at that value. Now let's calculate what would be the length:
clear pkg load symbolic syms P W PI l = P/2 - ((W/2)*(PI/2 + 1)) lh = function_handle(l) [simplify(lh(P, PI, (2*P)/(PI + 4)))]
octave> octave> l = (sym)
⎛PI ⎞
W⋅⎜── + 1⎟
P ⎝2 ⎠
─ - ──────────
2 2
octave> lh =
@(P, PI, W) P / 2 - W .* (PI / 2 + 1) / 2
ans = (sym)
P
──────
PI + 4
So the width of the rectangle is \(\dfrac{2P}{\pi + 4}\) and the length of the windows is \(\dfrac{P}{\pi + 4}\).
The height of the windows will be the sum of the length and radius of the circle. Let's compute that:
clear pkg load symbolic syms P PI h = P/(PI + 4) + (P)/(PI + 4) # radius is same as half of the width of the window
octave> octave> h = (sym) 2⋅P ────── PI + 4
And the height is same as the width of the windows.
1.6 Solution 6
Volume of cone using slant height \(= \dfrac{1}{3} \pi r^2 \sqrt{l^2 - r^2}\)
We know that \(l = 3\)
The range of radius can be \((0,l]\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms r f = 1/3 * pi * r^2 * sqrt(9 - r^2) df = simplify(diff(f,r)) solve(df == 0, r)
octave> octave> warning: passing floating-point values to sym is dangerous, see "help sym"
warning: called from
double_to_sym_heuristic at line 50 column 7
sym at line 379 column 13
mtimes at line 63 column 5
f = (sym)
________
2 ╱ 2
π⋅r ⋅╲╱ 9 - r
────────────────
3
octave> df = (sym)
⎛ 2⎞
π⋅r⋅⎝6 - r ⎠
────────────
________
╱ 2
╲╱ 9 - r
ans = (sym 3×1 matrix)
⎡ 0 ⎤
⎢ ⎥
⎢-√6⎥
⎢ ⎥
⎣√6 ⎦
We know that the radius cannot be zero or negative. So let's check the critical number \(\sqrt{6}\) to see if the function achives local maximum at that number.
fh = function_handle(f) [fh(0), fh(sqrt(6)), fh(3)]
fh = @(r) pi * r .^ 2 .* sqrt (9 - r .^ 2) / 3 ans = 0.00000 10.88280 0.00000
From exterme value theorem, we can say that the function achieves it's local maximum when the radius is \(\sqrt{6}\). Let's find the volume of the cup at that radius:
fh = function_handle(f) [fh(sqrt(6))]
fh = @(r) pi * r .^ 2 .* sqrt (9 - r .^ 2) / 3 ans = 10.883
So volume of 10.833
is the largest possible volume of the cup.
1.7 Solution 7
Way to go = Row boat + Walk to house
Total time taken \(= \dfrac{y}{3} + \dfrac{100-x}{5}\)
\(y^2 = x^2 + 60^2\)
\(y = \sqrt{x^2 + 60^2}\)
\(f(x) = \dfrac{\sqrt{x^2 + 60^2}}{3} + \dfrac{100-x}{5}\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms x f = sqrt(x^2 + 60^2)/3 + (100-x)/5 df = simplify(diff(f,x)) solve(df == 0, x)
octave> octave> f = (sym)
___________
╱ 2
x ╲╱ x + 3600
- ─ + ────────────── + 20
5 3
octave> df = (sym)
x 1
──────────────── - ─
___________ 5
╱ 2
3⋅╲╱ x + 3600
ans = (sym) 45
Now let's take double derivative of it:
dff = simplify(diff(df, x)) dffh = function_handle(dff) [dffh(45)]
dff = (sym)
1200
──────────────
3/2
⎛ 2 ⎞
⎝x + 3600⎠
dffh =
@(x) 1200 ./ (x .^ 2 + 3600) .^ (3 / 2)
ans = 0.0028444
Since the value is \(> 0\), from second derivative test we can conclude that the function attains it's local minima at \(x = 45\).
So, the little red riding hood should row to the point 45 feet west of the point directly across the river.
Reference: Little Red Riding hood
1.8 Solution 8
Total fence distance = 200 feet
Let's assume width of fence be w and length of fence be l.
Area \(= w.l\)
Total fence distance \(= w + w + l = 2w + l\)
\(2w + l = 200\)
\(f(w) = w.l\)
\(f(w) = w(200-2w)\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms w f = w*(200 - 2*w) df = simplify(diff(f,w)) solve(df == 0, w)
octave> octave> f = (sym) w⋅(200 - 2⋅w) octave> df = (sym) 200 - 4⋅w ans = (sym) 50
Now let's confirm if at \(w = 50\), the function attains it's local maximum value. The domain for \(w\) is \([0,100]\)
fh = function_handle(f) [fh(0), fh(50), fh(100)]
fh = @(w) w .* (200 - 2 * w) ans = 0 5000 0
So by Extreme value theorem, we can conclude that at \(w = 50\), the function attains it's local maxima. Let's compute the length of the field:
clear pkg load symbolic syms w l = 200 - (2*w) lh = function_handle(l) [lh(50)]
octave> octave> l = (sym) 200 - 2⋅w lh = @(w) 200 - 2 * w ans = 100
So the dimensions of the field should be width of \(50\) and length of \(100\) feet.
1.9 Solution 9
Total fence distance = 200 feet
Constraint: Field must be atleast as wide as barn
1.9.1 Solution (a)
Barn width = 40 feet
Let the dimensions of the field be \((40+x)\) and \(y\).
Area \(= (40+x).y\)
\(y+y+x+40+x = 200\)
\(2y + 2x + 40 = 200\)
\(2(x+y) = 160\)
\(x+y = 80\)
\(y = 80 - x\)
Areaa \(= (40+x)y\)
\(= (40+x)(80-x)\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms x f(x) = (40+x)*(80 - x) df = simplify(diff(f,x)) solve(df == 0, x)
octave> octave> f(x) = (symfun) (80 - x)⋅(x + 40) octave> df = (sym) 40 - 2⋅x ans = (sym) 20
Now we need to verify that at the critical number \(60\), the function achieves it's local maximum. We can assume domain of x to be \([0, 80\). So let's use exterme value theorem to check if it's achieve it's local maximum:
fh = function_handle(f) [fh(0), fh(20), fh(80)]
warning: FIXME: symfun! does that need special treatment?
warning: called from
codegen>codegen_input_parser at line 187 column 7
codegen at line 21 column 35
function_handle at line 94 column 12
fh =
@(x) (80 - x) .* (x + 40)
ans =
3200 3600 0
So with that we know that one of the dimension is \(20\) feet. Along with barn's dimension added, it becomes \(60\) feet. Let's find the other dimension too:
clear pkg load symbolic syms x y = 80 - x yh = function_handle(y) [yh(20)]
octave> octave> y = (sym) 80 - x octave> yh = @(x) 80 - x ans = 60
So the dimensions of the field to maximize the area should be \(60\) by \(60\) feet.
1.9.2 Solution (b)
Barn width \(= 70\) feet
Let the dimension of the field be \((70+x)\) and \(y\)
Area \(= (70+x)y\)
\(y + y + x + (70+x) = 200\)
\(2x + 2y = 130\)
\(x + y = \dfrac{130}{2} = 65\)
Area \(= f(x) = (70+x)y\)
\(= (70+x)(\dfrac{130}{2} - x)\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms x f = (70+x)*(130/2 - x) df = simplify(diff(f,x)) solve(df == 0, x)
octave> octave> f = (sym) (65 - x)⋅(x + 70) octave> df = (sym) -2⋅x - 5 ans = (sym) -5/2
Hmm.. The critical points are at negative number. So for the above function in it's domain we don't have positive critical numbers. And that indicates that one of the dimension is a constant \(70\) alongside the barn. Let's compute the other dimension:
clear pkg load symbolic syms y y = 65 - x yh = function_handle(y) [yh(0)]
octave> octave> error: 'x' undefined near line 1 column 10 yh = @(y) y octave> ans = 0
So the dimensions of the fields are \(60\) by \(70\) feet.
1.10 Solution 10
Total fence perimeter \(= 200\) feet.
Monthly rent $= \(3\) per square feet.
Monthly rent for advertisement \(= 30\) dollars per feet.
Let the dimension of the field be \(l\) and \(w\).
Area \(= l.w\)
\(2l + 2w = 200\)
\(l + w = 100\)
Area \(= f(l) = l.w = l(100-l)\)
Total monthly income \(= l(100-l).3 + 30.l\)
Let's write some GNU Octave code to solve it:
clear pkg load symbolic syms l f = l*(100-l)*3 + (30*l) df = simplify(diff(f,l)) solve(df==0,l)
octave> octave> f = (sym) 3⋅l⋅(100 - l) + 30⋅l octave> df = (sym) 330 - 6⋅l ans = (sym) 55
Now let's find if the above critical number is where the function attains it's local maxima. The domain for the function is \([0,100]\):
fh = function_handle(f) [fh(0), fh(55), fh(100)]
fh = @(l) 3 * l .* (100 - l) + 30 * l ans = 0 9075 3000
Let's find the other dimension of the field:
clear pkg load symbolic syms l w = 100 - l wh = function_handle(w) [wh(55)]
octave> octave> w = (sym) 100 - l octave> wh = @(l) 100 - l ans = 45
So the dimensions of \(55\) and \(45\) feet of the field are best to maximize his monthly income.