1
votes

I want to plot a function (f(x,y)=x^2+3y^2 under the restriction 4x+3y<=12; Wolfram Alpha suggests a function on the help pages - https://reference.wolfram.com/language/ref/RegionFunction.html

However, copying their example

Plot3D[x^2 - y^2, {x, -3, 3}, {y, -3, 3}, RegionFunction -> Function[{x, y, z}, 2 < x^2 + y^2 < 9]]

into my WA input line leads to nothing - (Try the following: Use different phrasing or notations Enter whole words instead of abbreviations etc)

so I´m pretty lost ... Thanks in advance for any help!

1
perhaps you are confused thinking wolfram alpha accepts wolfram language input. They are quite different. - agentp

1 Answers

0
votes

Try this method

which is

ParametricPlot3D[{r*Cos[theta], r*Sin[theta], (r*Cos[theta])^2-(r* Sin[theta])^2},
  {r, Sqrt[2], 3}, {theta, 0, 2 Pi}
]

which tries to get around WolframAlpha not implementing RegionFunction by translating the problem into a parametric plot and doing a polar plot. That at least accomplishes your restriction to 2 < x^2+y^2 < 9 and perhaps you can use this idea to implement your 4x+3y <= 12 restriction.