optimize the strength of a rectangular beam cut from an elliptical log with a given equation "if the strength of a rectangular beam is proportional to the product of its width and the square of its depth, find the dimensions of the strongest beam that can be cut from a log whose cross section has the form of an ellipse 9x^2+8y^2 =72"
What is given is that the strength of the beam is proportional to the width times the square of its depth; S (strength) = kwd^2
This question is from an old text I am using to teach myself calculus, "Calculus by Varberg and Purcell," 6th Edition. I was able to come up with the correct depth, but my width is off; it might have something to do with the properties of an ellipse.  Any help in finding where I went astray would be greatly appreciated.
Here was my approach: to determine the 2 radii of an ellipse, I believe one must use the form:
x^2/a^2 +y^2/b^2 =1, where the 2 radii are a and b.   Dividing the given equation for the ellipse through by 72 I obtained:
x^2/8 +y^2/9 =1; therefore, a= sq.rt. 8, b=3. I chose 3 as the longer (major) radius to use, in order to maximize the strength of my rectangular beam.
Using the radius 3, and therefore a diameter of 6 as the diagonal for my beam, I set up the equation from Pythagoras: d^2 +w^2 = 36. Rearranged, d^2= 36-w^2
Substituting d^2 back into S =kwd^2, I obtained S = kw(36-w^2), or, = k(36w-w^3)
The next step was to find S', and set it equal to zero, to be able to maximize my now single variable, w.
S'= 36-3w^2=0; 3w^2 =36; w^2 = 12: w=sq.rt.12, or 2*sq.rt.3
Here is where I think I went astray, as this width was incorrect according to the answer key; but the strange thing is that this led me to the correct depth, according to the answer (but not explanation) given in the book.
Since w^2+d^2=36 (by Pythagoras), and I now had w^2 =12 (which was not correct), I assumed that
d^2 must = 36-12; d^2 =24, and d = sq. rt. 24, or 2* sq.rt. 6.
That answer for the depth was correct according to the answer key.
the answers the book provided were width (w) = 4sq.rt.6/3, and depth (d) = 2sq.rt. 6.
In other words somehow I obtained a correct depth using an incorrect width, so I went way off... but where?  Any help would be very greatly appreciated!  Thank you. I apologize in advance if I made a silly error in my arithmetic, which is quite possible.
 A: You want to maximize
$ S = k w d^2  = k (2 x)(2 y)^2  = 8 k x y^2 $
Subject to $ 9 x^2 + 8 y^2 = 72 $
Thus we have $ y^2 = \frac{1}{8} (72 - 9 x^2 ) $
$ S = k x (72  - 9 x^2 ) $
The scaled derivative is
$ S' = (72 - 9 x^2) + x (- 18 x ) = 0$
From this,
$ x^2 = \dfrac{72}{27} = \dfrac{8}{3} $
And $x = \dfrac{2 \sqrt{6}}{3} $
which leads to $ y^2 = \dfrac{1}{8} ( 7 2 - 24 ) = 6 $ , and $y = \sqrt{6} $
Therefore, $w = 2 x = \dfrac{4 \sqrt{6}}{3} $ and $d = 2 \sqrt{6}$
A: I expect that the solution wants you to assume that the rectangular beam's sides are meant to be proportional to the axes, because it is much harder to think about rectangles that fit into an ellipse sideways. In that case, the corners of the rectangle are at the four points $(\pm x, \pm y)$ for some $x,y$ satisfying $9x^2 + 8y^2=72$. Such a rectangle has width $2x$ and depth $2y$, or vice versa, depending on how you align the beam later.
The optimal solution is shown in blue in the diagram below:

By picking the longest diameter of $6$ in the ellipse, and deciding that it will be the diagonal of your rectangle, you are finding the rectangle shown in red in the diagram! Your solution is not valid, because this rectangle is not actually contained in the ellipse. It would be contained in a hypothetical circle of diameter $6$ (and your answer is correct for that circle).
So is it a coincidence that your depth is correct? Well, you can think of the ellipse as being obtained from the circle of diameter $6$ by squishing it in one direction by a factor of $\frac{\sqrt 8}{3}$. When that happens, the optimal solution also squishes slightly in some direction; to minimize the impact on $\text{width} \cdot \text{depth}^2$, we should squish in a direction that only affects the width.
So your optimal solution with $w = 2 \sqrt 3$ and $d = 2 \sqrt 6$ becomes an optimal solution in the ellipse, with $w = \frac{\sqrt8}{3} \cdot 2\sqrt 3$ and $d = 2\sqrt 6$. This width simplifies to $\frac43 \sqrt 6$, the textbook answer.
