 # Optimization Problems for Calculus 1

Optimization problems for calculus 1 are presented with detailed solutions. It may be very helpful to first review how to determine the absolute minimum and maximum of a function using calculus concepts such as the derivative of a function.

## Steps in Solving Optimization Problems

1 - You first need to understand what quantity is to be optimized.
2 - Draw a picture (if it helps) with all the given and the unknowns labeling all variables.
3 - Write the formula or equation for the quantity to optmize and any relationship between the different variables.
4 - Reduce the number of variables to one only in the formula or equation obtained in step 3.
5 - Find the first derivative and the critical points which are points that make the first derivative equal to zero or where the first derivative in undefined
6 - Within the domain, test the endpoints and critical points to determine the value of the variable that optimizes (
absolute minimum and maximum of a function ) the quantity in question and any other variables that answer the questions to the problem.
To find out if an extremum is a minimum or a maximum, we either use the sign of the second derivative at the extremum or the signs of the first derivative to the left and to the right of the extremum.

## Problems

Problem 1
Find two positive numbers such their product is equal to 10 and their sum is minimum. Check your answer graphically.

Solution to Problems 1
Let $x$ be the first number and $y$ be the second number, such that $x \gt 0$ and $y \gt 0$ and $S$ the sum of the two numbers.
Sum: $S = x + y$ , quantity to be optimized has two variables
Product: $x \cdot y = 10$ , given relationship between the two variables
Solve the above for $y$
$y = \dfrac{10}{x}$
Substitute $y$ by $\dfrac{10}{x}$ in the sum
$S(x) = x + \dfrac{10}{x} = \dfrac{x^2 + 10}{x}$ with domain $x \gt 0$ , the quantity to be optimized contains one variable only
Find the first derivative of $S$
$S'(x) = \dfrac{x^2-10}{x^2}$
Zeros of derivative
$x = \sqrt{10}$ and $x = - \sqrt{10}$ , Zeros of the first derivative are critical points
Select $x$ positive: $x = \sqrt{10}$ is a crtical point of $S$ , Select critical points in the domain
The domain of $S$ does not have endpoints and $S$ may therefore have a minimum at the critical point.
Calculate the second derivative of $S$
$S''(x) = \dfrac{20}{x^3}$ , The sign of the second derivative gives the concavity which in turn tells whether we have a minimum or a maximum
Since $x \gt 0$, $S''(\sqrt{10})$ is positive (concave up) which confirms that $S$ has a minimum at $x = \sqrt{10}$
The two positive numbers $x$ and $y$ whose product is equal to 10 and their sum is minimum are:
$x = \sqrt{10} \approx 3.16$    and    $y = \dfrac{10}{\sqrt{10}} = \sqrt{10} \approx 3.16$
The graph below is that of the quantity to optimize $S = x + \dfrac{10}{x}$ that has a minimum value at $x \approx 3.16$ Problem 2
Find two positive numbers such that the sum of six times the first and twice the second is equal to 150 and their product is maximum.

Solution to Problems 2
Let $x$ be the first number and $y$ be the second number and $P$ the product of the two numbers.
$P = x \cdot y$
$6 x + 2 y = 150$ , given
Solve the above for $y$
$y = 75 - 3 x$
Substitute $y$ by $75 - 3 x$ in $P$
$P(x) = x \cdot (75 - 3 x) = 75 x - 3 x^2$
First derivative of $P$
$P'(x) = 75 - 6 x$
Zero of derivative
$x = 75/6 = 25/2$
Second derivative of $P$
$P''(x) = - 6$ , second derivative negative, concavity down, which confirms that $P$ has a maximum at $x = 25/2$
$y = 75 - 3 x = 75 - 3 \dfrac{25}{2} = \dfrac{75}{2}$

Problem 3
Suppose you have to fence two rectangular fields with the same dimensions, with one side in common, using 180 meters of fencing. Find the dimensions of the rectangles so that the total fenced area is maximum.

Solution to Problems 3
Draw a picture such that $L$ is the length and $W$ the width of each rectangle and the width is the common side. Total Area of the two rectangles is: $A = 2 L \cdot W$
Total length of fencing is: $4 L + 3 W = 180$ (Equation 1)
Solve the above equation for $W$
$W = 60 - \dfrac {4}{3} L$
Substitute $W$ by $60 - \dfrac {4}{3} L$ in the formula of the area $A$
$A(L) = 2 L (60 - \dfrac {4}{3} L) = - \dfrac {8}{3} L^2 + 120 L$
There are several ways to find the domain of $A$. Let us use a graphical method.
We plot the graph of the linear equation $4 L + 3 W = 180$ as shown below and determine the range of values that $L$ takes. From the graph, we have
The smallest value of $L$ is zero
The largest value of $L$ is 45
Hence the domain of $A$ is given by the interval: $L \in [ 0, 45]$
Calculate first derivative of $A$ with respect to $L$
$A'(L) = - \dfrac {16}{3} L + 120$
Find Zeros of $A'$
$- \dfrac {16}{3} L + 120 = 0$
Solve the above equation for $L$
$L = 22.5$
Evaluate $A$ at the critical point and the endpoints.
$A(22.5) = - \dfrac {8}{3} (22.5)^2 + 120 (22.5) = 1350$
$A(0) = 0$
$A(45) = - \dfrac {8}{3} (45)^2 + 120 (45) = 0$
$A(L)$ has an absolute maximum for $L = 22.5$ meters
and $W = 60 - \dfrac {4}{3} (22.5) = 30$ meters
The dimensions of each rectangle are: $22.5$ by $30$

Problem 4
A wire of 100 cm is cut in two pieces to make a square and a circle. Find the length of each piece of wire so that the sum of the area enclosed by the square and the circle is minimum.

Solution to Problems 4
Let $x$ be the length of the first piece to make a square and $y$ the second piece to make a circle. $x$ and $y$ are the perimeter and the circumference of the square and the circle respectively. $x + y = 100$    (Equation 1)
Let $s$ be the side of the square. Since $x$ is the perimeter of the square, we write
$x = 4 s$
Hence the side $s$ of the square is given by
$s = \dfrac{x}{4}$
Let $r$ the radius of the circle. Since $y$ is the circumference of the circle, we write
$y = 2 \pi r$
Hence radius $r$ of the circle is given by
$r = \dfrac{y}{2 \pi}$
Let $A$ be the total area enclosed by the square and the circle
$A = s^2 + \pi r^2$
Substitute $s$ and $r$ by their expressions above
$A = \left (\dfrac{x}{4} \ \right)^2 + \pi \left( \dfrac{y}{2 \pi} \right)^2$
Simplify
$A = \dfrac{x^2}{16} + \dfrac{y^2}{4 \pi}$
Solve Equation 1 for $y$
$y = 100 - x$
Substitute $y$ by $100 - x$ in $A$ above
$A(x) = \dfrac{x^2}{16} + \dfrac{(100-x)^2}{4 \pi}$
In theory $x$ can take values from zero to $100$; hence the domain of $A$ is given by the interval: $x \in [0,100]$
Calculate first derivative of $A$
$A' = \dfrac{x}{8}-\dfrac{1}{2\pi }(100-x)$
Find Zeros of $A'$
$\dfrac{x}{8}-\dfrac{1}{2\pi }(100-x) = 0$
Solve for $x$
$x = \dfrac{400}{\pi +4} \approx 56$ meters
Evaluate $A$ at the critical points and the endpoints
$A(56) = \dfrac{56^2}{16} + \dfrac{(100-56)^2}{4 \pi} = 350$
$A(0) = \dfrac{0^2}{16} + \dfrac{(100-0)^2}{4 \pi} = 795$

$A(100) = \dfrac{100^2}{16} + \dfrac{(100-100)^2}{4 \pi} = 625$
The total area $A$ is the smallest (minimum) at $x = 56$
We now use equation 1 to find $y$
$y = 100 - x = 44$ meters

Problem 5
A box with square ends of side $x$ and a length $L$ is to be made such that $L + 4 x = 4$ meters. Find the dimensions of the box that give the largest volume.

Solution to Problems 5
The area of a square end of side $x$ is $x^2$
The volume $V$ of the box.
$V = x^2 L$
Solve the given equation $L + 4 x = 4$ for $L$
$L = 4 - 4 x$
Substitute $L$ by $4 - 4 x$ into the expression of the volume
$V(x) = x^2 (4 - 4x)$
The smallest theoretical value of $x$ is zero. The largest value of $x$ is obtained by setting $L = 0$ in the given equation $L + 4 x = 4$. Hence the largest value of $x$ is $1$.
The domain of $V$ is given by the closed interval: $x \in [0,1]$
Calculate first derivative of $V$
$V '(x) = 8x-12x^2$
Find Zeros of $V'$
$8x - 12x^2 = 0$
Critical points are solutions to the above equation: $x = 0$ and $x = \dfrac{2}{3}$ and both are within the domain
Evaluate $V$ at the critical points and the endpoints.
$V(0) = 0^2 (4 - 4(0)) = 0$
$V(2/3) = (2/3)^2 (4 - 4(2/3)) = 16/27$
$V(1) = (1)^2 (4 - 4(1)) = 0$
The largest volume is obtained for $x = 2/3$
We now use given equation to find $L$
$L = 4 - 4 x = 4/3$ meters

Problem 6
The total cost, including manufacture, packaging and distribution, of an electronic calculator is $21. If the machine sells at $x$ dollars each, the number $n$ of machines sold is $n = \dfrac{200}{x-21} + 10(50-x)$ What selling price $x$ will maximize the profit? (Hint: Profit = Total Revenue for $n$ machines - Total Cost for $n$ machines) Solution to Problems 6 Let $R_t$ be the total revenue in selling $n$ machines; it is given by $R_t = n x$ Let $C_t$ be the total cost of manufacturing, packaging and distribution of $n$ machines; it is given by $C_t = 21 n$ The profit $P$ for $n$ machines is given by $P = R_T - C_T = n x - 21 n = n (x - 21)$ Substitute $n$ by its expression given above and write $P = \left(\dfrac{200}{x-21} + 10(50-x) \right) (x - 21)$ Simplify $P(x) = 200 + 10(50-x)(x - 21) = -10x^2+710x-10300$ The domain of $P$ is: $x \in (0 , \infty)$ because if the selling price $x$ is smaller than or equal to the cost of$21, there is no profit at all and there is no upper limit to the selling price.
Calculate first derivative of $P$
$P '(x) = -20x + 710$
Find Zeros of $V'$
$-20x + 710 = 0$
$x = 35.5$
Because there are no endpoints, we use the second derivative to confirm that the profit is maximum at $x = 35.5$.
Calculate the second derivative of $V$
$P''(x) = -20$
The second derivative is negative (concave down) and confirms that the profit $P$ is a maximum for a selling price $x = 35.5$

Problem 7
What are the dimensions of the rectangle with the largest area that can be inscribed under the arc of the curve $y = \dfrac{1}{x^2+1}$ and the x axis?

Solution to Problems 7
Let $x$ be half the length of the rectangle. The vertex of the rectangle is on the curve and therefore has a y coordinate equal to $\dfrac{1}{x^2+1}$. The width of the rectangle is equal to the y coordinate of the top right vertex as shown in the graph above. Hence the $A$ area of the rectangle is given by
$A(x) = 2 x \cdot \dfrac{1}{x^2+1}$
The domain of $A$ is given by the interval: $x \in [0 , \infty)$
Calculate first derivative of $A$
$A ' (x) = \dfrac{2(x^2 + 1)-2x(2x)}{{\left(x^2+1\right)^2}} = \dfrac{2\left(1 -x^2\right)}{\left(x^2+1\right)^2}$
Find Zeros of $A'$
$1-x^2 = 0$
Two solutions: $x = 1$ and $x = - 1$
$x$ is greater than or equal to zero, we therefor select the critical point $x = 1$
Calculate the second derivative of $A$
$A''(x) = -\dfrac{4x(-x^2+3)}{(x^2+1)^3}$
Calculate the value of $A''$ for $x = 1$
$A''(1) = - 1$
$A''(1)$ is negative (concave down) and therefore $A$ is maximum at $x = 1$.
The dimensions of the rectangle with largest area are
Length = $2 x = 2(1) = 2$
Width = $\dfrac{1}{1^2+1} = \dfrac{1}{2}$

Problem 8
What are the dimensions of the rectangle with the largest area that can be inscribed in the right triangle of height 4 and hypotenuse 5?

Solution to Problems 8
A diagram for this problem is necessary. The area $A$ of the rectangle is given by
$A = h \cdot w$
We now need to find a relationship between $h$ and $w$.
We first use the Pythagorean theorem to find the base BC of the right triangle
$BC = \sqrt{5^2 - 4^2} = 3$
Triangles AEF and ABC are similar, hence the equality of the ratios
$\dfrac{AE}{EF} = \dfrac{AB}{BC}$
$AE = 4 - h$ , $EF = w$ , $AB = 4$ and $BC = 3$
Substitute
$\dfrac{4-h}{w} = \dfrac{4}{3}$
$h = - \dfrac{4}{3} w + 4$
Substitute $h$ by the above expression in the area $A$
$A = (- \dfrac{4}{3} w + 4) w = - \dfrac{4}{3} w^2 + 4w$
Domain of $A$ is given by: $w \in [0 , 3]$
Calculate first derivative of $A$
$A '(w) = - \dfrac{8}{3} w + 4$
Find Zeros of $A'$
$- \dfrac{8}{3} w + 4 = 0$
critical point, solution of the above equation: $w = \dfrac{3}{2}$
Evaluate $A$ at the critical point and the endpoint of the domain
$A(3/2) = 3$
$A(0) = 0$
$A(3) = 0$
The rectangle has a maximum area for $w = 3/2$
The dimensions of the rectangle with maximum area are
$w = x = \dfrac{3}{2}$
$h = - \dfrac{4}{3} w + 4 = - \dfrac{4}{3} \dfrac{3}{2} + 4 = 2$

Problem 9
Show analytically that the function $f(x) = - 5 - 4 \cos(x) + \cos(2x) \; , \; \text{for} \; 0 \le x \le 2\pi$ is never positive.

Solution to Problems 9
One way to answer this question is to show that the maximum value of function $f$ is not positive.
Calculate first derivative of $f$
$f '(x) = 4 \sin(x) - 2 \sin(2x)$
Use the identity $\sin(2x) = 2 \sin(x) \cos(x)$ to rewrite the derivative in factored form as
$f '(x) = 4 \sin(x) - 2 \sin(2x) = 4 \sin(x) - 4 \sin(x) \cos(x) = 4 \sin(x) (1 - cos(x) )$
$\sin(x) = 0$ ; gives three solutions within the domain $[0 , 2\pi]$
$x = 0$ , $x = \pi$ and $x = 2 \pi$
$1 - cos(x) = 0$ which is equivalent to $cos(x) = 1$
has two solutions within the domain $[0 , 2\pi]$
$x = 0$ and $x = 2\pi$
We now determine the absolute maximum value of $f$ at all the zeros of the first derivative and the endpoints
$f(0) = - 5 - 4 \cos(0) + \cos(2(0)) = - 8$
$f(2\pi) = - 5 - 4 \cos(2\pi) + \cos(2(2\pi)) = - 8$
$f(\pi) = - 5 - 4 \cos(\pi) + \cos(2(\pi)) = 0$
The maximum value of $f(x)$ is equal to zero and therefore $f(x)$ is never negative.

Problem 10
Find the radius $r$ of the base of a cone and its altitude $h$ such that the slant height is $5$ cm and its volume is the largest.

Solution to Problems 10 The volume of a cone of radius $r$ and altitude $h$ is given by
$V = \dfrac{1}{3} \pi r^2 h$
Using the Pythagorean theorem, we can write
$h^2 + r^2 = 5^2$
Solve the above for $h$
$h = \sqrt{25 - r^2}$
Substitute $h$ in the volume $V$
$V(r) = \dfrac{1}{3} \pi r^2 \sqrt{25 - r^2}$
The domain of $V$ is given by: $r \in [0,5]$

Calculate first derivative of $V$
$V '(r) = \dfrac{\pi}{3} (2r \sqrt{25 - r^2} + r^2 (\dfrac{1}{2}) (-2r) (25 - r^2)^{-1/2} ) = \dfrac{\pi}{3} \dfrac{(50r-3r^3)}{\sqrt{25-r^2}}$
Find Zeros of $A'$
$50 r -3r^3 = 0$
Factor
$r(50 - 3 r^2) = 0$
The above equation has three solutions: $r = 0$ , $r = \sqrt{\dfrac{50}{3}} \approx 4.08$ and $r = - \sqrt{\dfrac{50}{3}} \approx - 4.08$.
$r = - \sqrt{\dfrac{50}{3}}$ is not in the domain and therefore there are three critical points:
Function $V$ has 3 critical points: $r = 0$ , $r = \sqrt{\dfrac{50}{3}}$ and $r = 5$
$r = 0$ and $r = \sqrt{\dfrac{50}{3}}$ make $V' = 0$
and $r = 5$ is a value that makes the denominator of $V'$ equal to zero and therefore the derivative $V'$ is undefined.

Evaluate $V$ at the critical points and the endpoints.
$V(\sqrt{\dfrac{50}{3}}) = \dfrac{1}{3} \pi (\sqrt{\dfrac{50}{3}})^2 \sqrt{25 - (\sqrt{\dfrac{50}{3}})^2} \approx 50.38$

$V(0) = \dfrac{1}{3} \pi 0^2 \sqrt{25 - 0^2} = 0$

$V(5) = \dfrac{1}{3} \pi 5^2 \sqrt{25 - 5^2} = 0$

$r = \sqrt{\dfrac{50}{3}} \approx 4.08$ is the radius that gives a maximum volume.

Substitute $r$ by its numerical value to obtain

$h = \sqrt{25 - r^2} = \sqrt{25 - (\sqrt{\dfrac{50}{3}})^2} = \dfrac{5}{\sqrt{3}} \approx 2.88$

Problem 11
Find the point on the line given by $y = 4 - x$ that is closest to the point $(6 , 3)$

Solution to Problems 11
We first need to understand that by "closest" it is meant the smallest distance.
Any point $M$ on the line $y = 4 - x$ has coordinates $(x , 4 - x)$ The distance D between point $(6 , 3)$ and point M is given by
$D = \sqrt { (x - 6)^2 + (4 - x - 3)^2} = \sqrt { (x - 6)^2 + (1 - x)^2}$
The domain of $D$ is given by: $x \in (-\infty,\infty)$
We are looking for point $M$ that is closest to point $(6 , 3)$ and therefore we are looking for the smallest (minimum) distance $D$ between these two points.

Calculate first derivative of distance $D$
$D ' = \dfrac{1}{2} \dfrac{(4x-14)}{(2x^2-14x+37)^{1/2}}$
Find Zeros of $D'$
$4x-14 = 0$
Solution of the above equation is $x = \dfrac{7}{2}$ which a critical point of $D$
We do not need to find the second derivative because the sigh of the first derivative is easy to obtain. The denominator is a square root and therefore positive. Hence the sign of the first derivative is the same as the sign of the numerator $4x-14$.
For $x < 14/4$ , $D'$ is negative and for $x > 14/4$ , $D'$ is positive and therefore distance $D$ has a minimum at $x = 14/4 = 7/2$
The y coordinate is given by
$y = 4 - x = 4 - 14/4 = 1/2$
the point on the line $y = 4 - x$ that is closest to the point $(6 , 3)$ has the coordinates $(7/2 , 1/2)$

Problem 12
A company is to build a pipeline from point A offshore (in the ocean) to point B along the coastline. The cost of the pipeline to be built along the coastline is $k$ dollars per kilometer and the cost of the pipeline offshore is $3 k$ dollars, where $k$ is constant. Find the distances of the pipeline offshore from A to D and along the coast from D to B so that the total cost of the pipeline from A to B is the lowest. Solution to Problems 12
Let $x$ be the distance from D to B (along the coastline) and $y$ be the distance from A to D (offshore) that we need to find.
Use Pythagorean theorem in triangle ACB to find the distance from C to B.
$CB = \sqrt{50^2 - 30^2} = 40$ km
Distance from C to D is equal to $CB - x = 40 - x$
Use the Pythagorean theorem in triangle ACD to write
$y = \sqrt{30^2 + (40 - x)^2}$
The total cost C of the pipeline is given by
$C_t(x) = k x + 3 k y = k x + 3 k \sqrt{30^2 + (40 - x)^2}$
$x$ can take values from 0 to 40. Hence the domain of $C_t$ is given by the interval: $x \in [0,40]$

Find the derivative of $C_t$
$C_t '(x) = k - 3 k (1/2)(2)(40 - x) (30^2 + (40 - x)^2)^{-1/2} = k \dfrac{(30^2 + (40 - x)^2)^{1/2}-3(40-x)}{(30^2 + (40 - x)^2)^{1/2}}$
Find the zeros of $C_t '$ , k is a constant not equal to zero.
$(30^2 + (40 - x)^2)^{1/2}-3(40-x) = 0$
$(30^2 + (40 - x)^2)^{1/2} = 3(40-x)$
Square both sides
$\left((30^2 + (40 - x)^2)^{1/2}\right)^2 = (3(40-x))^2$
$30^2 + (40 - x)^2 = 9x^2-720x+14400$
$-8x^2+640x-11900 = 0$
The above quadratic equation has two solutions but one of them is an extraneous solution. The only valid solution to the original equation $C'_t(x) = 0$ is
$x = \dfrac{(80-15\sqrt{2})}{2} \approx 29.40$
which is a critical point within the domain.

Evaluate $C_t$ for the two endpoints and the critical point
$C_t(0) = 150 k$
$C_t(40) = 130 k$
$C_t(29.40) = 124.85 k$
Hence $x = 29.40$ km gives the lowest total cost.
$y$ is given by
$y = \sqrt{30^2 + (40 - 29.40)^2} = 31.81$ km

Problem 13
Show that if $x + y = K$ , where $K$ is a constant, then $x \cdot y \le \left(\dfrac{K}{2} \right)^2$.
$x , y$ and $K$ are real numbers.

Solution to Problems 13
We need to show that the maximum of the product $x \cdot y$ is less than or equal to $\left(\dfrac{K}{2} \right)^2$
Express $y$ in terms of $x$
$y = K - x$
Let
$P(x) = x \cdot y = x(K-x) = - x^2 + x K$
The domain of $P$ is given by the interval: $x \in (-\infty , \infty)$
First derivative of $P$, remember $K$ is a constant
$P'(x) = -2x + K$
Find zeros of $P'$
$-2x + K = 0$
Solve for $x$
$x = K/2$
Find second derivative
$P''(x) = -2$
The second derivative is negative (concave down) , hence $P$ has a maximum at $x = K/2$
Find $y$
$y = K - x = K - K/2 = K/2$
The maximum value of $P$ is given by
$P(K/2) = x \cdot y = \dfrac{K}{2} \cdot \dfrac{K}{2} = \left(\dfrac{K}{2} \right)^2$
Hence $P = x \cdot y \le \left(\dfrac{K}{2} \right)^2$