## Examples from Sym

Sym comes with several example documents. All of the equations on this page were created by exporting content from the MathExamples example document that is included with Sym. To do this export you first choose the HTML exported and then either export an entire document from Sym or copy and paste a single expression.
After you install Sym, you can open the MathExamples.equ document an see this same content in Sym
Derive the solution to the general quadratic equation
$$a\,{x^{2}}+b\,{x}+c=0$$
##### Solution:
It's conventional to assume that "a" is greater than zero, so we begin with a declaration:
$$Define:{a>0}$$
Starting with the quadratic equation, highlight the "c" term and use the move command (m)
$$a\,{x^{2}}+b\,{x}=-c$$
Highlight the left hand side and use the factor command (f)
$$a\,{\left({x+\frac{b}{2\,{a}}}\right)^{2}}-\frac{b^{2}}{4\,{a}}=-c$$
Highlight the right term on the left hand side and move it (m) to the right, then use the division command (d) on the whole right side to put both terms over a common denominator.
$$a\,{\left({x+\frac{b}{2\,{a}}}\right)^{2}}=\frac{b^{2}-4\,{a\,{c}}}{4\,{a}}$$
Move (m) the "a" to the right hand side
$$\left({x+\frac{b}{2\,{a}}}\right)^{2}=\frac{b^{2}-4\,{a\,{c}}}{4\,{a^{2}}}$$
Use the equivalence command (q) on the whole expression to take the square root
$$x+\frac{b}{2\,{a}}=\pm\sqrt{\frac{b^{2}-4\,{a\,{c}}}{4\,{a^{2}}}}$$
Highlight the square root term and expand (e) it, then simplify (s) the denominator
$$x+\frac{b}{2\,{a}}=\pm\frac{\sqrt{b^{2}-4\,{a\,{c}}}}{2\,{a}}$$
The "a" coefficient is defined to be positive, so the absolute value of "a" simplifies to "a".
Now move (m) the second term on the left hand side to the right
$$x=\pm\frac{\sqrt{b^{2}-4\,{a\,{c}}}}{2\,{a}}-\frac{b}{2\,{a}}$$
Use the division command (d) on the whole right side and then highlight the "b" term and use the left command (l) to put the expression in its final form.
$$x=\frac{-b\pm{\sqrt{b^{2}-4\,{a\,{c}}}}}{2\,{a}}$$