SHARE
TWEET

Untitled

a guest Oct 12th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a2 = 0;
  2. a1 = 1;
  3. a0 = 1;
  4.  
  5. NSolve[z^3 + a2 z^2 + a1 z + a0 == 0, z]
  6.  
  7. q = 1/3 a1 - 1/9 a2^2;
  8. r = 1/6 (a1 a2 - 3 a0) - 1/27 a2^3;
  9.  
  10. s1 = (r + (q^3 + r^2)^(1/2))^(1/3);
  11. s2 = (r - (q^3 + r^2)^(1/2))^(1/3);
  12.  
  13. z1 = (s1 + s2) - a2/3 // N
  14. z2 = -1/2 (s1 + s2) - a2/3 + I Sqrt[3]/2 (s1 - s2) // N
  15. z3 = -1/2 (s1 + s2) - a2/3 - I Sqrt[3]/2 (s1 - s2) // N
RAW Paste Data
Top