If I copy and paste your code, I also get an error. The reason is that the 
first symbol you use for subtraction is not a hyphen, but some other symbol 
which looks very much like a hyphen, but which Sage does not recognize. 
(The second subtraction symbol seems to be okay.) Try using hyphens instead.

  John


On Wednesday, April 1, 2015 at 11:19:12 AM UTC-7, CR wrote:
>
> I've been using sagemath throughout the semester with few problems, but I 
> just can't seem to figure out what's wrong with my syntax here. 
>
>     x = var('x')
>     
>     p(x) = x^3 – 3*x^2 + x - 1
>     Dp(x) = derivative(p(x), x)
>     
>     plot(p(x), -1, 1)
>
> I'm getting this error: 
>
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>       File "_sage_input_2.py", line 10, in <module>
>         exec compile(u'open("___code___.py","w").write("# -*- coding: 
> utf-8 -*-\\n" + 
> _support_.preparse_worksheet_cell(base64.b64decode("eCA9IHZhcigneCcpCgpwKHgpID0geF4zIOKAkyAzKnheMiArICh4IC0gMSkKRHAoeCkgPSBkZXJpdmF0aXZlKHAoeCksIHgpCgpwbG90KHAoeCksIC0xLCAxKQ=="),globals())+"\\n");
>  
> execfile(os.path.abspath("___code___.py"))
>       File "", line 1, in <module>
>         
>       File "/tmp/tmpd2XXUV/___code___.py", line 5
>         __tmp__=var("x"); p = symbolic_expression(x**_sage_const_3  – 
> _sage_const_3 *x**_sage_const_2  + (x - _sage_const_1 )).function(x)
>                                                                     ^
>     SyntaxError: invalid syntax
>
> So appears that the function is in error...
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to