    Next: Systems of Nonlinear Equations Up: Equations Previous: Systems of Linear Equations

### Nonlinear Equations

Equation'' in the following means the equation expression = 0. Equations are solved for a symbolic variable x by the function solve(expression, x). If expression is a quotient, then nominator = 0 is solved. Jasymca uses the following strategy to solve equations:
1. First, all occurances of the variable x in expression are counted, both as free variable and embedded inside functions. Example: In x occurs three times: as free variable, in and in .
2. If this count is one, then we are dealing with a polynomic equation, which is solved for the polynomial's main variable, e.g. z. This works always, if the polynomial's degree is 2 or of it is biquadratic, otherwise only, if the coefficients are constant. In the next step the solution is solved for the desired variable x. As an example: Jasymca has to solve for . It first solves for and then for . Examples with free variables:
>> syms x,b
>> solve(x^2-1,x)
ans = [ 1  -1 ]
>> solve(x^2-2*x*b+b^2,x)
ans = b

An example with functionvariable ( ):
>> syms x
>> float( solve(sin(x)^2+2*cos(x)-0.5,x) )
ans = [ 1.438i  -1.438i  -1.7975  1.7975 ]

3. If count is 2, only one case is further considered: The variable occurs free and inside squareroot. This squareroot is then isolated, the equation squared and solved. This case leads to additional false solutions, which have to be sorted out manually.
>> syms x
>> y=x^2+3*x-17*sqrt(3*x^2+12);
>> solve(y,x)
ans = [ -32.501  26.528
-1.3931E-2-2.0055i  -1.3931E-2+2.0055i ]

4. In all other cases Jasymca gives up.    Next: Systems of Nonlinear Equations Up: Equations Previous: Systems of Linear Equations
Helmut Dersch
2009-03-15