Prove that $C_K(H) = \ker \varphi$ I'm doing an exercise in Dummit and Foote's Abstract Algebra. Here's the setup;

Let $H, K$ be groups, let $\varphi:K \to \operatorname{Aut}(H)$ be a homomorphism, and identify $H, K$ as subgroups of $G = H \rtimes_\varphi K.$

The exercise is to prove that the centraliser of $H$ in $K$ is exactly the kernel of $\varphi.$
I'm not sure but my strategy was simply to write down what the elements of $C_K(H)$ look like and reason that way.
Recall that 
$$C_K(H) = \lbrace k \in K : kh = hk,\ \ \forall h \in H\rbrace.$$
I'm a little unsure about semidirect products but in the definition laid out here on the second page, it say that one should define the automorphism $\varphi_k \in \operatorname{Aut}(H)$ as
$$\varphi_k(h) = khk^{-1}.$$
Is this always how you define these automorphisms for the semidirect product, since if that is the case then the exercise is somewhat trivial.
If $k \in \ker \varphi$ then $k \mapsto \operatorname{id} \in \operatorname{Aut}(H)$, or equivalently, $khk^{-1} = h$, but if $k \in C_K{H}$ then $kh = hk$ so that $khk^{-1} = h$, and the two sets are shown to be equal.
I'm confused because the hint given is that $C_K(H) = C_G(H) \cap K$ which seems unnecessary.
 A: First of all about your confusion:
It is not that the automorphism is defined as that but that the relation comes out as a deduction when you do the above mentioned identification of $H$ and $K$ with the corresponding subgroups in $G=H \rtimes_\varphi K$. See that in the definition of semi-direct products $H$ and $K$ are arbitrary groups hence actually without the identifications,  $khk^{-1}$ doesn't really make sense!(there is no operation between $h$ and $k$). What happens is the following:
$(h_{1}, k_{1}).(h_{2},k_{2})=(h_{1}.\phi_{k_{1}}(h_{2}), k_{1}k_{2})$ ... (1)
This is the definiton of the operation.
Identify $H$ with following subgroup : $ \{(h,1): h\in H \}\ $ , and $K$ with the following $ \{ (1,k):k \in K \}\ $. Call $(h,1)$ as $h$ and $(1,k)$ as $k$. 
Now, $(1,k)(h,1)(1,k)^{-1}= (1,k)(h,1)(1,k^{-1})= (1.\phi_{k}(h),k)(1.k^{-1})=(\phi_{k}(h),1)$. Now under the identification as I have written before you get $\phi_{k}(h)=khk^{-1}$. 
Now about the real problem: What really is $C_{K}(H)$?
$C_{K}(H)=\{\ (1,k) \in H \rtimes_\varphi K  | (1, k)(h,1)=(h,1)(k,1) \forall (h,1) \in H \rtimes_\varphi K \}\ $ .
Your definition of the above set precisely comes when you do the identifications as above, that is , $k$ for $(1,k)$ and $h$ for $(h,1)$. 
Now clearly under the identification $C_{K}(H)=ker (\phi)$ because of the relation that we have already got , that is , $\phi_{k}(h)=khk^{-1}$.
