• ramirezmike@programming.dev
    link
    fedilink
    arrow-up
    16
    ·
    8 months ago

    I had pretty terrible math education in school but as an adult I’ve gotten into programming and making video games and every time I learn a math concept I think “wow, math is even cooler than I thought” but the main part stopping me from learning some concepts is not having a practical example.

    I vaguely know differentiation and integration… I think it might be the correct way to describe things like determining/applying acceleration to an object over time… but when I read your description I really don’t understand…

    I think that’s in general what I run into with math. it’s cool and amazing when I get it, but a lot of the descriptions of concepts have a lot of assumptions about the reader sometimes to the point where to understand the description you’d have to already understand the concept.

    • agamemnonymous@sh.itjust.works
      link
      fedilink
      arrow-up
      13
      ·
      edit-2
      8 months ago

      So acceleration is a great example. Velocity is change in position over some change in time, v = ∆p/∆t (∆is just a symbol that means “change in ___”). You calculate this by finding the difference in position (p2-p1) and dividing it by the corresponding difference in time (t2-t1). For example, if I’m on the highway, and I pass mile marker 20 at exactly 11:00, and mile marker 75 at exactly 12:00, my average velocity is (75-20)miles/(12-11) hours, or 55 miles/hour. Simple.

      Acceleration is change in velocity over change in time, a = ∆v/∆t. Let’s say you plug a recorder into your speedometer, so you get a graph that plots your velocity over time. Now if you don’t start measuring until you’re on the highway with cruise control on, the graph will just show a horizontal line at whatever speed you set cruise control to. If you speed up to pass someone, the curve will slope up a bit. If you get slowed down by traffic, the curve will slope down a bit. If you calculate the slope of the curve over one of those intervals(∆v/∆t), you’ll get your average acceleration over that interval. Simple.

      Differentiation is just making a slope calculation like that, but for such a small ∆t that it’s practically instantaneous. You can’t make it exactly instantaneous, because if t1 = t2, then t2 - t1 = 0, and we all know you can’t divide by 0. So mathematicians came up with something called an ‘epsilon’, which is just an infinitesimally small value that’s almost 0 but not quite. We see how our function, in this case ∆v/∆t, behaves if we set ∆t to epsilon. That is, how the function is behaving at (basically) one exact instant, instead of averaged over some longer period. We symbolize that our ∆ is infinitesimally small by changing it to a d. In this case ∆t is shown as dt. So ∆v/dt is our instantaneous acceleration at any one point in time, like the moment I speed up to pass someone.

      In conclusion, differentiation is just instantaneous rate of change: the slope of some function over an infinitesimally narrow interval.

      Integration is kinda to differentiation what multiplication is to division. Let’s say instead of trying to extract acceleration from our velocity graph, we want to extract the distance traveled.

      Distance is equal to velocity • time. If I travel at a constant 50mph for 3 hours, total distance traveled is 50mph • 3h = 150 miles. If I have a graph of my velocity, it will be shown by a horizontal line at y = 50, with the x-axis ticking away the hours traveled. That means that our distance formula, velocity • time, is exactly the same as the formula for the area of the rectangle under our line, 50 • 3. Simple enough.

      This gets a little more complicated if our velocity isn’t constant, so the area under the velocity curve isn’t a rectangle. However, we can approximate the area under a curve by slicing it into narrower rectangles (kinda like pixelating a circle), and adding up those areas. We can make our approximation better and better by making those rectangles narrower and narrower. The best approximation would use that epsilon trick from earlier, making the width of each rectangle almost-but-not-quite 0 (like an extremely high resolution pixelated circle).

      That’s basically integration. Differentiation and integration are basically the fairly straightforward concepts of finding the change of a value, and finding the total accumulation of a value, taken to the highest resolution we can via the concept of an infinitesimally small interval.