Work with mathematical functions symbolically and numerically — derivatives, limits, and function visualization in a few lines.
Functions
FindDerivative
Calculate the symbolic derivative of any mathematical function. Returns the derivative expression and optionally plots the function with its tangent line.
from analysistoolbox.calculus import FindDerivative
FindDerivative(
function_expression="x**3 - 2*x + 1",
point_of_interest=2
)
FindLimitOfFunction
Compute the limit of a function as the input approaches a value. Handles one-sided limits and visualizes the approach.
from analysistoolbox.calculus import FindLimitOfFunction
FindLimitOfFunction(
function_expression="sin(x)/x",
limit_point=0
)
FindMinimumSquareLoss
Calculate the minimum square loss for a given set of predictions — useful for understanding optimization problems and teaching gradient descent.
PlotFunction
Visualize any mathematical function over a specified domain with customizable styling.
from analysistoolbox.calculus import PlotFunction
PlotFunction(
function_expression="x**2 - 4*x + 3",
x_min=-1,
x_max=5
)
Use cases
- Teaching calculus concepts with real code
- Symbolic differentiation for analytical problems
- Visualizing optimization landscapes
- Verifying derivative calculations