Consider the cubic curve $X$ defined, over an arbitrary field $K$, by the equation $y^2 =x(x−1)(x−\lambda)$ in $\mathbb{A}^2$, where $\lambda \neq 0,1$. Show that there are no non-constant morphisms $f : \mathbb{A}^1 \mapsto X$.
My attempt:
Suppose $f: \mathbb{A}^1 \mapsto X$ is such that $f(t)=(h(t),g(t))$ for some $g(t),h(t) \in K[t]$ non constant. Then $g^2=h(h-1)(h-\lambda)$ and if $(t-\alpha)$ is a factor of $g(t)$ we have $(t-\alpha)^2$ divides the product $h(h-1)(h-\lambda)$; however $h,h-1$ and $h-\lambda$ are pairwise relatively prime, hence they don't share an irreducible factor $(t-\alpha)^2$. It follows that $(t-\alpha)^2$ divides one of $h$,$h-1$ and $h-\lambda$. Moreover, if $(t-\beta)$ divides one of $h$,$h-1$ and $h-\lambda$ then it divides $g^2$ and hence $(t-\beta)^2$ must divide one of $h$,$h-1$ and $h-\lambda$. It follows that each of $h(t)$,$h(t)-1$ and $h(t)-\lambda$ is a square in $K[t]$, but this is impossible unless $h$ is constant (and consequently, also $g$ is).
The problem is that a morphism is defined by quotient of polynomials, or is it enough in this proof to use polynomials?