A rectangle is drawn so that it fits inside the region bound by the curve $y=4Sin(x)$ A rectangle is drawn so that it fits inside the region bound by the curve $y=4Sin(x)$ where $0 \le x \le \pi$ and the x-axis. Find the maximum perimeter of the rectangle using optimization.
So far i've tried to say since it's a rectangle $P=2x+2y$ and thus, $P=2x+8Sin(x)$. But finding the maximum value of $x$ by letting the derivative be $0$ ended up with the value of $x$ being $104.47$. Which is outside the domain given. 
Any help would be greatly appreciated. Thankyou
 A: You seem to be confused with the concept of radian and degree systems.
$104.47$ degree is basically ${104.47\over\ 180}\pi$ in radian and your answer is correct.
A: It's not clear what you mean by $x$ and $y$ in your answer. The variables should be clearly defined.
Here's one way to approach this: first establish that any such rectangle will: a) touch the curve at two vertices and b) be symmetrical about the vertical line $x = \frac{\pi}{2}$. Both of these are easy to show by elementary arguments.
Once you've done that, define $2X$ to be the length horizontal base of the rectangle, i.e. the base which spans from $\frac{\pi}{2}-X$ to $\frac{\pi}{2}+X$. The vertical height is $4\sin({\frac{\pi}{2}+X}) = 4\cos X$. The perimeter (twice the length of the base plus twice the height) is therefore $4X + 8\cos X = 4(X + 2\cos X)$.
This is the quantity you have to maximise. So set $f(X) = 4(X + 2\cos X)$ and compute $f'(X)$ then set $f'(X) = 0$. Show that it is a maximum by considering the sign of $f''(X)$. Finally, use this to find the perimeter. The rest should be quite easy, just basic calculus.
