Let $G$ be an algebraic group with Lie algebra $\mathfrak g$ and let $\Gamma$ be any finitely generated (discrete) group. One can consider the representation variety $\mathfrak R=\mathrm{Hom}(\Gamma,G)$. If one considers the group scheme $\mathfrak G$ associated to $G$, there is a nice argument that shows that infinitesimal deformations of a homomorphism $\phi\in\mathfrak R(\mathbb R)$ are the (Zariski) tangent space to $\mathfrak R$ at $\phi$ given by the kernel of the map
$$
\mathfrak R(\eta)\colon\mathfrak R(\mathbb R[\epsilon])\to \mathfrak R(\mathbb R)
$$
where $\mathbb R[\epsilon]$ is the algebra of dual numbers and $\eta$ is the augmentation $\eta(\epsilon)=0$.


One checks that 
$$\mathfrak R(\mathbb R[\epsilon])=\mathrm{Hom}(\Gamma,\mathfrak G(\mathbb R[\epsilon]))=\mathrm{Hom}(\Gamma,\mathfrak g\rtimes G)
$$
and $T\_\phi(\mathfrak R)$ is the fibre of $\mathfrak R(\eta)$ over $\phi$, i.e. homomorphisms into $\mathfrak g\rtimes G$ that project onto $\phi$, which must be of the form $\gamma\mapsto(\tau(\gamma),\phi(\gamma))$ for some function $\tau\colon\Gamma\to\mathfrak g$. Finally, the requirement that this homomorphism be indeed a homomorphism implies that $\tau$ must be a $1$-cocycle, i.e. $\tau\in Z^1(\Gamma,\mathfrak g)$, where $\Gamma$ acts on $\mathfrak g$ via $\phi\colon\Gamma\to G$.


My question is, whether the above is also true for Lie groups, which in general may not be algebraic groups.



Infinitesimal deformations of a discrete group inside Lie groups vs. algebraic groups
This fact holds for general Lie groups $G$ (which I will equip with a real-analytic structure) and finitely-generated groups $\Gamma$. It is explained in detail in Raghunathan's book "Discrete subgroups of Lie groups", sections 6.1-6.9), but goes back to Andre Weil's paper "Remarks on cohomology of groups", Annals of Math, 1964. Here is an outline:


Let $x\_1,...,x\_n$ be generators of $\Gamma$ and $R\_i, i\in I$, be the relators (this set need not be finite). Each relator $R\_i$ (regarded as a word in the letters $x\_k^{\pm 1}$) defines an analytic map $f\_i: G^n\to G$. Thus, $Hom(\Gamma,G)$ is identified naturally with the real-analytic variety
$$
\{(g\_1,...,g\_n)\in G^n: f\_i(g\_1,...,g\_n)=1, i\in I\},
$$
$$
\rho\mapsto (\rho(x\_1),...,\rho(x\_n)). 
$$
Now, you say that for $\rho\in Hom(\Gamma,G)$, the tangent space $T\_{\rho}(\Gamma,G)$ is the intersection of kernels of the derivatives $df\_i$ at the point $\rho$. In the case when $G$ is algebraic, this is the Zariski tangent space, otherwise, this is the tangent space $m\_\rho/m^2\_\rho$ of $Hom(\Gamma,G)$ regarded as an analytic variety (that need not be reduced). Weil and Raghunathan also explain why this is natural in the context of group homomorphisms. Then, they prove that $T\_{\rho}(\Gamma,G)\cong Z^1(\Gamma, Ad\circ \rho)$, see 6.9 in Raghunathan's book (he is only interested in local rigidity, but his proof is general). In particular, if $H^1(\Gamma, Ad\circ \rho)=0$, then $\rho$ is locally rigid. 


The advantage in the algebraic groups case is that you do not need to go through group presentations to see all this, maybe there is a similarly clean proof in the real analytic case. 


