<s>[INST] Let $x,y,z$ are the lengths of sides of a triangle such that $x+y+z=2$. Find the range of $xy+yz+xz-xyz$ . 
Let $x,y,z$ are the lengths of sides of a triangle such that $x+y+z=2$. Find the range of $xy+yz+xz-xyz$ .

What I Tried: I have tried by doing $(x+y+z)(x+y+z)=2*2 = 4.$ 
Also I got $2(xy+yz+xz)+(x^2+y^2+z^2)=4$.
But I think it is a wrong method to proceed...
 [/INST] Let $F$ denote the function $xy + yz + xz - xyz$. Since $x + y + z = 2$, the area of the triangle by Heron's formula is
$$A = \sqrt{(1-x)(1-y)(1-z)} = \sqrt{F - 1}.$$
Hence the minimum value of $F$ is $1$, which is attained iff we allow triangles of zero area.
The maximum $F$ occurs for maximum $A$. If we're allowed to assume that the triangle with maximum area for a given perimeter is equilateral, the maximum $F$ occurs when $x = y= z= 2/3$, which gives $F = 28/27$ as others have found. If not, we can prove it as follows. Fix $x$ and write
$$F = yz(1 - x) + x(2 - x).$$
By the triangle inequality $x \le 1$, so $F$ is a maximum when $yz$ is a maximum. Since $y + z$ is fixed, the maximum $F$ for this $x$ occurs when $y = z$. Similarly for a fixed $y$ and a fixed $z$. Hence the maximum $F$ occurs for an equilateral triangle.
</s>