# Junie12's questions at Yahoo! Answers regarding optimization

#### MarkFL

Staff member
Here are the questions:

I'm still doing this horrible study guide for Calculus that my teacher is making me do because I missed most of the semester due to family issues and getting sick a lot. Can someone answer these questions and an example would be awesome if you have the time.

1. Find the formula that should be used to minimize the distance between y = 5x^2 and the point (4, 3).

2. The legs of a right triangle are x and y. Find the equation that will maximize the area of the triangle given that 2x + y = 16.

3. Given the area of a rectangle is A = bh. If perimeter of the rectangle is 2b + 2h = 20, maximize the area of the rectangle.

4. Find the point on the parabola y = x^2 that is closest to the point (0, 2).

5. A student wishes to maximize the amount of poster space for an art exhibit. The requirements are that the height and width must sum to 50. What should the dimensions of the poster be?
I have posted a link there to this thread so the OP can view my work.

#### MarkFL

Staff member
Hello Junie12,

1. Find the formula that should be used to minimize the distance between y = 5x^2 and the point (4, 3).

If we look at problem 4.), we see that they are of the same form, so let's generalize this problem as much as we need to derive a formula into which we may then plug the given data. So let's let the parabola be:

$$\displaystyle y=ax^2$$

and the point (not on the parabola) we'll call:

$$\displaystyle \left(x_0,y_0 \right)$$

Now, an arbitrary point on the parabola is $$\displaystyle (x,y)=\left(x,ax^2 \right)$$ and so the square of the distance $D$ between the two points is:

$$\displaystyle D^2=\left(x-x_0 \right)^2+\left(ax^2-y_0 \right)^2$$

In order to minimize the distance, we need to implicitly differentiate with respect to $x$, solve for $$\displaystyle \frac{dD}{dx}$$, and equate this result to zero to obtain the critical value(s).

$$\displaystyle 2D\frac{dD}{dx}=2\left(x-x_0 \right)(1)+2\left(ax^2-y_0 \right)(2ax)$$

Dividing through by $2D$, and equating to zero, we obtain:

$$\displaystyle \frac{dD}{dx}=\frac{2a^2x^3+\left(1-2ay_0 \right)x-x_0}{D}=0$$

This implies:

(1) $$\displaystyle 2a^2x^3+\left(1-2ay_0 \right)x-x_0=0$$

Plugging in our given data:

$$\displaystyle a=5,\,x_0=4,\,y_0=3$$

we obtain:

$$\displaystyle 50x^3-29x-4=0$$

Now, if we let $$\displaystyle r_1,\,r_2,\,r_3$$ be the three roots of this cubic function in ascending numeric value, we observe that the leading coefficient is positive, thus we know on:

$$\displaystyle \left(-\infty,r_1 \right)$$ cubic is negative.

$$\displaystyle \left(r_1,r_2 \right)$$ cubic is positive.

$$\displaystyle \left(r_2,r_3 \right)$$ cubic is negative.

$$\displaystyle \left(r_3,\infty \right)$$ cubic is positive.

Hence, we know there are local minima associated with $r_1$ and $r_3$. Let's obtain a plot of the cubic:

Here is a link to the program use to obtain the plot in case you cannot view the attachment:

y=50x^3-29x-4 where x=-1 to 1 - Wolfram|Alpha

We see that $r_1\approx-0.7$. We may now use Newton's method to obtain a better approximation:

$$\displaystyle x_{n+1}=x_{n}-\frac{50x_n^3-29x_n-4}{150x_n^2-29}=\frac{4\left(25x_n^3+1 \right)}{150x_n^2-29}$$

$$\displaystyle x_0=-0.7$$

$$\displaystyle x_1\approx-0.680898876404494$$

$$\displaystyle x_2\approx-0.679962570724380$$

$$\displaystyle x_3\approx-0.679960352828821$$

$$\displaystyle x_4\approx-0.679960352816386$$

$$\displaystyle x_5\approx-0.679960352816388$$

$$\displaystyle x_6\approx-0.679960352816388$$

Thus $$\displaystyle r_1\approx-0.679960352816388$$. Now to find $r_3$, which we see is about $0.8$.

$$\displaystyle x_0=0.8$$

$$\displaystyle x_1\approx0.823880597014925$$

$$\displaystyle x_2\approx0.822931436888217$$

$$\displaystyle x_3\approx0.822929903556085$$

$$\displaystyle x_4\approx0.822929903552086$$

$$\displaystyle x_5\approx0.822929903552086$$

And so $$\displaystyle r_3\approx0.822929903552086$$. To determine which of these critical values associated with local minimums of the distance function, we may evaluate the distance function at them:

$$\displaystyle D(-0.679960352816388)=\sqrt{(-0.679960352816388-4)^2+\left(5(-0.679960352816388)^2-3)^2 \right)}\approx4.73030061799106$$

$$\displaystyle D(0.822929903552086)=\sqrt{(0.822929903552086-4)^2+\left(5(0.822929903552086)^2-3)^2 \right)}\approx3.20044106325424$$

Thus, we know the minimum distance between the parabola $y=5x^2$ and the point $(4,3)$ is about $3.20044106325424$ units.

2. The legs of a right triangle are x and y. Find the equation that will maximize the area of the triangle given that 2x + y = 16.

Maximizing the area of the right triangle with legs $x$ and $y$ is equivalent to maximizing the rectangle whose base is $x$ and whose height is $y$. Doing this will given us a formula to use also for problems 3.) and 5.)

So, let our objective function by:

$$\displaystyle f(x,y)=xy$$

Subject to the constraint:

$$\displaystyle g(x,y)=Ax+By+C=0$$

Solving the constraint for $y$, we obtain:

$$\displaystyle y=-\frac{Ax+C}{B}$$

Substituting into the objective function for $y$, we obtain:

$$\displaystyle A(x)=-\frac{Ax^2+Cx}{B}$$

To obtain our critical value, we may differentiate this function with respect to $x$, and equate the result to zero:

$$\displaystyle A'(x)=-\frac{2Ax+C}{B}=0$$

This implies:

$$\displaystyle x=-\frac{C}{2A}$$

To determine the nature of the extremum associated with this critical value, we may look at the second derivative:

$$\displaystyle A''(x)=-\frac{2A}{B}$$

Thus we see that if $$\displaystyle \frac{2A}{B}>0$$ there is a maximum and if $$\displaystyle \frac{2A}{B}<0$$ there is a minimum.

For this problem, we have:

$$\displaystyle A=2,\,B=1,\,C=-16$$

and so $$\displaystyle \frac{2A}{B}=4>0$$, and so the critical value $$\displaystyle x=-\frac{C}{2A}=4$$ is at a maximum.

Hence, the area of the given right triangle is maximized at $x=4$. This maximal area is:

$$\displaystyle A_{\max}=\frac{1}{2}\left(-\frac{2(4)^2+(-16)(4)}{1} \right)=16$$

3. Given the area of a rectangle is A = bh. If perimeter of the rectangle is 2b + 2h = 20, maximize the area of the rectangle.

Using the formula from problem 2.) we first identify the objective function:

$$\displaystyle f(b,h)=bh$$

subject to the constraint:

$$\displaystyle g(b,h)=b+h-10=0$$

Next, we identify the parameters:

$$\displaystyle A=1,\,B=1,\,C=-10$$

Hence, the critical value is:

$$\displaystyle b=-\frac{C}{2A}=5$$

$$\displaystyle \frac{2A}{B}=2>0$$ so we know this critical value is at a maximum.

Thus, we find:

$$\displaystyle f_{\max}=-\frac{(5)^2-10(5)}{1}=25$$

Thus, the area of the rectangle is maximized at an area of $25$ units squared.

4. Find the point on the parabola y = x^2 that is closest to the point (0, 2).

Using the formula from problem 1.) we first identify the parameters:

$$\displaystyle a=1,\,x_0=0,\,y_0=2$$

and so our critical value(s) will come from the cubic

$$\displaystyle 2x^3-3x=x\left(2x^2-3 \right)=0$$

Hence, the critical values are:

$$\displaystyle x=-\sqrt{\frac{3}{2}},\,0,\,\sqrt{\frac{3}{2}}$$

Using the same logic as in problem 1.), we know the local minima occur at:

$$\displaystyle x=\pm\sqrt{\frac{3}{2}}$$

Because the distance formula in this case is:

$$\displaystyle D(x)=\sqrt{x^2+\left(x^2-2 \right)^2}$$

We see that the distance is the same for both critical values. Hence, we may conclude:

$$\displaystyle D_{\min}=\sqrt{\frac{3}{2}+\frac{1}{4}}= \frac{\sqrt{7}}{2}$$

5. A student wishes to maximize the amount of poster space for an art exhibit. The requirements are that the height and width must sum to 50. What should the dimensions of the poster be?

Using the formula from problem 2.) we first identify the objective function:

$$\displaystyle f(b,h)=bh$$

subject to the constraint:

$$\displaystyle g(b,h)=b+h-50=0$$

Next, we identify the parameters:

$$\displaystyle A=1,\,B=1,\,C=-50$$

Hence, the critical value is:

$$\displaystyle b=-\frac{C}{2A}=25$$

$$\displaystyle \frac{2A}{B}=2>0$$ so we know this critical value is at a maximum.

Thus, we find:

$$\displaystyle f_{\max}=-\frac{(25)^2-50(25)}{1}=625$$

Thus, the area of the rectangle is maximized at an area of $625$ units squared when the base $b=25$ and the height $h=25$.