A worse version of sympy
Current version can do algebraic & trigonometric simplifications, perform any differentiation, and integrate most of AP calc functions including polynomials, rational functions, trig functions, logs, and exponentials.
Real installation instructions are coming soon! For now, just clone the repo and pip install requirements.txt
. You can run pytest .
in the root directory to run my tests. Look at test_integrals.py
and test_khan_academy_integrals.py
to see some sample integrals we can do :)
For example, these polynomial integrals Laura had to do for homework:
Can be done like so:
from src import simpy as sp
from fractions import Fraction as F
x = sp.symbols("x")
I1 = sp.integrate((x/90 * (x-5)**2 / 350), (x, 5, 6))
I2 = sp.integrate((F(1, 15) - F(1, 360) * (x-6))*(x-5)**2 / 350, (x, 6, 15))
I3 = sp.integrate((F(1, 15) - F(1, 360) * (x-6))*(1 - (40-x)**2/875), (x, 15, 30))
print(I1, I2, I3)
Note: we don't support floats right now so please use fractions!
This project is actively undergoing development; please let me know about any bugs you encounter by making a github issue! If there's an integral that we currently can't solve, create an issue and tag "new integral."
This project uses black and isort with line width of 120.
Run make style
to format accordingly. And make check-style
to check your edits meet the formatting guidelines.
If you use vscode, you can add this to settings.json
to automatically format when you save.
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always",
"source.fixAll": "always"
},
"editor.rulers": [120],
},
"black-formatter.args": ["--line-length", "120"],
"isort.args": ["--profile", "black", "--line-length", "120"],