# How come we ignore constants when finding derivatives?

Example:
$f(x) = x\sin(x)$ - use product rule
$f(x) = 2\tan(x)$ - differentiate term by term

I have two ideas as to the cause of this:

1) function $f(x)$ is in respect to $x$, since $x$ is in the parenthesis. Therefore, we find the derivative of only $x$'s

2) It doesn't matter that it is in respect to x because we differentiate all variable terms anyway. Constants simply have different rules.

EDIT:
But the problem is option one does not take into account the fact that:
$f(x) = 5 + \sin$
$f'(x) = \cos$
In other words, it appears constants are effected when they are their own term.

-
$\sin$ and $\cos$ as you have them in your edit are completely meaningless. – Jp McCarthy Feb 25 '14 at 12:13

Please comment if my notation is unclear.

If we write $\nabla : D_1(\mathbb{R},\mathbb{C}) \rightarrow D_0(\mathbb{R}, \mathbb{C})$ for the differentiation operator, then we can prove that for all $f \in D_1(\mathbb{R},\mathbb{C})$ and all $c \in \mathbb{C}$, we have the following.

$$\nabla(cf) = c\nabla(f).$$

So we're not really "ignoring" the multiplication by $c$, rather we're making use of a theorem about how $\nabla$ interacts with multiplication by a complex number. If you want to know intuitively why this theorem is true, just think about the geometric meaning of differentiation.

Formally, we can prove it as follows. First, lets define that $\nabla$ is the unique function $D_1(\mathbb{R},\mathbb{C}) \rightarrow D_0(\mathbb{R}, \mathbb{C})$ such that for all $f \in \mathrm{dom}\,\nabla$ and all $x \in \mathbb{R}$, we have the following.

$$\nabla(f)(x) = \lim^{\mathbb{R}}_{h \rightarrow 0}\frac{f(x+h)-f(x)}{h}$$

Now to prove our proposition, consider arbitrary $f \in D_1(\mathbb{R},\mathbb{C}), c \in \mathbb{C}.$ Then for all $x \in \mathbb{R},$ we have:

$$\nabla(cf)(x) = \lim^{\mathbb{R}}_{h \rightarrow 0}\frac{cf(x+h)-cf(x)}{h} = c\left(\lim^\mathbb{R}_{h \rightarrow 0}\frac{f(x+h)-f(x)}{h}\right)=c\nabla(f)(x)$$

Thus $\nabla(cf) = c \nabla(f),$ as required.

-

Constant functions are functions. Hence, you can differentiate $x \mapsto 2 \tan x$ by the product rule. Just try! The formula $$\frac{d}{dx} c \cdot f(x) = c \cdot f'(x)$$ is a particular case of $$\frac{d}{dx}f(x)g(x) = f'(x)g(x)+f(x)g'(x).$$

-

There are a few different ways you can resolve this (though they are all simultaneously true, of course).

The first is by thinking of a constant as a function of $x$ itself; say $f(x)=c g(x)$, and letting $h(x)=c$, we have $f(x)=h(x)g(x)$. From here, we can use the product rule to take our derivative: $f'(x)=h'(x)g(x)+g'(x)h(x)$. But it isn't hard to show directly from the definition of differentiation that constant functions are everywhere differentiable and have derivative zero: $$\lim_{x\rightarrow y}{\frac{h(y)-h(x)}{y-x}}=\lim_{x\rightarrow y}{\frac{c-c}{x-y}}=\lim_{x\rightarrow y}{0}=0$$ Thus, $f'(x)=0\cdot g(x)+g'(x)h(x)=h(x)g'(x)=cg'(x)$.

However, another way we could have dealt with this is by using the properties of limits: $\lim_{x\rightarrow y}{cf(x)}=c\lim_{x\rightarrow y}{f(x)}$. Then when we apply the definition of differentiation, we have $$(cf)'(x)=\lim_{x\rightarrow y}{\frac{cf(y)-cf(x)}{y-x}}=c\lim_{x\rightarrow y}{\frac{f(y)-f(x)}{x-y}}= cf'(x).$$

-

You're not "leaving them alone". Constant functions have derivative zero. The reason they still "survive" when they appear in a product is that in the product rule, each component of the product appears twice in the answer: once with a derivative and once without. It is in the part where the constant term appears without a derivative that it can survive.

-