Solution (source code)

= Solution

Under the <null hypothesis> $\theta=0$, $X$ has the <uniform distribution> on $[0,1]$. Against $\theta=1$, the <likelihood ratio> is $2x$, increasing on that interval. The <Neyman-Pearson lemma> therefore gives
$$
\boxed{\text{Reject }H_0\text{ when }X>1-\alpha\quad(0\leq\alpha\leq1)}.
$$
The <size of a statistical test> is $\mathbb P_0(X>1-\alpha)=\alpha$, and there is no boundary randomisation issue for this <continuous probability distribution>. Its <statistical power> against $\theta=1$ is $\int_{1-\alpha}^1 2x\,dx=2\alpha-\alpha^2$.

For every admissible alternative $0<\theta\leq1$, the <likelihood ratio> $1-\theta+2\theta x$ is strictly increasing. The same upper-tail rejection set has size $\alpha$ and is a <most powerful test> against each fixed such alternative, again by the <Neyman-Pearson lemma>. Hence \b[the same test is a <uniformly most powerful test> against $\theta>0$], where the alternative is understood within the specified parameter range. Its full <power function> is
$$
\boxed{\beta(\theta)=\int_{1-\alpha}^1(1-\theta+2\theta x)\,dx
=\alpha+\theta\alpha(1-\alpha)}.
$$
For $\alpha=0$ or $1$, the never-reject or always-reject test supplies the respective endpoint case.