# Solving Equations Symbolically MathCad Help

This section discusses how to use either keywords or menu commands from the Symbolics menu to symbolically solve an equation for a variable, find the symbolic roots of an expression, and solve a system of equations symbolically. Most of the examples in this section demonstrate “live” solving using symbolic keywords, but you may apply commands from the Symbolics menu to expressions on a case by case basis if you prefer. Keep in mind that, unlike the keyword-modified expressions, expressions modified by commands from the Symbolics menu do not update automatically, as described in the section “Using the Symbolics menu” on page 360.

Solving equations symbolically is far more difficult than solving them numerically. You may find that the symbolic solver does not give a solution. This may happen for a variety of reasons discussed in “Limits to symbolic processing” .

Solving an equation for a variable

To solve an equation symbolically for a variable, use the keyword solve:

• Type the equation. Make sure you use [Ctrl]= to create the equal sign.
• Press [Ctrl] [Shift 1 • (hold down the control and shift keys and type a period). Mathcad displays a placeholder to the left of the arrow, “→”
• In the placeholder, type solve followed by a comma and the variable for which to solve.
• Press [Enter] to see the result.

Mathcad will solve for the variable and insert the result to the right of the “→”. Note that if the variable was squared in the original equation, you may get two answers back when you solve. Mathcad displays these in a vector. Figure 17-17 shows an example.

Another way to solve for a variable is to enter the equation, click on the variable you want to solve for in an equation, and choose Variable⇒Solve from the Symbolics menu.

Examples of solving equations, solving inequalities, and finding roots

You can also solve an inequality entered using the symbols <, >,≤, and ≥. Solutions to inequalities will be displayed in terms of Mathcad boolean expressions. If there is more than one solution, Mathcad places them in a vector. A Mathcad boolean expression such as x < 2 has the value 1 if it is true and 0 if it is false. Thus the solution “x is less than 2 and greater than -2” would be represented by the expression (x < 2) . (-2 < x).

Finding the roots of an expression

You can use the solve keyword to find the roots of an expression in a manner similar to that of solving an equation in a variable:

• Type the expression.
• Press [Ctrl] [Shift 1 • (hold down the control and shift keys and type a period). Mathcad displays a placeholder to the left of the arrow, “→”.
• In the placeholder, type solve followed by a comma and the variable for which to solve.
• Press [Enter] to see the result.

Note that there is no need to set the expression equal to zero. When Mathcad doesn’t find an equals sign, it assumes you mean to set the expression equal to zero.

Solving a system of equations symbolically: The “solve” keyword

One way to symbolically solve a system of equations is to use the same solve keyword used to solve one equation in one unknown. To solve a system of n equations for n unknowns:

• Press [Ctrl] M to create a vector having n rows and 1 column.
• Fill in each placeholder of the vector with one of the n equations making up the system. Make sure you use [Ctrl]= to create the equals sign.
• Press [Ctrl] [Shi ft 1 • (hold down the control and shift keys and type a period). Mathcad displays a placeholder to the left of the arrow, “→”.
• In the placeholder, type solve followed by a comma.
• Press [Ctrl] Mto create a vector having n rows and 1column.
• Press [Enter] to see the result.

Mathcad displays the n solutions to the system of equations to the right of the arrow.

Solving a system of equations symbolically: Solve block

Another way to solve a system of equations symbolically is to use a solve block, similar to the numerical solve blocks described , “Solving Equations.”

• Type the word Given. This tells Mathcad that what follows is a system of equations. You can type Given in any combination of upper and lower case letters, and in any font. Just be sure you don’t type it while in a text region or paragraph.
• Now type the equations in any order below the word Given. Make sure you press [Ctrl]= to type “=.”
• Type the Find function as appropriate for your system of equations. This function is described “Systems of equations” . The arguments of the function are the variables for which you are solving.
• Press [Ctrl]. (the control key followed by a period). Mathcad displays the symbolic equal sign.
• Click outside the Find function

Mathcad displays the solutions to the system of equations to the right of the arrow. If the Find function has one argument, Mathcad returns one result. If the Find has more than one argument, Mathcad returns a vector of results. For example, Find(x, y) returns
a vector containing the expressions for x and y that solve the system of equations. Note that if your system is an over determined linear system, the Find function will not return a solution. Use the Minerr function instead of Find. Minerr will return an answer that minimizes the errors in the constraints.

Most of the guidelines for solve blocks described, “Solving Equations,” apply to the symbolic solution of systems of equations. The main difference is that when you solve equations symbolically, you should not enter guess values for the solutions.

Figure 17-18 shows an example of a solve block used to solve a system of equations symbolically. For more information on solve blocks , “Solving Equations.”

Solving a system of equations symbolically.

Posted on November 23, 2015 in Symbolic Calculation