- Clone this repository:
git clone https://github.com/yourusername/PyCalcEngine.git- Install required packages:
pip install numpy matplotlib- Open
PyCalcEngine.ipynbin Jupyter Notebook
- Import the functions in a notebook:
from PyCalcEngine import derivative, integral, plot_function- Define a function and use the engine:
# Plot function, derivative, and integral
plot_function(np.sin, 0, 2*np.pi)
# Compute integral
result = integral(lambda x: x**2, 0, 1)
print(result)- Experiment with different families of functions:
f_poly = lambda x: x**3 + 2*x**2 - x # polynomial
print("Integral of f_poly from 0 to 2:", integral(f_poly, 0, 2))
plot_function(f_poly, -5, 5)
f_sin = np.sin # trigonometric
print("Integral of sin(x) from 0 to pi:", integral(f_sin, 0, np.pi))
plot_function(f_sin, 0, 2*np.pi)
f_exp = np.exp # exponential
print("Integral of exp(x) from 0 to 1:", integral(f_exp, 0, 1))
plot_function(f_exp, 0, 3)This project is open-source and free to use. Feel free to fork, experiment, and improve!