Day 3 – Diving into Calculus for Machine Learning

Dhairya PatelDhairya Patel
2 min read

Hey everyone, Dhairya here πŸ‘‹

After covering linear algebra (Day 1 & 2), today I took a step into calculus - because without calculus, machine learning optimization simply doesn’t work.


πŸ”’ What I Learned Today

  • Derivatives – I refreshed the concept of slope as "rate of change." Using SymPy, I could symbolically differentiate functions like x2x^2x2, sin(x2)sin(x^2)sin(x2), etc.

  • Rules of differentiation – power rule, product rule, quotient rule, and chain rule.

  • Visualization – plotted tangent lines to understand how the derivative gives slope at a point.

  • Partial derivatives – learned how to extend derivatives to multivariable functions like f(x,y)=x2+y2f(x,y) = x^2 + y^2f(x,y)=x2+y2.

  • Gradients – saw how the gradient is just a vector of partial derivatives, pointing in the steepest ascent direction.

  • Optimization link – implemented a simple gradient descent example where a point moved step by step toward the minimum.


🌱 Reflections

Today was a huge mindset shift β€” calculus felt less like abstract math and more like a map for optimization. Derivatives are the language ML models use to improve themselves during training.

Visualizing the gradient descent path was honestly super motivating. It’s cool to see math concepts turn into something so practical.


πŸ’» Notebook

I’ve uploaded my Day 3 notebook here:
πŸ‘‰ GitHub Link – Day 3 Notebook


πŸ“Ί Resources I Used


🎯 What’s Next?

For Day 4, I plan to cover the Chain Rule & Gradient Descent in more detail, and try implementing it on a simple cost function.

That’s it for today. Step by step, building the foundations stronger πŸ’ͺ

Note: If you followed me from beginning I have just updated the previous two posts so now both of them have the resources I used to learn, like youtube links and websites.

See you tomorrow πŸ‘‹
β€” Dhairya

10
Subscribe to my newsletter

Read articles from Dhairya Patel directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Dhairya Patel
Dhairya Patel

I'm a student, trying to find experience and develop skills, and I want to log that journey here. πŸ˜€πŸ‘Š