2. Teams of solving equations

For an analytical solution of equations, a team is used

solve (equations, variables).

Variables are listed in curly brackets through a comma. If you do not specify a set of variables in the command parameters, the solution will be found for all the variables involved in the equations. If you need to solve a system of equations, then the equation of the system is indicated in the curly brackets through a comma. The result of using the solve command is a list of solutions of this equation, or, if the equation has no solutions or the command can not be resolved, they will not appear in the output line. With a list of solutions you can work the same way as with a regular list.

Example.

Eq: = (x-1) ^ 3 * (x-2) ^ 2;

S: = solve (eq);

Solve (x ^ 4-11 * x ^ 3 + 37 * x ^ 2-73 * x + 70);

AX: = {2 * x + 3 * y + 2 * z = 7, -2 * x + 2 * yz = 1};

E: = solve (AX);

Rhs (e [1]); subs (e, z);

The subs ( e , z ) command allocates part of the expression. To work with the solution, you could apply the assign ( e) command that executes the assignment of x, y, z of the corresponding values, but x, y, z lose the status of the uncertain variables.

Numerical solution of equations is performed by a team

fsolve (equations, variables, options).

In the options, you can specify the interval in which the search for the roots will be performed; you can also specify complex - to find all complex roots, or the option maxsols = n - to find n the smallest roots of the polynomial. If the equation is given by a polynomial, then the fsolve command will find all the real approximate roots; in the general case, the fsolve command will find only one numerical root of the equation; other roots can be searched by changing the search interval so that the root found in it is not included.

Example.

fsolve (x-cos (x));

fsolve (x ^ 3 + 3 * x-1, x, complex);

Using the solve command, you can also solve inequalities and systems of equations and inequalities.

Accessibility

Font Face Font Face

Font Size Font Size

1

Text Colour Text Colour

Background Colour Background Colour

Font Kerning Font Kerning

Image Visibility Image Visibility

Letter Spacing Letter Spacing

0

Line Height Line Height

1.2

Link Highlight Link Highlight