This is the dream cheating software every student should know about.
It also has serious applications obviously. https://www.sympy.org/scipy-2017-codegen-tutorial/ mentions code generation capabilities, which sounds super cool!
The code in this section was tested on
sympy==1.8and Python 3.9.5.
We can also do everything with symbols:outputs: We can now evaluate that expression object at any time: outputs:
How about a square root?outputs: so we understand that the value was kept without simplification. And of course: outputs
2. Also: outputs:
Iis the imaginary unit. We can use that symbol directly as well, e.g.: gives:
Let's do some trigonometry:gives: and: gives: The exponential also works: gives;
Let's try some polynomial equations: which outputs: which is a not amazingly nice version of the quadratic formula. Let's evaluate with some specific constants after the fact: which outputs Let's see if it handles the quartic equation: Something comes out. It takes up the entire terimnal. Naughty. And now let's try to mess with it: and this time it spits out something more magic: Oh well.
Let's try some linear algebra. Let's invert it: outputs:
- Sylvester's law of inertia | 527, 626, 5