Power function in hypothesis testing Example 1:
$X_1,...,X_n$ is a random sample from $\text{Poisson}(\lambda)$
$T=\sum X_i$
$T\sim \text{Poisson}(n\lambda)$
Consider the test: $H_0: \lambda \le \lambda_0$ vs $H_1: \lambda > \lambda_0$
The rejection region is of the form $T>c$
Let $\lambda_0=1$ and use CLT to choose $n$ so that the power function $\beta(\lambda)$ satisfies $\beta(1)=0.01$ , $\beta(2)=0.05$. Specify also the "rejection limit" $c$ which you find.
Note: if $Z\sim N(0,1)$ then $P(Z\ge 1.645)=0.05$ and $P(Z\ge 2.326)=0.01$
Solution:
We have $ET=\text{Var}(T)=n\lambda$ and it follows from CLT that if $n$ is large 
$\frac{T-n\lambda}{\sqrt(n\lambda)}\sim N(0,1)$
we have
$\beta(1)=P(T>c|\lambda=1)=P(\frac{T-n}{\sqrt{n}}>\frac{c-n}{\sqrt{n}}|\lambda=1)=P(Z>\frac{c-n}{\sqrt{n}})=0.01$
$\beta(2)=P(T>c|\lambda=2)=P(\frac{T-2n}{\sqrt{2n}}>\frac{c-2n}{\sqrt(2n)}|\lambda=2)=P(Z>\frac{c-2n}{\sqrt{2n}})=0.95$
which gives us the equations
$c-n=2.326\sqrt{n}$
$c-2n=-1.645\sqrt{2n}$
which has the solutions $n=21.64$, $c=32.47$ or n=22 and c=33

Example 2:
Let $X_1,...,X_n$ be a random sample from $N(\theta,\sigma ^2)$
$H_0: \theta \le \theta_0 $ vs $H_1: \theta > \theta_0$
reject $H_0$ if $\frac{\bar X-\theta_0}{\sigma /\sqrt {n}}>c$, where $c$ is any positive number
The power function of the test is:
$\beta(\theta)=P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c) = P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c +\frac{\theta_0-\theta}{\sigma /\sqrt n})=P(Z>c+\frac{\theta_0-\theta}{\sigma /\sqrt n})$

Question: Why does the power function become like that? when they are finding $\beta(1), \beta(2)$ etc? The "logic" in example 1 doesn't really seem to match up with the "logic" in example 2? Could someone explain this?
Additionally I am not really understanding the equality in the last line in example 2: basically how: $P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c) = P_\theta(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c +\frac{\theta_0-\theta}{\sigma /\sqrt n})$. 
 A: I will start from the last question and work backwards. I think there might be a typo in the book or in your transcription:
\begin{align}
P_\theta\left(\frac{\bar X-\theta_0}{\sigma /\sqrt n}>c\right) 
& = P_\theta\left(\bar X >  \theta_0 + c \, \sigma /\sqrt n\right) \\
& = P_\theta\left(\bar X - \theta >  \theta_0  - \theta + c \, \sigma /\sqrt n\right) \\
& = P_\theta\left(\frac{\bar X-\theta}{\sigma /\sqrt n} > c +\frac{\theta_0-\theta}{\sigma /\sqrt n}\right) \\
& = P_\theta\left(Z > c +\frac{\theta_0-\theta}{\sigma /\sqrt n}\right) \\
& = 1-\Phi\left(c +\frac{\theta_0-\theta}{\sigma /\sqrt n}\right)
\end{align}
The point is that, you are dealing with a general expression for the probability of rejecting the null hypothesis at any $\theta$ in the parameter space and from the final expression you can observe that this expression, as a function of $\theta$, is an increasing function. When $\theta=\theta_0$ then, we have the $\sup$ of this function over the null parameter space, $\sup = 1-\Phi(c)$. For a specified significance level $\alpha$ then, we will take $c = \Phi^{-1}(1-\alpha)$ guaranteeing the worst Type-I error to be no more than $\alpha$.
Moving on to the first example, note that you are dealing with $\sum{X_i}$ versus $\bar X$ in the second example. Also, Poisson has mean = variance.
You may change the 1st example to be similar to the 2nd by saying: "Reject null if:"
\begin{align}
T & > c \\
\sum{X_i} & > c \\
\bar X & > \frac{c}{n} \\
\frac{\bar X - \lambda_0}{\sqrt{\lambda_0}/ \sqrt n} & > \frac{\frac{c}{n} - \lambda_0}{\sqrt{\lambda_0}/ \sqrt n}
\end{align}
But this point, we should realize that writing an expression like example 2 is not easy because $\lambda_0$ appears in both numerator and denominator. 
So it is easier to deal with $\sum{X_i}  > c$. So we get 
\begin{align}
P_\lambda\left(\sum{X_i} > c \right)
& = 
P_\lambda\left( \frac{\sum{X_i} - n \lambda }{\sqrt{ n \lambda}}
>  \frac{c - n \lambda }{\sqrt{ n \lambda}}\right) \\
&  \overset{\mathrm{CLT}}{\approx} P_\lambda\left(Z
>  \frac{c - n \lambda }{\sqrt{ n \lambda}}\right)
\end{align}
In addition, problem 1 gives the values of the power function at two specific parameter values and asks you to solve for two unknowns $c$ and $n$ given those. One could ask a similar question in example 2 also, but there the problem will need to provide $\sigma$ in addition.
