0

Given is the equation: Y^2 = X^3 + 2*X - 3*X*Y
Assuming the plotted sketch is correct. enter image description here

Y^2 = X^3 + 2*X - 3*X*Y

Hint:

Y^2 + X^2 =1  ==>  Y= sqrt( 1 - X^2 )

The X values are known.
How can I find the corresponding Y values for X values? E.g. for known X-Values, I expect something like below listed Y-Values (see the plotted sketch):

X= 1 ; Y=0.79
X=2 ; Y=1.58
X=3 ; Y=2.79
X=4 ; Y=4.39
X=5 ; Y=6.33
X=6 ; Y=8.57 
X=7 ; Y=11.12 
X=8 ; Y=13.92
X=9 ; Y=16.98
X=10 ; Y= 20.29

E.g. I will try to find Y for X=6; then Y will be calculated as follws:

Y^2+X^2=1  ==>  Y=sqrt(1 - X^2) = sqrt(1-36) = sqrt(-35) = (0, 5.92i );

Thus:

Y^2 = X^3 + 2*X - 3*X*Y = (228 , -106,49i)

Y = sqrt( 228 , -106,49i) = (15.49 , -3.44i)

Sadly, the calculated Y is wrong! I expect something like (6, 8.57i). But how can I find Y?

Thanks in advance.

user3815508
  • 369
  • 4
  • 20
  • 1
    What does this have to do with JavaScript? [Math SE](http://math.stackexchange.com/) might be a better fit for this question. – Joe Clay Mar 28 '17 at 14:23
  • I assume he tries to implement the calculation in javascript. – lbndev Mar 28 '17 at 14:29
  • They really should clarify that then, as there's literally nothing related to programming in their question as it stands right now. – Joe Clay Mar 28 '17 at 14:30
  • I don't know why is this question got -2 points? Would you make it backward please? "JavaScript" because I mean, I don't want to use a library (see below, for example the anwser of lbndev). – user3815508 Mar 28 '17 at 14:46

2 Answers2

2

just solve it by 'y'. It's not that difficoult, when you treat x like constant value:

y^2 = x^3 + 2x - 3xy
0 = (-1)y^2 + (-3x)y + (x^3 + 2x)

it's Quadratic equation of:
a = -1
b = -3x
c = x^3 + 2x

y1 = (-(-3x) - sqr((-3x)^2 - 4(-1)(x^3+2x)))/2*(-1)
y2 = (-(-3x) + sqr((-3x)^2 - 4(-1)(x^3+2x)))/2*(-1)

finally:

d = x(9*x+4*x^2+8)
y1 = (3x+sqr(d))/(-2)
y2 = (3x-sqr(d))/(-2)

eg.

for x = 6
y1 = -26,5784
y2 = 8,578396

as you may see from the chart there are always two y matched to one x. I think that is clear enaugh :)

  • What is your final result, e.g. For X = 6? I expect e.g. For X = 6 something like 8.57 (see the above X-Y list or the sketch). X isn't constant, it is a variable! – user3815508 Mar 28 '17 at 15:04
  • I know it's not a constant, but it need to act like it to make this easy to solve. Now you can just past x into this and everything will work ok, as far as I remember quadric equations from primary school :) – Arkadiusz Raszeja Mar 28 '17 at 15:09
  • Thanks already ^ 3. It seems to work. But I have not understood it yet. I still need time to get it. Maybe would be possible to adapt the below equations? (X^2+y^2-1)^3-x^2y^3=0 ; X^3+y^3=3xy^2-x-1 ; X^3+y^2=6xy/sqrt(y/x) ; cos (PI* Y)=cos (PI.X) ; Because I need them to test and study, in order to understand the approach of solve such equations. I thank you for your efforts and appreciate it. – user3815508 Mar 28 '17 at 16:02
  • just translate "Quadratic equation" to your language and you'll get everything :) you can, almost always solve equasion with two variables. If not you need to know more about "entangled functions", but this is more complexed topic (I had it on university). However all your equasions are solvable. Just pretend x is an constant, solve and here you go! you have answer. – Arkadiusz Raszeja Mar 28 '17 at 16:29
  • Maybe you want see my new question for complex-equestion here:[Algorithm which adapt (solve) the complex equations ( implicit function f(x,y) )](http://stackoverflow.com/questions/43080688/algorithm-which-adapt-solve-the-complex-equations-implicit-function-fx-y) – user3815508 Mar 28 '17 at 22:02
  • I'm at work, if nobody's gonna answer it I'll solve your equasions with pleasure after 5 polish time. – Arkadiusz Raszeja Mar 29 '17 at 07:10
  • It would be great if you could do that. I have been programming a plotter since January. But the last part "complex / implicit" is missing. If it helps, here is a plotter where the equations can be plotted: https://www.desmos.com/calculator/pi5ofejgt0. Thank you in advance – user3815508 Mar 29 '17 at 07:51
0

Have you used a math library with support for complex numbers ? MathJs is one. See this SO answer.

Community
  • 1
  • 1
lbndev
  • 781
  • 6
  • 14