QUAD

Member Of Menu: 
Solv
Algebra
Argument Types: 
Symbol
Expression
Result Type(s): 
Expression
Invertible: 
No
Valid In Expression: 
No
Stack Diagram: 
Expression1 Symbol2 Expression3

This operation takes an expression and a symbol and finds the root of the expression using the quadratic equation. The expression must be a polynomial of the symbol to solve for. The degree of the polynomial can be greater than two but those higher order terms are discarded. So, the result for a polynomial greater than two is not actually a good solution for the roots of the polynomial. But for actual quadratic equations, the result can be used to find the exact roots of the expression.

The result will also have a "s1", "s2", etc variable in the expression. The actual name of the variable is unique so the number is chosen to make it unique. This represents the positive and negative roots in the quadratic equation. Set the sign variable to one to evaluate the positive root and minus one to evaluate the negative root.

If the expression 'A*SQ(X)+B*X+C' is solved for the symbol X using this operation, the result will be '(-B+s1*√(SQ(B)-4*A*C))/(2*A)'. This is the standard definition of the quadratic equation.

Before the expression is pushed onto the stack, it is evaluated recursively which means any symbols in the expression which have values associated with them will be replaced with their values. If the value is itself an expression of other symbols, they also will be replaced with their values.

The result can then be used with STEQ and the SOLVR to quickly evaluate the two roots or evaluate for other unknowns remaining in the equation.