# Find the largest value of $P=\frac{3x+2y+1}{x+y+6}$

I know there has been a similar question here, but my question is a little bit different

The Problem: Given that $$3(x+y)=x^2+y^2+xy+2$$, then find the maximum value of \begin{align} P=\frac{3x+2y+1}{x+y+6} \end{align} What I was thinking about is that I'm trying to transform P into a first-degree equation on $$x$$, which is totally possible using the condition in the problem, and then apply the basic Cauchy inequalities.

However, I haven't been able to figure it out. The other possibility is to apply differentiation like in the problem I mentioned at the beginning of the question. The problem is that I took this problem from Olympiad training, which often does not use differentiation (so there should be a way that doesn't use the method)

So any help is appreciated

• The first link on Approach0 has the answer to your question. Commented Oct 9, 2021 at 9:06
• @TobyMak Woww! may I please know how do you guys come to know about other links or problems on other websites like
– user960916
Commented Oct 9, 2021 at 9:10
• @DarshanPatil Just type in whatever you want to find using LaTeX and it will search all sites on Maths SE and AoPS. Commented Oct 9, 2021 at 9:10
• I think what was even cooler is that you introduced me to a new engine, so thank you @TobyMak Commented Oct 9, 2021 at 13:06

For $$x=2$$ and $$y=1$$ we obtain a value $$1$$.

We'll prove that it's a maximal value.

Indeed, we need to prove that $$\frac{3x+2y+1}{x+y+6}\leq1$$ and since by the condition $$x+y+6>0,$$ we need to prove that: $$2x+y\leq5.$$ Indeed, by the condition again and by C-S we obtain: $$14=(3-x)^2+(x+y)^2+(3-y)^2=$$ $$=\frac{1}{14}(1^2+3^2+2^2)\left((3-x)^2+(x+y)^2+(3-y)^2\right)\geq$$ $$\geq\frac{1}{14}(3-x+3x+3y+6-2y)^2=\frac{1}{14}(2x+y+9)^2,$$ which gives $$2x+y+9\leq14$$ or $$2x+y\leq5$$ and we are done.

I would apply the following technique. It may not be the best, but I can definitely say it's working:

$$\underline {\text{Case - 1:}}$$ $$\thinspace \thinspace \thinspace \thinspace \thinspace P=2.$$

If $$P=2$$, we get $$x=11$$. This implies,

$$(y + 4)^2 + 74 = 0$$ which gives a contradiction.

$$\underline{\text{Case - 2:}}$$ $$\thinspace \thinspace \thinspace \thinspace \thinspace P≠2$$.

We have,

\begin{align}&2y-Py+3x-Px-6P+1=0\\ \implies &y=\frac{Px-3x+6P-1}{2-P},\thinspace P≠2\end{align}

Then, substituting $$y=\frac{Px-3x+6P-1}{2-P}$$ for $$y$$ in the polynomial equation $$x^2+y^2+xy-3x-3y+2=0$$, we get a quadratic equation with respect to $$x:$$

\begin{align}&x^2(P^2-5P+7)+x(6P^2-28P+10)+(56P^2-59P+15)=0\\ \implies &\Delta_x=- (47 P^4 - 255 P^3 + 476 P^2 - 348 P + 80)≥0\\ \implies &\Delta_x=-(P - 2)^2 (P - 1) (47 P - 20)≥0,\thinspace P≠2\\ \implies &\frac {20}{47}≤P≤1\\ \implies &\min\left\{P\right\}=\frac{20}{47}\\ \implies &\max\left\{P\right\}=1.\end{align}

• I guess your $p$ and $P$ denotes the same $P$ whose maximum value we're looking for? Commented Oct 9, 2021 at 13:08
• @NikolaTolzsek I fixed. That was a keyboard typo. Commented Oct 9, 2021 at 13:27

$$3(x+y)=x^{2}+y^{2}+xy+2$$ must be a conic section because it can be written in the form $$Ax^2+Bxy+Cy^2+Dx+Ey+F = 0$$. It also is symmetric across the line $$y=x$$ as it is invariant after swapping $$x$$ and $$y$$.

Now if the maximum value is $$P$$, then $$3x+2y+1 = P(x+y+6)$$, equation $$1$$. This can be seen below:

If we can rotate this ellipse by $$45º$$, we can write it in parametric form in terms of an angle $$\theta$$. Using the rotation matrix and a scaling factor, we need the transformation $$x \to x - y, y \to x + y$$ as $$\cos \pi/4 = \sin \pi/4$$:

$$3(x-y + x+y) = (x-y)^2 + (x+y)^2 + (x-y)(x+y) + 2$$ $$6x = 2(x^2 + y^2) + (x^2-y^2) + 2$$ $$6x = 3x^2 + y^2 + 2 \tag{2}$$

where from $$(1)$$, we now have:

$$3(x-y) + 2(x+y) + 1 = P \left( (x-y) + (x+y) + 6 \right)$$ $$5x-y+1 = P(2x+6)$$ $$y = (5-2P)x-6P+1 \tag{3}$$

Just to check, the lines are still tangent to the ellipse after transformation:

and now we can substitute $$(3)$$ into $$(2)$$:

$$6x = 3x^2 + ((5-2P)x-6P+1)^2 + 2$$ $$6x = 3x^2 + (25-20P+4P^2)x^2 + 2(5-2P)(-6P+1)x + 36P^2-12P+1+2$$ $$(28-20P+4P^2)x^2 + (24P^2-64P+4)x + 36P^2-12P+3 = 0$$ $$\Delta = 0: (24P^2-64P+4)^2 - 4(28-20P+4P^2)(36P^2-12P+3) = 0$$ $$4(6P^2-16P+1)^2 - 48(7-5P+P^2)(P^2-4P+1) = 0$$

and miraculously, this is a quadratic $$-752P^2 + 1072P - 320 = 0 \implies (47-20P)(P-1) = 0$$, so the maximum value is $$P = 1$$.