On Sep 27, 2:54 pm, "[email protected]"
<[email protected]> wrote:
> Hi,
>
> I'm teaching differential calculus and I'm trying to use sage plotting
> as much as I can.
>
> For example, I want to show the graph of the derivative of |x|.
> What would be the best code to do this?
>
> For example, if I use:
> f(x) = abs(x+1)
> g = f.differentiate()
> show(plot(g(x),(-2,2)), xmin = -2,xmax = 1, ymin=-2,ymax=2)
>
> then the y-axis from -1 to 1 at x = -1 there is a big blue line, where
> there shouldn't be anything.
>
> So should I do something like:
>
> f(x) = abs(x+1)
> g = f.differentiate()
> p = plot(g(x),(-2,-1))
> q = plot(g(x),(-1,2))
> show(p+q, xmin = -2,xmax = 1, ymin=-2,ymax=2)
>
> Since I know the domain of definition of g?
There is an option you can find by reading
sage: plot?
<snip>
* ``detect_poles`` - (Default: False) If set to True poles are
detected. If set to "show" vertical asymptotes are drawn.
which would work for things like 1/x. However, I don't think we have
any shortcut for what you are specifically talking about.
- kcrisman
--
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