A Python project that generates random polynomial curves and calculates the instantaneous rate of change at any point using derivatives and tangent lines.
This program:
- Generates a random polynomial equation
- Finds the tangent line at a specific point
- Calculates the instantaneous rate of change (derivative) at that point
- Displays polynomial graph, tangent line graph, then both graphs together
Start an virtual environment:
https://docs.python.org/3/library/venv.html
pip install sympy matplotlib
Run the main program:
python main.py
[-3.7482081877974673, -4.5016147894208345, 4.166184518768379] # Random coefficients
-3.75*x**2 - 4.50*x + 4.17 # Polynomial equation
379.17 - 79.5*x # Tangent line at x=10
-415.83 # Value at x=10
- polynomial graph
- tangent line graph
- both graphs combined
The program uses calculus concepts:
- Derivative: The rate of change of the polynomial
- Tangent Line: A line that touches the curve at exactly one point
- Instantaneous Rate: The slope of the tangent line (derivative value)