Here's some (not all) answers!
1. I don't know of a way to get sage to accept "sin^2(x)" as input,
but a hack-way to get "sin^2(x)" as output is the following:
sage: maxima(sin(x)^2)
This calls the maxima engine, which has a different rendering
algorithm. maxima actually does bother to rewrite trig powers the way
you expect, so the output in the notebook is a very pretty "sin^2 (x)"
2. skipping
3. A simple example that does everything you want:
sage: implicit_plot(x^3+y^3-2*x*y,(x,-3,3,),
(y,-3,3),cmap=['purple']).show(axes=True,frame=False,aspect_ratio=1)
And you could define a helper function like so:
def my_implicit_plot(f,xrange,yrange,color):
return
implicit_plot(f,xrange,yrange,cmap=[color]).show(axes=True,frame=False,aspect_ratio=1)
Which would allow you to just say
sage: implicit_plot(x^3+y^3-2*x*y,(x,-3,3,),(y,-3,3),'purple')
4. A good question. Understanding Python would help in understanding
the answer but not required. Basically, if you're used to something
like Mathematica or maple then you expect to have data types
(functions, graphs, matrices, points, etc). and then a separate
library of functions (integrate, diff, taylor, plot, etc.). Connecting
the two are a list of rules (you can integrate a function but not a
matrix, you can plot a point but not an infinite series). Sage
instead, because of its Python background, uses an object-oriented
approach where the datatype (like a list) has built-in operations that
it "knows" how to do (like sort, add/remove elements, replace). From
the programmer's perspective, this can be a very nice way to organize
a huge program like Sage.
>From the end-user's perspective, though, I concede that the advantage
might not be obvious, if there even is one. At the end of the day if
you want to take the limit of f, you have to figure out "do I call
limit(f) or f.limit()" and the answer is: it depends on how the sage
programmer implemented it. It is frequently the latter though. And one
thing I really like about f.intergrate() or f.limit() is I can use tab-
completion to help narrow down the possibilities. Frequently when I
want to do something with a function ("f") or a plot ("P") or a data
element ("D") I just type the name and a dot and tab, and choose from
the list of possibilities. To get documentation, type a ?. I find it a
very user-friendly way to discover new functionality.
Good luck!-
Patrick
On Feb 14, 8:44 pm, Dana Ernst <[email protected]> wrote:
> Apparently, I'm not afraid to ask silly questions...
>
> First, if someone can tell how to find out the answers by myself to some of
> the kinds of questions I'm asking, please let me know.
>
> 1. Is there a way around Sage's dislike for things like sin^2(x)+cos^2(x)?
> This doesn't bother me at all, but my students were baffled when this issue
> arose. Related to this, is there an way to get the typeset output equivalent
> to sin^2(x)+cos^2(x) that a calculus student would expect?
>
> 2. Is there a way for Sage to simplify (respectively, expand) expressions
> like ln(x)+ln(y) (respectively, ln(x*y)? Sage does what you would expect
> with trig functions using trig_expand, but I figure out how to deal with logs.
>
> 3. I'm trying to do plot some implicit functions. For example:
>
> implicit_plot(x^3+y^3-2*x*y,(x,-3,3,),(y,-3,3))
>
> (a) Why is the aspect ratio off?
> (b) Is there a way to automatically display the axes?
> (c) Can I color implicit plots?
> (d) Is there a way to automatically display asymptotes (with dotted or dashed
> lines)? (My example has one.)
>
> 4. When to use f.somecommand() is still mysterious to me. It seems that
> some times, but not always, you can use somecommand(f). For example, take
>
> f=(x+1)^2
>
> Then both integral(f,x) and f.integral(x) work. However, f.is_zero() works,
> but is_zero(f) does not. Can someone help me understand this (without having
> to learn Python; I'll do that later)?
>
> Thanks for all the help.
>
> Dana
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org