In the derivative notation $f'(x)$, does the $(x)$ mean "with respect to $x$" or something else?

I'm going to steer clear of high level definitions for functions and instead give you a more intuitive sense for what this notation means. Later on, if you stick with mathematics, you will be exposed to more accurate and rigorous definitions for functions as "mappings" between sets that have special characteristics.

It seems like part of your confusion stems from a lack of understanding as to what a function is. It's helpful to think of a function as some operation that's being defined, and we typically give that operation a name like $f$ or $g$. The notation $f(x) = x^2$ simply means "there exists an operation, called $f$, performed on the variable $x$, and that operation is performed by taking the square of $x$." Another example is $g(x)=2x^3+4$. This is simply notation that means "there exists an operation, called $g$, performed on the variable $x$, and that operation is $2x^3+4$." You are correct in saying $x^2$ and $2x^3+4$ are polynomials. In the notation just used, they are more generally being referred to as operations with specific names, $f$ and $g$, respectively. Any given mathematical expression is not either a function or a polynomial; it can be both.

Now, as for derivatives... the notation $f'(x) = x +4$ simply means "there exists an operation, called $f'$, performed on the variable $x$, and that operation is $x+4$." Now, the addition of the prime symbol $'$ after the $f$ is the convention that is used to let you know that this particular function, or "operation," is actually the derivative of another function, that function being $f$. So in short we say $f'(x)$ is "the derivative of $f$ with respect to $x$."

You also seem to be confused by the phrase "with respect to $x$." Remember that $x$ is simply a variable. It represents some arbitrary number in the domain, but it is NOT any particular number in the domain. So $f'(x)$ meaning "the derivative of $f$ with respect to $x$" is another way of saying "the derivative of $f$ taken at some arbitrary number in the domain of $f$." It is difficult to tell you what $f'(a)$ means without any context, but this is most likely the author or your teacher using the letter $a$ to represent a particular number in the domain of $f$ as opposed to any arbitrary number in the domain of $f$. In other words, $f'(a)$ is "the derivative of $f$ where $x=a$." Some people may still use the words "the derivative of $f$ with respect to $a$," but what they mean is "the derivative of $f$ where $x=a$." As you mentioned already, you could also interpret this as "the derivative of $f$ at the point where $x=a$." All of these are different ways of saying the same essential thing.

If you see $f'(ax)$, this means that the input to the function $f$ is some arbitrary number $x$ multiplied by some particular number $a$.

The notation $\frac{d}{dx}f(x)$ is just another way expressing $f'(x)$. They represent and mean the exact same thing; the reason they are both used is part tradition and part utility. Calculus was developed independently by Newton and Leibniz long ago, and they each developed their own notation that remains in use today, albeit with some changes along the way. Sometimes $f'(x)$ is preferred because it is more compact; at other times $\frac{d}{dx}$ is preferred because it clearly demonstrates that a derivative is the ratio of two infinitesimal quantities, which in some proofs or applications is quite useful.


When declaring a function we need to specify 3 things: a domain, a codomain and a mapping rule. In particular, when $f$ takes only one variable as input, we declare it as

$$f\colon A\to B, \quad f(x)=\text{some expression in }x.$$

The symbol $f(x)$ represents an element of $B$, but not the function itself. The symbol $f$ is the function. The symbol $x$ is irrelevant here, we could have used $\diamond$ if we wanted to.

We can obviously make functions that take functions as input and produce functions as output. Such functions are sometimes called operators; the derivative is an example of an operator, called the differential operator, and both $d/dx$ and $'$ is what we use to denote it. The fact that $x$ appears here is again irrelevant, we could have used $\frac{d}{d\diamond}$ if it was clear from the context that we use $\diamond$ to represent the indeterminate.

As $d/dx$ is a funciton, it has a domain (of which e.g. real valued differentiable functions in one variable are elements of) and a codomain. So if $f$ is in its domain, then $\frac{d}{dx}f$ is the corresponding element in the codomain, i.e. the output is a function in the codomain, and not a function in the codomain evaluated at some point. Since $'$ represents the same operator, $f'$ represents the same element in the codomain as $\frac{d}{dx}f$.

So what is $\frac{d}{dx}f(x)$? It is $\left[\frac{d}{dx}f\right](x)$, i.e. the function $\frac{d}{dx}f$ evaluated at $x$. Similarly, $f'(x)$ is the function $f'$ evaluated at $x$.

Then, what does $f'(a)$ mean? The same thing as $f'(x)$, except we replace $x$ by $a$. But be careful: $f(a)'$ doesn't mean the same thing.

About you other concern: first, polynomials are functions. Communicating mathematics can be very different to doing mathematics. When we say that a function is $x^2$, it is implicitly understood that we are talking about the square function, i.e. the real-valued (also, possibly complex-valued) function $f$ in one real (or complex) variable such that $x\mapsto x^2$. But after a while it gets really tedious to keep repeating all of that, when we all know that "square function" or "the function $x^2$ is to be understood as the same thing.