# Performing operations involving absolute values

How do you perform operations involving absolute values? I want to avoid squaring them, is there any way to work around that?

Suppose I want to solve $\frac{|x-120|\cdot|y-39|}{2}$, what should be the expressions equivalent?

EDIT: apologies, suppose I want to simplify the expression above?

Additionally, suppose $z(x,y)=\frac{|x-120|\cdot|y-39|}{2} +\frac{|x-23|\cdot|y-11|}{2}$ and I want to find the optimal values for $(x,y)$. How do I go about it?

• $|a| \cdot |b|=|a \cdot b|$. I don't know what you are solving though. – randomgirl Mar 8 '18 at 1:50
• What do you mean, you want to "solve" this? Is there an equation somewhere? Also, why do you want to avoid squaring absolute values? – saulspatz Mar 8 '18 at 1:51
• @randomgirl edited the question – John Glenn Mar 8 '18 at 1:55
• @saulspatz to avoid the problem from being too computationally intensive – John Glenn Mar 8 '18 at 1:57
• you can always get rid of the absolute value bars by specifying constraints on $x$ and $y$. For example, $|x-120|=x-120$ if $x\ge 120$ – Vasya Mar 8 '18 at 2:05

$z(120,11) = 0+0 = 0,$ which is clearly a minimum.