2
$\begingroup$

How do I illustrate the surface $f(x,y)=xy(x-y)$ over the area enclosed by the lines $y_1=2x$, $y_2=1-4x$, and $y_3=4+x/2$? TIA.

$\endgroup$
3
  • 1
    $\begingroup$ Plot3D with options RegionFunction? $\endgroup$ May 1 '18 at 21:16
  • 2
    $\begingroup$ reg = ImplicitRegion[2 x<=y && 1- 4 x<=y && 4 +x/2>=y, {x,y}]; Plot3D[x y (x-y), {x, y} \[Element] reg] ? $\endgroup$
    – kglr
    May 1 '18 at 21:24
  • $\begingroup$ I don't know if it is proper etiquette, but I use a comment anyway to send a Thanks! to all for the solutions. There are some interesting versions here that I've never seen and which inspires me to look more into the various suggested techniques. $\endgroup$
    – MF92
    May 3 '18 at 21:00
5
$\begingroup$
Plot3D[x y (x - y),
  {x, y} \[Element] ImplicitRegion[2 x < y && 1 - 4 x < y && 4 + x/2 >= y, {x, y}] ] 

enter image description here

Alternatively,

triangle = Polygon[Join @@ ({x, y} /. Solve[Thread[# == y], {x, y}] & /@ 
      Subsets[ {2 x, 1 - 4 x, 4 + x/2}, {2}] )];
Plot3D[x y (x - y), {x, y} \[Element] triangle ]

same picture

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.