This project is an advanced math solver that can handle a variety of mathematical problems, it includes Equation solving, Differentiation, Integration, the solver is built using Python and leverages libraries such as Sympy and other mathematical libraries to provide accurate and efficient solutions, and visualization capabilities.
- SymPy: is a Python library handles the "Thinking" and exact calculas/algebra manipulations.
- Numpy: is a Pytohn library that handles the "Number Crunching" and numerical calculations.
- Matplotlib: is a Python library that handles the "Visualization" and plotting of mathmetical functions and results.
- Streamlit: is a Python library that handles the "User Interface" and provides an inteactive web application for users to input their mathematical problems and view the results.
To understand why the app behaves the way it does, it helps to undestand one core function used throught the codebase: 'sp.lambdify'
The problem: Sympy is designed for abstract math (like looking at
- Exponents: use '' instead if '^'. (e.g., 'x2' for '$x^2$', not 'x^2').
- Multiplcation: Always use ' * ' sign. (e.g., type '2*x', 'x*sp.sin(x)', not '2x' or 'xsin(x)')
- The graphing canvas is a standard 2D Cartesian plane (
$X$ and$Y$ ). It can only display real numbers. -
Equations: If you solve an equation like
$x^2 + 4 = 0$ , the algebraic output will correctly show complex roots ($[-2i, 2i]$ ). However, because these roots contain imaginary components, they will not drop a visible marker on the graph's horizontal axis, because the curve never physically crosses$y = 0$ . - Calculus: Functions that result in complex outputs over the plotted range cannot be drawn and will display a safe warning box rather than crashing the application.
Each math module translates calculus concepts into visual geometry:
- Derivatives: The app plots the original function as a solid line and the derivative as a dashed line. This allows you to visually verify that wherever the original curve peaks or bottoms out, the derivative line crosses exactly through zero (signifying a slope of zero).
- Definite Integration: The app dynamically highlights the boundaries you input and fills the trapped space with a transparent color.