1 | initial version |

Give a name to the generator of your quadratic field as follows.

```
sage: K.<a> = QuadraticField(5)
```

Taking square roots of elements in the field sometimes leaves the field, sometimes stays in it.

```
sage: K(2) + sqrt(K(3))
sqrt(3) + 2
sage: K(2) + sqrt(K(5))
a + 2
```

You can test membership in the field as follows.

```
sage: K(2) + sqrt(K(3)) in K
False
sage: K(2) + sqrt(K(5)) in K
True
```

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.