# Area of the largest rectangle bounded by $y=x^2$ and the x-axis within the unit interval

I am trying to find the area of the largest rectangle (whose sides are parallel to the coordinate axes) contained in the region bounded by the graphs of $y = 0, y = x^2,$ and $x = 1$ using Mathematica. I am not sure where to begin other than that the area of a rectangle is $l w$. Any ideas?

• (1) Have you plotted the graphs yet? (2) The easier version of this problem assumes the rectangle's sides are parallel to the coordinate axes. The harder version does not make this assumption. Which version do you want to solve? – whuber Apr 11 '13 at 3:39
• In a situation where you're not sure how to begin, it's usually best to try doing it by hand instead of jumping straight into Mathematica. – Jens Apr 11 '13 at 3:44
• whuber - The problem assumes the rectangle's sides are parallel to the coordinate axis. Jens - writing it down by hand I believe I would just substitute y with x^2 and then find the derivative? – ppkjref Apr 11 '13 at 3:45
• the graph looks like Plot[x^2, {x, -2, 2}, GridLines -> {{1}, {0}}] – ppkjref Apr 11 '13 at 4:14

There are several ways to investigate this problem in Mathematica. The first thing I might do would be to build a Manipulate panel that lets me explore the problem space.

Manipulate[
Plot[t^2, {t, 0., 1.},
AspectRatio -> Automatic,
Epilog -> {Red,
Line[{{x, 0}, {x, x^2}}],
Line[{{1, 0}, {1, x^2}}],
Line[{{x, x^2}, {1, x^2}}]}],
{{x, N[2/3]}, 0., 1., Appearance -> "Labeled"}] The red rectangle has dimensions x^2 by 1 - x, so it is a good idea to plot the expression (x^2) (1 - x), which represents the area.

Plot[(x^2) (1 - x), {x, 0., 1.}] This shows a maximum near 0.66, which suggests the answer might be something like (2/3)^2 (1 - 2/3) = 4/27.

To confirm this, use Maximize.

Maximize[{(x^2 ) (1 - x), x > 0 && x <= 1}, {x}]


{4/27, {x -> 2/3}}

• Simple and instructive. +1 – Mr.Wizard Apr 12 '13 at 17:53
• In an analogous manner Minimize[{(1 - x) x^2, 0 <= x <= 1}, x] searches for minimum area x's. Do you have any idea why it doesn't return x -> 1 too? – BoLe Apr 12 '13 at 21:32
• @BoLe. I imagine it's because there isn't a (local) minimum at $x=1$. – m_goldberg Apr 12 '13 at 23:37
• It is a minimum, and it's more local to x = 2/3. :) – BoLe Apr 13 '13 at 0:31
• @BoLe. The expression (x^2) (1 - x) has no minimum at $x=1$. Don't confuse the algebraic expression with its interpretation as an area. – m_goldberg Apr 13 '13 at 6:45

For starter try and see that any rectangle will have first corner at some 0 <= x <= 1. That makes its area P(x) = (1 - x) * x^2 which has two extreme values:

Solve[D[(1 - x) x^2, x] == 0, x]

(* {{x -> 0}, {x -> 2/3}} *)


Mminimum, ie. zero at x = 0 (rectangle as a line; also at x = 1) and maximum at x = 2/3 with area 1/3 * (2/3)^2.