ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 26 Oct 2014 17:59:31 +0100Domain and range in Sage Mathhttps://ask.sagemath.org/question/24634/domain-and-range-in-sage-math/How do i find the domain and range in Sage Math of a function:
f(x) = x/(x^2-1)
g(x) = e^(-x^2) ?Sun, 26 Oct 2014 14:51:29 +0100https://ask.sagemath.org/question/24634/domain-and-range-in-sage-math/Answer by masac for <p>How do i find the domain and range in Sage Math of a function:</p>
<pre><code>f(x) = x/(x^2-1)
g(x) = e^(-x^2) ?
</code></pre>
https://ask.sagemath.org/question/24634/domain-and-range-in-sage-math/?answer=24636#post-id-24636Thank you. [Domain](http://www.wolframalpha.com/input/?i=domain+of+f%28x%29+%3D+x%2F%28x^2-1%29&lk=3)/
[Range](http://www.wolframalpha.com/input/?i=range+of+e^%28-x^2%29&lk=3)
I try to do the same operations in Sage.Sun, 26 Oct 2014 17:59:31 +0100https://ask.sagemath.org/question/24634/domain-and-range-in-sage-math/?answer=24636#post-id-24636Answer by vdelecroix for <p>How do i find the domain and range in Sage Math of a function:</p>
<pre><code>f(x) = x/(x^2-1)
g(x) = e^(-x^2) ?
</code></pre>
https://ask.sagemath.org/question/24634/domain-and-range-in-sage-math/?answer=24635#post-id-24635Hello,
Be careful that your question is not well defined. In the definition of a function there is already a domain and a codomain (and the range is a subset of the codomain). In particular it makes no sense to compute the domain.
I guess that what you meant is : on which set of numbers the expression XXX is valid ? Remark that this is relatively subtle because an expression like
(x^2 - 1) / (x^2 - 1)
is not well defined at x=1 since 0 / 0 is not defined.
The question is still not well defined since you might want to consider this expression over the real numbers, the complex numbers, the Riemann sphere or something even more complicated. Depending on the question, you have first to see where the expression makes sense and then to compute the range. For this last computation Sage can currently not help.
VincentSun, 26 Oct 2014 17:47:52 +0100https://ask.sagemath.org/question/24634/domain-and-range-in-sage-math/?answer=24635#post-id-24635