Are there more examples of this method in calculus? One of my absolute favorite derivations in math is the calculation of the sum of the alternating harmonic series, $1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \dots$, which is done by considering the function $f(x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \dots$ and noticing that $f'(x) = 1 - x + x^2 - x^3 = \frac{1}{1+x}$ implying $f(x) = \ln(1+x)$ and thus the series converges to $\ln(1+1) = \ln(2)$.
The method here of deriving a formula for an unknown function by taking its derivative and gaining more information about the original function can also be used to derive $e^{i\theta} = \cos(\theta) + i\sin(\theta)$. If $f(\theta) = \cos(\theta) + i\sin(\theta)$, then $f'(\theta) = if(\theta)$, which solves to $f(\theta) = e^{i\theta}$.
My question is, are there more examples of this technique, or is it a coincidence that it worked so well in these two cases?

$(1+x^2)^{-1}=1-x^2+x^4-x^6+\dots$,
$\arctan x=\int(1+x^2)^{-1}\,dx=x-(x^3/3)+(x^5/5)-(x^7/7)+\cdots$
$\pi/4=\arctan1=1-(1/3)+(1/5)-(1/7)+\cdots$.
Another example (that has come up often on this site): show that
$$
\sum_1^{\infty}{n\over2^n}={1\over2}+{2\over4}+{3\over8}+{4\over16}+{5\over32}+\cdots=2.
$$
Solution: let $f(x)=\sum_1^{\infty}nx^n$, so we want to show $f(1/2)=2$. Then $x^{-1}f(x)=\sum_1^{\infty}nx^{n-1}$ is the derivative of $\sum_1^{\infty}x^n=x/(1-x)$. The derivative of $x/(1-x)$ is $(1-x)^{-2}$, so $f(x)=x(1-x)^{-2}$, and $f(1/2)=2$.
