Calculus is the mathematical engine behind how machine learning models learn. If you're looking for comprehensive PDF guides to master the "how" and "why" of optimization, here are the most authoritative free resources. Mathematics for Machine Learning (Full Textbook)

Download: https://ml-cheatsheet.readthedocs.io/en/latest/calculus_for_machine_learning.pdf

print(numerical_derivative(lambda x: x**2, 3)) # Output: ~6.0