Message Boards Message Boards

How to Solve general equation using Mathematica?

Posted 1 year ago

I am able to solve equation x^3 + 3x^2 + 3x + 1 = 0 using Mathematica by using the command

Solve[x^3 + 3x^2 + 3x + 1 == 0, x]

But not able to solve ax^3 + bx^2 + cx + d = 0 for general variables a,b,c,d using Mathematica. Can anyone suggest me how this or any general polynomial equation of any degree could be solved using Mathematica.

POSTED BY: Manish Jain

Note that ax is not the same thing as a x or a*x.

In[7]:= Solve[a*x^3 + b*x^2 + c*x + d == 0, x]

Out[7]= {{x -> -(b/(
     3 a)) - (2^(
       1/3) (-b^2 + 3 a c))/(3 a (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
         4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(
       1/3)) + (1/(
    3 2^(1/3)
      a))((-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
      4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(
    1/3))}, {x -> -(b/(
     3 a)) + ((1 + I Sqrt[3]) (-b^2 + 3 a c))/(3 2^(2/3)
        a (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
         4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(
       1/3)) - (1/(
    6 2^(1/3)
      a))(1 - I Sqrt[3]) (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
       4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(
     1/3)}, {x -> -(b/(
     3 a)) + ((1 - I Sqrt[3]) (-b^2 + 3 a c))/(3 2^(2/3)
        a (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
         4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(
       1/3)) - (1/(
    6 2^(1/3)
      a))(1 + I Sqrt[3]) (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
       4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(1/3)}}
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract