# Optimization, rectangle inscribed inside arch of the curve.

A rectangle is to be inscribed under the arch of the curve $y = 4\cos(0.5x)$ from $x = \pi$ to $x = -\pi$. What are the dimensions of the rectangle with largest area, and what is the largest area?

Attempt: I have graph it and by looking at the graph, I can see the area of the inscribed rectangle is $A = (2x)(y)$. Where $2x$ is the total base, and y is the height.

Now I substitute $y = 4\cos(0.5x)$ on the $A = (2x)(y) = 2x[4\cos(0.5x)]$.

So $A = 8x\cos(0.5x)$. Then the derivative using the product rule is with respect to $x$ is

$$A' = 4\cos(x) - 4x\sin(0.5x)$$

However, when I tried to set the derivative equal to zero to find the critical numbers I don't know how to solve $\cos(x) = x\sin(0.5x)$. Can anyone please help me? I would really appreciate the help. Thank you.

First, I think that there is a small mistake in the derivative since $$A = (2x)(y) = 2x[4\cos(0.5x)]=8 x \cos(\frac{x}{2})$$ lead to $$A'=8 \cos \left(\frac{x}{2}\right)-4 x \sin \left(\frac{x}{2}\right)$$ you want to be zero. Then, as you notice, the problem is to solve the equation $$f(x)=2 \cos \left(\frac{x}{2}\right)- x \sin \left(\frac{x}{2}\right)=0$$ which could be written in many other forms.
If you plot $f(x)$ between $0$ and $\pi$, you will notice that there is a solution somewhere close to $2$. So, let us use Newton iterative method which write $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ and let us start at $x_0=2$. The successive iterates will be $1.72907$, $1.72068$, $1.72067$ which is the solution for six significant figures.
Let $y = 0.5x$ Then you have $cos(2y) = 2y\ sin(y)$. Now try a double angle identity, and perhaps quadratic equation. Otherwise, you can solve it numerically, at worst case.