# How to plot a function using piecewise of two variables f[β_, α_] = Piecewise[
{{-2*α*β + (2*β^2 + 2* α^2)* ArcTan[α/β] - Pi, β >= 0 && α >= 0},
{(-1*5)*(α*β) + (β^2/2 + α^2)* ArcTan[(2* α)/β] - Pi, β <= 0 && α >= 0}}
]


Can someone help to get the plot for the following closed equation. I Have Tried to solve this using piecewise but not Able to figure right plot.I obtained plot in 3D,Contourplot and Manipulate

• Please provide a copyable code with your Piecewise implementation. – Kuba Aug 21 '18 at 11:32
• f[[Beta]_, [Alpha]_] = Piecewise[{{-2*[Alpha]*[Beta] + (2*[Beta]^2 + 2*[Alpha]^2)* ArcTan[[Alpha]/[Beta]] - Pi, [Beta] >= 0 && [Alpha] >= 0}, {(-1*5)*([Alpha]*[Beta]) + ([Beta]^2/2 + [Alpha]^2)* ArcTan[(2*[Alpha])/[Beta]] - Pi, [Beta] <= 0 && [Alpha] >= 0}}] – Sukka Aug 21 '18 at 11:48
• is there anything written wrong – Sukka Aug 21 '18 at 11:56
• ContourPlot[f[x, y], {x, -4, 4}, {y, -4, 4}, Contours -> {0}, ContourShading -> None]? – march Aug 21 '18 at 21:22

f[b_, a_] =
Piecewise[{{-2*a*b + (2*b^2 + 2*a^2)*ArcTan[a/b] - Pi,
b >= 0}, {-5*a*b + (b^2/2 + a^2)*ArcTan[2*a/b] - Pi, b < 0}}]

Plot3D[f[a, b], {a, 0, 10}, {b, -5, 5}, Mesh -> None,
ColorFunction -> Hue, PlotRange -> All,
AxesLabel -> {"\[Alpha]", "\[Beta]", ""}] • Thank you, but can you make it as a simple 2D plot – Sukka Aug 24 '18 at 5:38
• What do you mean by 2D - ContourPlot[]? – Alex Trounev Aug 24 '18 at 8:37