$\lim_{h \to 0} \frac{f(x+h) -f(x)}{h} = \cos(x)$, prove $f(x) = \sin(x)$, using strictly this equation. Disclaimer: I am fairly new to calculus.
By simple inspection, the answer is obviously $\sin(x)$, because the "equation" (definition of derivative) is asking "The derivative of what function gives $\cos(x)$?" or "What is the antiderivative of $\cos(x)$?"
But how could this be proved algebraically using strictly this equation, in the title, or any equation equalling the definition of derivative to another function, for that matter? The equation looks solvable to me, optimistically, at first glance, it's just a functional equation with a limit variable. And I have never seen anyone use the definition of derivative to find antiderivatives, neither have I seen anyone disprove it as a method. The only flaw I can notice is that a function has infinitely many antiderivatives due to the added constant on the end which can represent any number, but at the same time I can't pinpoint how this would affect finding the non-constant part of the answer.
 A: Let $f:\mathbb{R}\to\mathbb{R}$ be a differentiable function such that
$$
\forall x\in \mathbb{R},\quad\lim_{h\to 0} \frac{f(x+h)-f(x)}{h} = \cos{x}
$$
and consider the function $g:= f-\sin$. It is easy to verify that $g^\prime=0$. The next step is to prove this means that $g$ is constant. To do that, we need the mean value theorem (not sure if a direct proof from the definition exists).
If $x < y$ are real numbers, then by the MVT, we have a $c\in (x, y)$ such that $$
g(x) - g(y) = (x-y)g^\prime(c) = 0\quad (g^\prime=0)
$$
and hence $g(x) = g(y)$. Since $x$ and $y$ are arbitrary, this does mean that $g$ is constant which means that $f(x)=\sin(x)+c$ for some constant c.
A: This is an expansion of my comments to the question.
Let us observe that definition of derivative is a local concept ie it deals with the behavior of a function at a point (in reality an immediate neighborhood of a point). The equation in question $$\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}=\cos x\tag{1}$$ has to be understood as valid in some interval of values of $x$ and not just at some point, say $0$. Just looking at $x=0$ does not give much information about $f$ (in that case even $f(x) =x$ works as a solution to the equation).
Let us then assume that the above equation holds for all values of $x$. We prove that if there exists a solution to the above equation then it must equal $f(x)=\sin x+f(0)$.
Let us first take an interval $[a, b] $ where $\cos x$ is monotone (eg $a=0,b=\pi$) and let $x\in[a, b] $. Let us define $$x_i=a+\frac{i(x-a)} {n}, i=0,1,2,\dots,n$$ and then we have $$f(x) - f(a) =\sum_{i=1}^n f(x_i) - f(x_{i-1})=\sum_{i=1}^nf'(\xi_i)\cdot\frac{x-a}{n}=\frac{x-a}{n}\sum_{i=1}^n\cos \xi_i\tag{2}$$ where $\xi_i\in(x_{i-1},x_i)$. The above relation holds for all values of $n$ and some suitable values of $\xi_i$ (based on $n$). However the sum equals $f(x) - f(a)$ no matter what value of $n$ is chosen. And therefore the equation holds when $n\to\infty$. Due to the monotone nature of $\cos$ in $[a, b] $ the sum $\sum\cos \xi_i$ lies between $\sum\cos x_{i-1}$ and $\sum\cos x_i$. One can use the formula for sum of cosines of angles in arithmetic progression to evaluate these two sums in explicit manner.
We have $$\frac{x-a}{n}\sum_{i=1}^n\cos x_i=\frac{x-a}{n}\cdot\frac{\sin ((x-a) /2)}{\sin((x-a)/2n)}\cdot\cos ((x_1+x_n)/2)$$ and the above tends to $$2\sin((x-a)/2)\cos ((x+a) /2)=\sin x-\sin a$$ The other sum $((x-a) /n)\sum\cos x_{i-1}$ also tends to same limit as $n\to\infty$. It follows from $(2)$ that $$f(x) - f(a) =\sin x-\sin a$$ For $a=0$ we get $f(x) =\sin x+f(0)$ for $x\in [0,\pi]$. Using intervals $[k\pi, (k+1)\pi]$ for all integers $k$ one can extend the above result for all values of $x$.
