Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

How do I make functional substitutions?

asked 12 years ago

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)
u(delta).subs(v=gamma(x))

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)Γ(x).

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

Eviatar Bach gravatar image

updated 12 years ago

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?

Preview: (hide)
link

Comments

1

*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 ( 12 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: 12 years ago

Seen: 429 times

Last updated: Oct 22 '12