I've been a software engineer for about $12$ years now and I have been wanting to learn calculus to help expand my skill set and problem-solving skills (and also as a hobby because I enjoy physics). But I'm running into an issue: every time I try to start learning calculus the notion of "functions" confuses me.
Today I was trying to learn derivative notations (Lagrange, Leibniz and Newton) and I am really struggling to make sense of any of it. Newton and Lagrange with the dot and the prime tick mark are fine but Leibniz has me lost.
How does $\frac{d}{dx} (f(x))$ and $y = f(x)$ make $\frac{dy}{dx}$?
Also, simple things like $f(x)$ when trying to find the derivative of a curve have me confused too. Programming uses functions a lot so I think my understanding of a function is different enough and is throwing me off.
So I guess my real question is when given a function, how does one know what the function definition is? If $f(x)$ will return the value for the "rate of change of $y$ with respect to $x$ of $f$", where is that being defined? (and by defined I mean where can I find the procedure to get the value that the function will return and be assigned to $y$? (assuming that is the correct way to think about it)
Sorry if any of this is confusing! And thanks in advance!
EDIT: After reading the responses I will try to better explain my original question and include additional relevant details. This was my first post here so I apologize if I confused anyone or broke any community guidelines.
As a programmer (PHP 5.4 - 8.1), functions for computers have a very specific set of rules and principles for how they are written and operate. For the most part, they work the same across multiple programming languages with some exceptions (pun intended). Common rules such as: must be defined before calling, the scalar/compound type of the return value must match (if set) the return type that was set when the function was defined, etc.
I believe I have a strong understanding of the rules and mechanics that govern how functions work programmatically which is where I think the root of my issue is.
Math also has functions that appear to share similar properties with computer functions (i.e. inputs/arguments, output/returns) and these math functions also appear to perform some form of procedure like computer functions. They are even capable of being assigned to a variable in a sense ($y = f(x)$).
However, this is where the similarities appear to end.
My question boils down to what are the "rules" that make a math function an actual math function? What can they do? What must they do? What can't they do? And in what ways are math functions the same and different from computer functions at an abstract level?
I understand that they take an input and in the previous example $y = f(x)$ that the variables $y$ and $x$ share some form of relationship when plotted on a graph (i.e. to get the value for $y$ you "run" $f(x)$ so $y$ literally IS the $f$ of $x$)
But when I see functions used for things like derivatives, I get confused. Any computer function that could return a derivative must have some procedure it follows which is defined somewhere the computer can look up to execute it when that function is called to return the answer.
So my original question really boils down to:
IF function F() is defined THEN how can I locate the procedure that F() follows to get its result?
If there are other foundational mathematics I need to learn first (i.e. I am jumping too far into the deep end), please let me know what those are!
My main goals for learning calculus are to be able to solve and write my own physics equations and to help improve my programming skill set.
Thanks to all who have shared examples and resources to try and help me and thanks to future posters as well!
I’ll walk you through a specific example and hopefully that will clarify your problem.
Notation
Let’s define a simple polynomial $f(x)=x^2$ where $x$$\in$$R$ (where $R$ is the set of all real numbers). You can think of this like a machine that maps the input value $x$ to the output value $x^2$.
Then we can calculate the rate of change by differentiating. There are many ways to denote a derivative. If you know the procedure for differentiating polynomials, then you should be able to arrive at the conclusion that the derivative here is simply $2x$.
Here are a few ways that mathematicians write this:
If we say $y=f(x)=x^2$ then differentiating $y$ with respect to $x$ is exactly the same as differentiating $f(x)$ with respect to $x$, and so we could also write:
All we have done here is replace $\frac{df}{dx}$ with $\frac{dy}{dx}$. This isn’t a necessary step and is usually just a notational choice.
Meaning
To understand the meaning of a derivative, let’s use the above example to illustrate.
Imagine $f(x)=y=x^2$. Let’s say that the value of $x$ represents how difficult an activity is. And let’s say that $f(x)$ tells us how boring the task is.
This means that if a task is very difficult (for example $x=100$) or very easy (for example $x=-100$), then the person will be very bored ($f(x)=100^2=(-100)^2=10,000$). This is what the function tells us.
The derivative tells us how fast or slow a function is changing. This is easier to see on a graph, however, another way to think about this is to image what would happen if you move a small amount from a specific point. If you compare $x=100$ to $x=101$, then if you square both of these to calculate the level of boredom, you will find that the difference between the two is $201$. If you did the same for $x=1$ and $x=2$, if you square both of these, then the difference between the two is only $3$. Therefore, the rate of change is much faster from $100$ to $101$ than from $1$ to $2$.
The derivative quantifies this “rate of change” at every point. So we know that the derivative $\frac{df}{dx}=2x$ tells us that at the point $x=100$, the rate of change is $200$, but at the point $x=1$, the rate is only $2$. This helps to explain why we saw a much faster increase when comparing $x=100$ to $x=101$ than we did for $x=1$ and $x=2$ (despite them both being only $1$ apart).
There are lots of other complexities to consider depending on the type of function that you consider. This is something that you will likely come across if you continue to progress in your studies of calculus. Although this isn’t something to worry about too much at this stage.