First time here? Check out the FAQ!

Ask Your Question
1

TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'sage.symbolic.expression.Expression'

asked 6 years ago

yasar11732 gravatar image

When I enter following command in Sage Notebook;

var('x k w')
f = x^3 * e^(k*x) * sin(w*x)
show(f)
show(f.diff(x))

I get this error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-e1add3252393> in <module>()
      1 var('x k w')
----> 2 f = x**Integer(3) * e**(k*x) * sin(w*x)
      3 show(f)
      4 show(f.diff(x))

TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'sage.symbolic.expression.Expression'

How can I resolve this issue.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 6 years ago

slelievre gravatar image

updated 6 years ago

Did you define e = [0, 1, 2] earlier in the same session?

Try using exp(...) instead of e^(...).

f = x^3 * exp(k*x) * sin(w*x)
Preview: (hide)
link

Comments

It appears that I had :)

yasar11732 gravatar imageyasar11732 ( 6 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 6 years ago

Seen: 2,877 times

Last updated: Jul 29 '18