Let $A$ a $C^*$-algebra with unit and $a\in A$ a self-adjoint element. Show that $$ \cos^2(a) + \sin^2(a) = 1. $$
Attempted:
How $a$ is self-adjoint, we have $C(\sigma(a))\cong C^*(1,a)$, where $C^*(1,a)$ is the $C^*$-algebra generated for $1,a$. How $\sigma(a)\subset\mathbb{R}$, we have that $1=\cos(x)+\sin(x)$ like a real continue function well defined. How $\varphi(1)=1$, where $\varphi$ is the $*$-homomorphism about $C(\sigma(a))\cong C^*(1,a)$, then $1=\varphi(1)=\varphi(\cos^2+\sin^2)=\varphi(\cos^2)+\varphi(\sin^2)=\cos^2(a)+\sin^2(a)$.
Note that $\varphi:C(\sigma(a))\to C^*(1,a)$ and $\varphi(f)=f(a)$, so $\cos^2(a),\sin^2(a),1\in A$.
This is correct?