# Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
WOLFRAM LANGUAGE TUTORIAL

# Equations in One Variable

The main equations that Solve and related Wolfram Language functions deal with are polynomial equations.

It is easy to solve a linear equation in .
 In[1]:=
 Out[1]=
One can also solve quadratic equations just by applying a simple formula.
 In[2]:=
 Out[2]=
The Wolfram Language can also find exact solutions to cubic equations. Here is the first solution to a comparatively simple cubic equation.
 In[3]:=
 Out[3]=

For cubic and quartic equations the results are often complicated, but for all equations with degrees up to four the Wolfram Language is always able to give explicit formulas for the solutions.

An important feature of these formulas is that they involve only radicals: arithmetic combinations of square roots, cube roots and higher roots.

It is a fundamental mathematical fact, however, that for equations of degree five or higher, it is no longer possible in general to give explicit formulas for solutions in terms of radicals.

There are some specific equations for which this is still possible, but in the vast majority of cases it is not.

This constructs a degree six polynomial.
 In[4]:=
 Out[4]=
For a polynomial that factors in the way this one does, it is straightforward for Solve to find the roots.
 In[5]:=
 Out[5]=
This constructs a polynomial of degree eight.
 In[6]:=
 Out[6]=
The polynomial does not factor, but it can be decomposed into nested polynomials, so Solve can again find explicit formulas for the roots.
 In[7]:=
 Out[7]=
 Root[f,k] the k root of the equation

Implicit representation for roots.

No explicit formulas for the solution to this equation can be given in terms of radicals, so the Wolfram Language uses an implicit symbolic representation.
 In[8]:=
 Out[8]=
This finds a numerical approximation to each root.
 In[9]:=
 Out[9]=
If what you want in the end is a numerical solution, it is usually much faster to use NSolve from the outset.
 In[10]:=
 Out[10]=

Root objects provide an exact, though implicit, representation for the roots of a polynomial. You can work with them much as you would work with Sqrt[2] or any other expression that represents an exact numerical quantity.

Here is the Root object representing the first root of the polynomial discussed above.
 In[11]:=
 Out[11]=
This is a numerical approximation to its value.
 In[12]:=
 Out[12]=
Round does an exact computation to find the closest integer to the root.
 In[13]:=
 Out[13]=
If you substitute the root into the original polynomial, and then simplify the result, you get zero.
 In[14]:=
 Out[14]=
This finds the product of all the roots of the original polynomial.
 In[15]:=
 Out[15]=
The complex conjugate of the third root is the second root.
 In[16]:=
 Out[16]=

If the only symbolic parameter that exists in an equation is the variable that you are solving for, then all the solutions to the equation will just be numbers. But if there are other symbolic parameters in the equation, then the solutions will typically be functions of these parameters.

The solution to this equation can again be represented by Root objects, but now each Root object involves the parameter .
 In[17]:=
 Out[17]=
When is replaced with , the Root objects can be simplified, and some are given as explicit radicals.
 In[18]:=
 Out[18]=
This shows the behavior of the first root as a function of .
 In[19]:=
 Out[19]=
This finds the derivative of the first root with respect to .
 In[20]:=
 Out[20]=

If you give Solve any degree polynomial equation, then it will always return exactly solutions, although some of these may be represented by Root objects. If there are degenerate solutions, then the number of times that each particular solution appears will be equal to its multiplicity.

Solve gives two identical solutions to this equation.
 In[21]:=
 Out[21]=
Here are the first four solutions to a tenth degree equation. The solutions come in pairs.
 In[22]:=
 Out[22]=

The Wolfram Language also knows how to solve equations which are not explicitly in the form of polynomials.

Here is an equation involving square roots.
 In[23]:=
 Out[23]=
And here is one involving logarithms.
 In[24]:=
 Out[24]=

So long as it can reduce an equation to some kind of polynomial form, the Wolfram Language will always be able to represent its solution in terms of Root objects. However, with more general equations, involving, say, transcendental functions, there is no systematic way to use Root objects, or even necessarily to find numerical approximations.

Here is a simple transcendental equation for .
 In[25]:=
 Out[25]=
There is no solution to this equation in terms of standard functions.
 In[26]:=
 Out[26]=
The Wolfram Language can nevertheless find a numerical solution even in this case.
 In[27]:=
 Out[27]=

Polynomial equations in one variable only ever have a finite number of solutions. But transcendental equations often have an infinite number. Typically the reason for this is that functions like Sin in effect have infinitely many possible inverses. With the default option setting , Solve will nevertheless assume that there is a definite inverse for any such function. Solve may then be able to return particular solutions in terms of this inverse function.

The Wolfram Language returns a particular solution in terms of ArcSin, but prints a warning indicating that other solutions are lost.
 In[28]:=
 Out[28]=
Here the answer comes out in terms of ProductLog.
 In[29]:=
 Out[29]=

If you ask Solve to solve an equation involving an arbitrary function like , it will by default try to construct a formal solution in terms of inverse functions.

Solve by default uses a formal inverse for the function .
 In[30]:=
 Out[30]=
This is the structure of the inverse function.
 In[31]:=
 InverseFunction[f] the inverse function of f InverseFunction[f,k,n] the inverse function of the n‐argument function f with respect to its k argument

Inverse functions.

This returns an explicit inverse function.
 In[32]:=
 Out[32]=
The Wolfram Language can do formal operations on inverse functions.
 In[33]:=
 Out[33]=

While Solve can only give specific solutions to an equation, Reduce can give a representation of a whole solution set. For transcendental equations, it often ends up introducing new parameters, say with values ranging over all possible integers.

This is a complete representation of the solution set.
 In[34]:=
 Out[34]=
Here again is a representation of the general solution.
 In[35]:=
 Out[35]=

As discussed at more length in "Equations and Inequalities over Domains", Reduce allows you to restrict the domains of variables. Sometimes this will let you generate definite solutions to transcendental equationsor show that they do not exist.

With the domain of restricted, this yields definite solutions.
 In[36]:=
 Out[36]=
With constrained to be real, only one solution is possible.
 In[37]:=
 Out[37]=
Reduce knows there can be no solution here.
 In[38]:=
 Out[38]=