Just use symbols(). var() is only for interactive use. Aaron Meurer
On Nov 8, 2013, at 8:56 PM, Erin Hodgess <[email protected]> wrote: Thank you. My ideal would be something like: x = var('x') t = symbols('t') y = exp(-x)*exp(t*x) y exp((t-1)*x) I'm thinking about moment generating functions. Thanks! Erin On Friday, November 8, 2013 9:50:06 PM UTC-6, Aaron Meurer wrote: > > Take a read of http://docs.sympy.org/latest/tutorial/gotchas.html#symbols > (and I recommend the rest of that tutorial as well). You need to > define t first. Probably you just want to add > > t = symbols('t') > > somewhere to your script. > > Aaron Meurer > > > > On Fri, Nov 8, 2013 at 6:48 PM, Erin Hodgess > <[email protected]<javascript:>> > wrote: > > Hello! > > > > I would like to use a letter as a constant in > integration/differentiation > > problems but I am having some trouble. > > > > For instance, I would like to have > > exp(t*x) > > > > But when I do that, I get "t is not defined". > > > > This is in Python 2.7.5 > > > > Thanks for any help! > > > > Sincerely, > > Erin > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "sympy" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to [email protected] <javascript:>. > > To post to this group, send email to [email protected]<javascript:>. > > > Visit this group at http://groups.google.com/group/sympy. > > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
