I don't think it's possible to substitute just theta without concern for x, but 
this should work

In [9]: f = Function('theta')(x)

In [10]: f
Out[10]: θ(x)

In [11]: expr = 6*f + x

In [12]: expr
Out[12]: x + 6⋅θ(x)

In [13]: g = Function('beta')(x)

In [14]: g
Out[14]: β(x)

In [15]: expr.subs(f, g)
Out[15]: x + 6⋅β(x)

Aaron Meurer

On Sep 7, 2010, at 6:31 AM, Rahul Siddharthan wrote:

> Question that I couldn't see answered in the docs, sorry if it's dumb.
> 
> Suppose I define
> f = Function("theta")(x)
> [output] => theta(x)
> 
> Then, later on, I want to substitute theta in f with an actual
> function (or alternatively, substitute theta(x) with a number).  Is
> this possible?  I couldn't see how to do this with f.subs().
> 
> Thanks,
> 
> Rahul

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to