# Derivatives and Differential Equations

What is a **derivative**? What does it mean when we say things like or ? What’s a **partial derivative**? How does **differential equations** fit into all of this?

# Function

A function maps inputs to outputs. The inputs/outputs can be anything as long as a particular input maps to the same exact output every single time. In CS, this is sometimes known as a “pure function”.

A lot of times, functions map from set of real numbers to set of real numbers and when this is the case, we can start talking about what happens to the output of the function as we move an infinitely small amount along its domain (or the axis of domain that we be interested in mang).

# Rate of change of a function (i.e. slope)

When we talk about , we are assuming we have a function that takes and maps it some output, and we are calling that output . So is asking “at any point in the domain, if from that point you move an infinitely small amount in the domain, how much did you move in the range homie?”. In other words, we take a function of and we get another function, that has the same domain, but instead of telling us the original output, it tells us how fast the output was changing, instantaneously at each . In other words, it gives you a new function that tells you the slope of the original function at each spot in the domain.

Its really powerful dude. Newton and Lebnitz don’t mess around.

You map a function from domain-range to domain-rate (or domain-slope).

# Second Derivative (rate of change of the change)

Now, you can take the derivative of the new function, to find how fast the RATE itself is changing as a function of the domain. This is called the 2nd derivative, I.e. “at what rate does the change change?”. You can keep going, to 3rd, 4th etc derivatives. This is really no biggie, because at each stage you have a function and when you take a derivative you just get the rate THAT function is changing at, but this is just another function.

# Limits

One last thing bro, we can symbolically calculate the derivative of a lot of functions thanks to the idea of limits. It’s just saying, ok if we move from to , so amount in the domain, how much do we move in the range? What happens as we make smaller and smaller, making it approach . As is approaching , what happens to the ratio / (which is also known as slope, rate, ratio, velocity, whatever you wanna call it my dude).

Think about a function . Rate is rise over run, deltaY over deltaX, whatever you wanna call it bruh, it’s

What happens to this last equations as deltaX approaches 0? The output approaches 2x obviously!! Haha I’m jk, it’s not obvious and as a matter of fact I can’t deduce why it approaches 2x, because it’s 3:30 am and I’m writing this on my phone half asleep…I just know the derivative of is 2x so that last equation better be approaching 2x as deltaX approaches 0 or else!!

Since its 3:30 am and symbolically deducing this is hard, why not do it *numerically*? Just keep plugging smaller values of deltaX in the equation and you’ll see the output keeps getting closer and closer to 2x.

So we’ve found out that if your function is , its dy/dx is 2x. You can use similar reasoning to find the derivitive of many other functions. You use **chain** rule to find derivitive of nested functions (composed functions). We also have a way of handling functions that add/subtract terms of different functions. In summary, we gots a ways of finding derivitive of many many types of functions symbolically.

# Partial derivative

Anyways good night! (Wacks head w pan). Tomorrow we discuss partial derivative (bruh, they are really simple, when you have a multivariate function and you take the derivative wrt a particular variable you’re saying “a small change in THIS variable will result in this much change in the function output, which may depend on particular values of the other inputs”.

# Differential Equations

And also tomorrow we’ll talk about a special type of equations. You know how normal, boring equations relate quantities of stuff (variables)? Then to solve them means to find all values of variables that satisfy the equation? (Also sometimes “solving” for a particular variable means to restate the equality in another way, a way where a particular variable is isolated on one side of the equality statement) .

Anyways , **differential equations** relate a function with one or more of its own derivatives. In other words, you state the relationship between an unknown function and one or more of its derivatives (first derivitive, second derivitive, etc). The solution to such an equation are functionS (yes plural) that satisfy said relationship. In other words all functions that have the said relationship w their derivatives are a solution to the differential equation.

# The End

Ok I really need to sleep, goodnight. Maybe I’ll expand, correct and clarify this crappy article tomorrow, maybe not, all depends on what I feel like doing :)