1
2d graph. Powers of a variable.

Why do these two programs give me different outputs even though they are the same? The second one gives me a wrong graph.

x=[-5:0.01:5]
a=4
y1=sqrt(a^(2/3)-(x^2)^(1/3))^3
y2=-sqrt(a^(2/3)-(x^2)^(1/3))^3
plot2d(x,y1)
plot2d(x,y2)
x=[-5:0.01:5]
a=4
y1=sqrt(a^(2/3)-(x^(2/3)))^3
y2=-sqrt(a^(2/3)-(x^(2/3)))^3
plot2d(x,y1)
plot2d(x,y2)


Scilab 16-12-17, 12:37 a.m. Abbas
0
Hi Abbas, following code will clear your doubt
(-8)^(2/3)
(-8^2)^(1/3)
(-8^1/3)^2
18-12-17, 8:45 p.m. ashutumho
Oh I get it. I don't even need to run those inputs to understand my mistake, how can I be so foolhardy. Thank you :)

18-12-17, 8:50 p.m. Abbas
Your welcome :-)

18-12-17, 9 p.m. ashutumho

Login to add comment


Log-in to answer to this question.