# Finding the minimum value of a given expression

As the title pretty much sums it up, I'm wondering what is the best way of finding the minimum value of an expression.

For instance, we have the expression $E$ defined as:$$E=x^2+4x+y^2-10y+1$$ I currently have solved it using two different methods:

1. Forming squares of binomials
2. Breaking it into two different expressions and finding the minimum value depending on their context - clarifications below

### Solution 1:

$$E=x^2+4x+y^2-10y+1$$ $$E=(x^2+4x+4)+(y^2-10y+25) - 4 - 25 + 1$$ $$E=(x+2)^2+(y-5)^2 - 28$$

We know that $(x+2)^2 \geq 0$ and than $(y-5)^2\geq0$, and thus $E_{min} = -28$, for $x=-2$ and $y=5$.

### Solution 2:

Let $E_{x} = x^2+4x$ and $E_{y}=y^2-10y$. Therefore, $E_{min}=E_{xmin}+E_{ymin}+1\tag1$

Now, for $E_{x}$ to be as small as possible, $x\leq0$, and if so: $$E_{x} = x^2-abs(4x)\implies abs(4x)>x\cdot x\tag2$$ $$(2)\implies 0\geq x\geq -4$$

Checking all four values, $E_{xmin} = -4$, for $x=-2$. The same goes for $E_{ymin}$, which results in $0\geq y\geq -10$. Checking all the values, $E_{ymin} = -25$, for $y=5$. $$(1)\implies E_{min}=-25-4+1\implies E_{min}=-28$$

(Of course for the values of x,y mentioned above)

I personally think that Solution 1 is the best, and I wonder if there is another possible solution and also which of these is recommended in this case.

• Are you able to include the notion of gradient in your arguments? – caverac May 9 '17 at 15:21
• Sorry for my lack of knowledge, what is a gradient @caverac ? – Mr. Xcoder May 9 '17 at 15:23
• Well, it involves the use of partial derivatives that @Archis gave below, if you're confortable with that, then I guess you did know about gradients all along :) – caverac May 9 '17 at 15:36
• @caverac oh, yes, I didn't realise that it was called gradient, it is different in my language, and that was the cause of my confusion – Mr. Xcoder May 9 '17 at 15:58

Hint take $E$ as $F(x,y)$ . Now take partial derivatives wrt $x$ and $y$ and set them equal to $0$ which yields two equations ie $2x+4=0,2y-10=0$ thus $x=-2,y=5$ thus minimum value of $E=-28$
• It would be quicker to solve by this method when you have one more condition imposed on $x,y$ like $ax+by+c=0$ – Archis Welankar May 9 '17 at 15:26