Question: In an example I had to prove that $\sin^2(x)+\cos^2(x)=1$ which is fairly easy using the unit circle. My teacher then asked me to show the same thing using the following power series:$$\sin(x)=\sum\_{k=0}^\infty\frac{(-1)^kx^{2k+1}}{(2k+1)!}$$ and $$\cos(x)=\sum\_{k=0}^\infty\frac{(-1)^kx^{2k}}{(2k)!}$$
However, if I now take the squares of these values I get a really messy result that I can't simplify to 1. 

Could anyone give me a hint on how to deal with this question?

Answer: 
**Hint:** Differentiate the power series term by term. We get that (surprise!) the derivative of $\sin x$ is $\cos x$, and the derivative of $\cos x$ is $-\sin x$. Let $f(x)=\sin^2 x+\cos^2 x$. Show its derivative is $0$. Thus $f(x)$ is constant.
Define $f: \mathbb{R} \rightarrow \mathbb{R}$ by
$$
f(x) = \text{sin}^2(x) + \text{cos}^2(x).
$$
From the chain rule it follows that
$$
f'(x) = 2\cdot \text{sin}(x) \cdot \text{sin'}(x) + 2\cdot \text{cos}(x) \cdot \text{cos'}(x) = 2\cdot \text{sin}(x) \cdot \text{cos}(x) + 2\cdot \text{cos}(x) \cdot (-\text{sin}(x)) = 0, 
$$
as we know that $\text{sin'}(x) = \text{cos}(x)$ and $\text{cos'}(x) = -\text{sin}(x)$.
We will now show that if the derivative equals zero, the function is constant, using the Mean-value theorem.
Let $a,b\in \mathbb{R}$, with $a<b$. As $f$ is differentiable, and hence also continuous, on $\mathbb{R}$, we know there exists a $c\in (a,b)$ satisfying
$$
f'(c) = \frac{f(b)-f(a)}{b-a}.
$$
As we know that $f'(c) = 0$ for all $c \in \mathbb{R}$, multiplying both sides of the equation by $b-a$ yields $f(b)-f(a)=0$. Equivalently, $f(b) = f(a)$ for all $a,b\in \mathbb{R}$, where $a<b$. Hence $f$ is constant on $(a,b)$.
Note that
$$f(0)= \text{sin}^2(0) + \text{cos}^2(0) = 
( \sum\_{k=0}^\infty (-1)^k \cdot \frac{1}{(2k+1)!} 0^{2k+1} )^2 +
( \sum\_{k=0}^\infty (-1)^k \cdot \frac{1}{(2k)!} 0^{2k} )^2 = 0 + 1 = 1,
$$
as only the first term of the cosine power series yields a nonzero value, namely 1 ($(-1)^0 \cdot \frac{1}{(0)!}0^0=1$, since $(-1)^0=1$, $0!=1$ and $0^0=1$).

In conclusion, for all $x \in \mathbb{R}$, $f(x)=1$, so that
$$
\sin ^{2}(x)+\cos ^{2}(x)=1.
$$