## 170- Midterm 3

The third midterm is here.

Solutions follow.

Problem 1. Consider the region bounded below by the curve $y=x^2-5$ and above by the $x$-axis. A rectangle is inscribed in this region in such a way that one of its sides lies on the $x$-axis and the other two corners are on the parabola. Find the dimensions of the sides of the rectangle that maximize its area.

The graph above (click to enlarge) shows the curve $y=x^2-5$ together with both axes, and a rectangle as required. I have marked the coordinates of one of the corners of the rectangle, as $(x,y)$.

Suppose that $a$ and $b$ are the dimensions of the sides of the rectangle, with $a$ the length of the horizontal sides. Then the area of the rectangle is $ab$, and in order to apply calculus to maximize this function, we first express $a$ and $b$ in terms of $x$.

We have that $a=2x$ and $b=-y=5-x^2$. Hence, if $A(x)$ denotes the area of the rectangle, as a function of $x$, we have that

$A(x)=2x(5-x^2)=10x-2x^3.$

Note that, by our convention, $x>0$. We have $A'(x)=10-6x^2$, so $A'(x)=0\Longleftrightarrow 10-6x^2=0$, or $10=6x^2$, or

$\displaystyle x^2=\frac{10}6=\frac 53,$

or

$\displaystyle x=\pm\sqrt{\frac53}.$

Since $x>0$, it must be the case that $x=\sqrt{5/3}$. Since $A''(x)=-12x<0$, it follows that this value of $x$ gives us a local maximum of the function $A$, and therefore the only maximum in the interval $0\le x\le \sqrt 5$, which is the range of values that $x$ can take and be a length of a rectangle as required.

It follows that

$\displaystyle a=2x=2\sqrt{\frac53}$ and $\displaystyle b=5-x^2=5-\frac 53 =\frac{10}3$,

and the maximum area is $\displaystyle ab=\frac{20}3\sqrt{\frac 53}$.

Problem 2. Two (very long) roads cross each other at a point $P$. One runs north to south, and the other runs east to west. Car $A$ is driving north along the first road, and car $B$ is driving east along the second road. At a particular time, car $A$ is 30 miles to the north of $P$ and traveling at 50 m/h, while car $B$ is 40 miles  to the east of $P$ and traveling at 65 m/h. How fast is the distance between the two cars changing?

The graph above (click to enlarge) shows the situation described in the problem. Given an arbitrary time $t$, let’s denote by $a$ the distance from $A$ to the point $P$ of intersection of the roads, by $b$ the distance from $B$ to $P$, and by $c$ the distance between $A$ and $B$, all computed at time $t$.

The problem is asking us to compute $\displaystyle \dot c=\frac{dc}{dt}$ at the time $t$ that makes $a=30$ and $b=40$, where units are measured in miles, and time is measured in hours.

Note first that $c^2=a^2+b^2$, by the Pythagorean theorem. Then $\displaystyle 2c\frac{dc}{dt}=2a\frac{da}{dt}+2b\frac{db}{dt}$. or

$\displaystyle \frac{dc}{dt}=\frac1{c}\left(a\frac{da}{dt}+b\frac{db}{dt}\right).$

At the time $t$ that we are interested in, we have $a=30$, $b=40$, $c=\sqrt{a^2+b^2}=\sqrt{30^2+40^2}=50$, $\displaystyle \frac{da}{dt}=50$ and $\displaystyle \frac{db}{dt}=65$, so

$\displaystyle \frac{dc}{dt}=\frac1{50}(30\cdot50+40\cdot65)=82$ m/h.

Problem 3. Let $f(x)=\sqrt x$. Find a point $c$ between $0$ and $1$ with the property that $f'(c)$ coincides with the slope between the endpoints of $f(x)$ on ${}[0,1]$.

The slope of the line between the endpoints of $f(x)$ on ${}[0,1]$ is simply

$\displaystyle \frac{f(1)-f(0)}{1-0}=\frac{\sqrt1-\sqrt0}{1-0}=1$,

so we need to solve the equation

$f'(c)=1$.

For this, note that $f(x)=\sqrt x$, so $\displaystyle f'(x)=\frac1{2\sqrt x}$ and we have

$\displaystyle \frac1{2\sqrt c}=1$, or $\displaystyle \frac12=\sqrt c$, or $\displaystyle \frac14=c$.

In the graph above (click to enlarge) I have displayed in different colors the line $x=1/4$ and the line tangent to $y=\sqrt x$ at $x=1/4$. I have also shown the line $y=x$ and the curve $y=\sqrt x$. Note how the tangent line is indeed parallel to the given secant line.

Problem 4. The equation $x^2-2x+1=0$ obviously has solution $x=1$. Show the values of $x_1,x_2,x_3,x_4$ obtained by applying Newton’s method to this equation, starting with $x_0=2$.

Newton’s method begins with a guess $x_0$ (in this case $x_0=2$) and iteratively improves it, approaching a solution of the equation $f(x)=0.$ In this case, $f(x)=x^2-2x+1$. The iterative process is given by the equations

$\displaystyle x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$ for $n=0,1,\dots$

In our case, $f(x)=x^2-2x+1=(x-1)^2$, so $f'(x)=2(x-1)$ and

$\displaystyle \frac{f(x)}{f'(x)}=\frac{(x-1)^2}{2(x-1)}=\frac{x-1}2$,

so $\displaystyle x-\frac{f(x)}{f'(x)}=x-\frac{x-1}2=\frac{x+1}2$, i.e., in our iterative process we have

$\displaystyle x_{n+1}=\frac{x_n+1}2$ for $n=0,1,\dots$

This means that:

• $x_1=(x_0+1)/2=(2+1)/2=1.5$,
• $x_2=(x_1+1)/2=(1.5+1)/2=1.25$,
• $x_3=(x_2+1)/2=(1.25+1)/2=1.125$, and
• $x_4=(x_3+1)/2=(1.125+1)/2=1.0625$.

The graph above (click to enlarge) shows the function $y=x^2-2x+1$, and the “staircase” produced by applying Newton’s method starting with $x_0=2$ and ending with $x_4$.

Problem 5. Find all functions $f(x)$ such that

$\displaystyle f'(x)=2x^3+\frac1x-\sin(2x)$

and $f(1)=1$.

From results in class, we know that if $f'(x)=g'(x)$ for all $x$ in the common domain of $f$ and $g$ then (on each interval where both $f$ and $g$ are defined) there is a constant $c$ such that $f(x)=g(x)+c$.

What this means for the problem at task is that it suffices to guess a function with the given derivative, because then any other function with the same derivative will simply differ from our guess by a constant. From the derivatives studied through the course, we easily see now that

$\displaystyle f(x)=\frac{x^4}2+\ln x+\frac{\cos(2x)}2+c$.

To find $c$, we use that $f(1)=1$: From the formula above, we have that

$\displaystyle 1=f(1)=\frac12+\ln1+\frac{\cos2}2+c,$

or $\displaystyle c=\frac{1-\cos 2}2$, so

$\displaystyle f(x)=\frac{x^4}2+\ln x+\frac{\cos(2x)}2+\frac{1-\cos2}2$.

The two graphs below (click to enlarge) show first $f'(x)$ and then $f(x)$, with a little circle indicating the position of the point $(1,1)$ on the graph.