I have a rectangle $ABCD$ and $P$ is a point inside the rectangle and the distance from the point $P$ to all the vertices of the rectangle is given. Now I have to figure out the maximum possible area of the rectangle.

For example: If $PA=13$ , $PC=47$ , $PD=43$ , $PB = 23$ , then what can be the maximum area of the rectangle?

I know single-variable calculus , but here the main problem is that I cannot get an equation involving only one variable.
Two variables are coming into question.

I have also tried it using pure geometry by dropping perpendiculars from the point P to the other sides, then applying Pythagoras but doesn't help. Also, angle chasing is not the case here I guess.

  • $\begingroup$ What is your motivation behind the question? What are your thoughts and ideas behind the problem? If we should help you, it would be important to know that we don't just solve your problem but really help and that the question meets the Math.SE standards. $\endgroup$ Aug 5, 2023 at 8:18
  • $\begingroup$ @KevinDietrich I have now mentioned how I have tried underneath the problem. Looks like a complicated problem to me. Any help will be truly appreciated. $\endgroup$
    – Sayantan
    Aug 5, 2023 at 8:43
  • $\begingroup$ The maximal area of a rectangle with distances $a,b,c,d$ equal to respectively $13$, $23$, $47$, $43$ is $(ac+bd)=1600$. It is a square number, but this maximal area is not obtained for a square... The problem has found through the choice of the numbers a beautiful special case... (I dropped below an answer for the general case of $a,b,c,d$ chosen with the sole constraint $a^2+c^2=b^2+d^2$ needed to have such a point in a rectangle. When more variables, constrained to conditions, appear in an extremum problem we can go by calculus using Lagrange multipliers, see my answer.) +1 $\endgroup$
    – dan_fulea
    Aug 13, 2023 at 2:09
  • $\begingroup$ By the way, which is the source of the problem (and to which level it was addressed, regarding age and skills)? $\endgroup$
    – dan_fulea
    Aug 13, 2023 at 2:11

2 Answers 2


We have the Diagram like this:


$ABCD$ is the rectangle, with Point $P$ inside.

The unknown Segments are $w,x,y,z$.

Pythagoras Theorem: We have the following Equations:

$w^2+x^2=13^2 \tag{1}$
$x^2+z^2=23^2 \tag{2}$
$y^2+z^2=47^2 \tag{3}$
$y^2+w^2=43^2 \tag{4}$

Solve the Set of Equations to get the values. The rectangle will have sides $z+w$ and $x+y$. The Area is then Obtained.

We get: $x^2 = 169 - w^2, y^2 = 1849 - w^2, z = w^2 + 360$, all in terms of $w$.

$$x = \sqrt{169 - w^2}, y = \sqrt{1849 - w^2}, z = \sqrt{w^2 + 360}$$

The Area is:
$$(z+w)(x+y)=[\sqrt{w^2 + 360}+w][\sqrt{169 - w^2}+\sqrt{1849 - w^2}]$$

We have a function in 1 variable ($w$), hence we can differentiate & set that to $0$ to get the $w$ value for local Maximum. Plug that value to get the other unknowns and then get the Maximum Area.

  • 1
    $\begingroup$ Thank you , @TomCarpenter , for high-lighting that typo , which has been resolved [ by user "JRN" ] all should ok now. $\endgroup$
    – Prem
    Aug 6, 2023 at 7:55

I will give two solutions, the elegant one is the geometric one. The reader in hurry may please want to skip to (3) for a very short geometric proof.

Why am i starting differently? The idea for the geometric construction arises after having the dirty solution, the algebraic one. So both solutions have their merit. I will plot them in the order i found them, the first one will be the algebraic no-insight solution. Having it, we try to find a geometric interpretation. This is easily done, we are even constrained to construct as we construct. When the natural geometric elements are there, the geometric solution shows up immediately.

Let us solve the problem in full generality.

(1) First (algebraic) solution and discussion:

We are giving four numbers $a,b,c,d>0$. We are searching for a geometrical configuration which contains

  • a rectangle $ABCD$ with sides $p,q$, taken without restriction to have $A=(0,0)$, $B=(p,0)$, $C=(p,q)$, $D=(0,q)$,
  • and a point $\Pi=(x,y)$ (inside or outside $ABCD$) having distances $a,b,c,d$ to respectively $A,B,C,D$,

such that $pq$ is maximal among all such possible configurations.

First of all, let us collect algebraically the constraints on the variables $p,q,x,y$: $$ \tag{$*$} $$ $$ \left\{ \begin{aligned} x^2 + y^2 &= a^2\ ,\\ (p-x)^2 + y^2 &= b^2\ ,\\ (p-x)^2 + (q-y)^2 &= c^2\ ,\\ x^2 + (q-y)^2 &= d^2\ . \end{aligned} \right. $$ We observe that from the above we have $$ \tag{$**$} a^2 + c^2= x^2+y^2+(p-x)^2+(q-y)^2= b^2 + d^2\ . $$ So there is a condition to be satisfied by the input $a,b,c,d$, namely $a^2+c^2=b^2+d^2$. (And this is the case in the given numerical case: $13^2 + 47^2 = 2378 =43^2 + 23^2$.)

This condition is also geometrically easy to understand. Project $P$ on the four sides, the projection points are $P_{AB}$, $P_{BC}$, $P_{CD}$, $P_{DA}$, we obtain four smaller rectangles with opposite corners $(P,A)$, respectively $(P,B)$, $(P,C)$, $(P,D)$. Using the theorem of Pythagoras to express the squared diagonals $a^2, b^2,c^2, d^2$ of them in terms of the squared projections on the sides, we immediately see that $a^2+c^2=b^2+d^2$.

So we have three equations in four unknowns. There is "one free direction". We need to find a maximum w.r.t. this degree of freedom for the expression $pq$. So let us restate the problem.

Problem: Let $a,b,c,d$ be four positive numbers that satisfy $a^2+c^2=b^2+d^2$. Denote the common value by $e^2$. Consider the set of all $x,y\in\Bbb R$ and all $p,q>0$ so that the relations $(*)$ above are satisfied. Which is the maximal value of the product $pq$?

Short (algebraic) answer: $pq\le ac+bd$.

So in the given case it is $$\ (13\cdot 47 + 23\cdot 43)=\bbox[lightgreen]{\ \bf 1600\ }\ . $$ The equality is obtained as in the following picture. And the green area $ \bbox[lightgreen]{\bf 1600}$ in the picture was shown as value for the rectangle, it is the computed geogebra area. The picture is "involved", because the numbers $13, 23, 43, 47$ were not so easy to transport from the axes into their final places.

mse question 4747906

This is, as stated in the Problem a purely algebraic problem. It is useful to introduce the following notations, (so $A,B,C,D$ are in this algebraic section no longer the vertices of a rectangle) that make life easier:

We denote by capitalized letter variables the squares of lower case variables.

So now $A,B,C,D;P,Q;X,Y$ stay for $a^2, b^2,c^2,d^2;p^2,q^2;x^2,y^2$ respectively. Let us solve the algebraic problem.

Solution for the algebraic problem:

First of all we eliminate $x,y$. From the first two equations in $(*)$, subtracting them, we obtain:

$P+A-B=p^2+a^2-b^2=2px$. Similarly for the middle two equations

$Q+B-C=q^2 + b^2 -c^2 =2qy$.

We extract from the linear dependencies $x,y$, and plug them in into the first equation. This gives successively: $$ \begin{aligned} 4PQ\; A &= 4p^2q^2a^2 = 4p^2q^2x^2+ 4p^2q^2y^2 \\ &=Q(2px)^2 + P(2qy)^2 =Q(P+A-B)^2 + P(Q+B-C)^2\ , \\[3mm] &\text{ In simpler form:} \\[3mm] 0 &= PQ(P+Q) -2PQ(A+C) + Q(A-B)^2 + P(B-C)^2\ . \end{aligned} $$ We equivalently want to maximize $PQ$ constrained to the above condition, in the domain $P,Q>0$. It is clear that the maximum is not reached at the boundary, which is $PQ=0$. (Because the value at the boundary of the function to be maximized is $PQ=0$.) So the maximal value is also a local extremal value, it is thus obtained as a critical point for the (Lagrange multiplicators) help function $h$ (and i use $m$ instead of $\lambda$ for an easy typing): $$ h(P,Q;m):=PQ-m\Bigg(\ PQ(P+Q) -2PQ(A+C) + Q(A-B)^2 + P(B-C)^2\ \Bigg)\ . $$ Such a critical point satifies the three equations $0=h'_P=h'_Q=h'_m$, and the resulted algebraic system is: $$ \left\{ \begin{aligned} 0 &= h'_Q = P - m\Big(\ P(2Q+P) - 2P(A+C) + (A-B)^2 \ \Big)\ ,\\ 0 &= h'_P = Q - m\Big(\ Q(2P+Q) -2Q(A+C) + (B-C)^2\ \Big) \ ,\\ 0 &= -h'_m = PQ(P+Q) -2PQ(A+C) + Q(A-B)^2 + P(B-C)^2\ . \end{aligned} \right. $$ We eliminate $m$ from the first two equations above, $$ \frac {PQ}m = PQ(2Q+P) -2PQ(A+C)+Q(A-B)^2\ ,\\ \frac {PQ}m = PQ(2P+Q) -2PQ(A+C)+P(B-C)^2\ , $$ and subtract: $$ 0 = PQ(P-Q) - Q(A-B)^2 + P(B-C)^2\ . $$ Add now the above to the third relation $0=h'_m$ to obtain the simpler equation, since $Q(A-B)^2$ cancels: $$ P^2Q - PQ(A+C) + P(B-C)^2\ . $$ We can factorize $P\ne0$. We finally get $$ \tag{$\dagger$} PQ=Q(A+C)-(B-C)^2\ . $$ A similar equation is obtained by adding instead of subtracting above, and making that $P(B-C)^2$ cancels. We factorize $Q\ne0$. We obtain a linear relation (both sides being equal to $PQ$): $$ Q(A+C)-(B-C)^2 = P(A+C) - (A-B)^2\ . $$ We extract $P$ as a function of $Q$, $P=Q +(A-C)(D-B)/(A+C)$, and plug in into $(\dagger)$. The resulted equation of second degree in $Q$ is: $$ \tag{$\dagger\dagger$} 0 = Q^2 + \frac 1{A+C}\Big(\ (A-C)(D-B) - (A+C)^2\ \Big)Q + (B-C)^2\ . $$ The coefficient of $Q$ involves $(A-C)(D-B) - (A+C)^2 =(A-C)(D-B) - (A+C)(D+B) =-2(AB+CD)$. The half discriminant is $$ \left(\frac{AB+CD}{A+C}\right)^2-(B-C)^2 =\frac 1{A+C}^2\Big(\ (AB+CD)^2 -(B-C)^2(A+C)^2\ \Big) =\frac 1{A+C}^2\Big(\ (AB+CD)^2 -(AB-CD)^2\ \Big) =\frac {4ABCD}{A+C}^2=\frac{4a^2b^2c^2d^2}{A+C}^2\ . $$ So we can write the possible solutions: $$ (q^2)_\pm Q_\pm= \frac{AB+CD}{A+C}\pm \frac{2abcd}{A+C}\ . =\frac 1{A+C}{a^2b^2+c^2d^2\pm 2abcd} =\frac {(ab+cd)^2}{a^2+c^2}\ . $$ And we take of course only the bigger value as a critical value for reaching the maximum. (There is only one choice, and we take it.) $$ q_+ =\frac{ab+cd}{\sqrt{a^2+c^2}}\ . $$ In a similar manner, the point $p_+$ for the solution of the system, and thus the only one relevant as a critical value is: $$ p_+ =\frac{ad+bc}{\sqrt{a^2+c^2}}\ . $$ So the maximal value of the product is: $$ \bbox[yellow]{\qquad p_+q_+ =\frac 1{a^2+c^2}(ab+cd)(ad+bc) =ac+bd \qquad\ .\ } $$ $\square$

It looks like all the above computations are painful. Well, there is an alternative to get the same result (checked) in only few lines, below in sage.

R.<a,b,c,d,p,q,m> = PolynomialRing(QQ)
A, B, C, D, P, Q = a^2, b^2, c^2, d^2, p^2, q^2
h = P*Q - m*( -4*P*Q*A + Q*(P + A - B)^2 + P*(Q + B - C)^2 )
J = R.ideal([ diff(h, P), diff(h, Q), diff(h, m), A + C - B - D])
gen = J.elimination_ideal([m, d, p]).gens()[0]

And there are three easy factors, and a "complicated" one... Manually rearranged output:

(-a + b)^2 * (a + b)^2 * q^4 
* (a^2*b^4 - 2*a^2*b^2*c^2 + b^4*c^2 + a^2*c^4 - 2*b^2*c^4
       + c^6 - 2*a^2*b^2*q^2 - 2*a^2*c^2*q^2 + 2*b^2*c^2*q^2
       - 2*c^4*q^2 + a^2*q^4 + c^2*q^4)

The complicated one, expr below, is giving the equation of degree two in $Q=q^2$ from $(\dagger\dagger)$. Using now the computer to solve needs some few more lines.

(2) Geometric interpretation:

Geometric problem: Let $a,b,c,d>0$ be so that $a^2+c^2=b^2+d^2$, and denote the common value by $e^2$. (We may and do assume $a\le b\le d\le c$, so that the picture corresponds to the one below.) Then the numbers $a,c,e$ and $b,d,e$ are the sides of two right triangles, and we draw them inscribed in a circle on both sides (half-planes) of a diameter with length $e$: mse problem 4747906 geometric form Use points $\Psi,\Pi;S,T,T'$ labeled as in the picture. Then the biggest area of a rectangle that accepts a point with distances $a,b,c,d$ to its vertices is: $$ac+bd=2[S\Psi T\Pi]\ ,$$ and the rectangle realizing this maximum has sides $f,F$.

Indeed, using Ptolemy we have $ab+cd=eF$ and $ad+bc=ef$. So in the above notations $q_+=(ab+cd)/e=eF/e=F$, and $p_+ = (ad+bc)/e=ef/e=f$.

(3) Proof for the geometric version:

mse geometric proof 4747906

(The picture is the proof. Try to figure it out here, without reading further.)

In the picture we start with the rectangle $ABCD$ and a point $\Pi$ having distances $a,b,c,d$ to its distances. Construct now points $P_{AB}$, $P_{BC}$, $P_{CD}$, $P_{DA}$ as in the picture. The point $\Pi_{DA}$ is obtained for instance by copy+pasting the triangle $\Delta \Pi BC$ after a translation in direction $\vec{BA}=\vec{CD}$. Similar constructions apply for the other points. After all copy+paste steps the area $[ABCD]$ is doubled. We can estimate geometrically: $$ \begin{aligned} 2[ABCD] &= [P_{AB}\; B\; P_{BC}\; C\; P_{CD}\; D\; P_{DA}\; A] \\ &= \sum_\text{cyclic} [\Pi A\Pi_{AB}B] = \sum_\text{cyclic} \frac 12 \Pi\Pi_{AB}\cdot AB \\ &\le \sum_\text{cyclic} \frac 12 (ac+bd)=2(ac+bd)\ . \end{aligned} $$ The equality is obtained when $\Pi A\Pi_{AB}B$ (and/or the other three quadrilaterals) are cyclic, we use Ptolemy.


(4) Construction of the maximizing configuration: Start with the figure in (2). Recall that $ST=f$, $ST'=F$. Let $U$ be opposite to $S$ in the circle $(S\Psi TT'\Pi)$. SO $SU$ diameter, and $\widehat{ST'U}=90^\circ$. Construct perpendiculars in $S,T'$ on $ST'$ and on them segments of length $f$. We obtain a rectangle $ST'XY$ as in the figure.

mse problem 4747906 configuration realizing the maximal value

The points $T,Y$ are mirrored w.r.t. $S\Pi$, for instance following the path

$ \widehat{YS\Pi} = 90^\circ - \widehat{T'S\Pi} = 90^\circ - \widehat{T'\Psi\Pi} = \widehat{\Psi\Pi T'} = \widehat{\Pi\Psi T} = \widehat{\Pi ST} $.

So $\Pi Y=\Pi T=d$. It follows also $\Pi X=a$, because $\Pi$ has the lengths $b,c,d$ to three vertices of a rectangle.

The area of $[ST'XY]$ is $fF=p_+q_+=ac+bd$, the maximal value.



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .