Ask Your Question

How do I make functional substitutions?

asked 2012-10-22 09:16:35 -0500

daniel.e2718 gravatar image

I want to substitute one function for another. Consider this:

v = function('x')
u(x) = (v(x)+v(-x))/2
delta = 10^(-90)

The very last line is what I'm trying to accomplish. I know it's the wrong command, but I'm wanting to make the substitution $v(x)\to\Gamma(x)$.

Is there a way along these lines to do such a functional substitution?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-10-22 09:40:05 -0500

Eviatar Bach gravatar image

updated 2012-10-22 09:45:56 -0500

I think you want v = function('v') for the first line; the first argument is the name of the function.

Here's the full code:

v = function('v')
u(x) = (v(x) + v(-x))/2
delta = 10^(-90)
u(delta).substitute_function(v, gamma)

I'm puzzled as to why it doesn't work if v is defined as v = function('v', x). Anyone know?

edit flag offensive delete link more



*Exactly* what I was looking for! Thanks! EDIT: Good question though. Why doesn't it work if you specify the variable of the function?

daniel.e2718 gravatar imagedaniel.e2718 ( 2012-10-22 10:26:34 -0500 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2012-10-22 09:16:35 -0500

Seen: 153 times

Last updated: Oct 22 '12