Hi,

Let's say that I have just first derivative (but I would like second
derivatives too later):


>>> f(x).diff(x)
d
──(f(x))
dx

and I would like to use the substitution y = 2*x**2 to transform the
derivative. Mathematically, here is how it works:

df/dx = df/dy * dy/dx = df/dy * 4*x

I can do the following:


>>> eq = f(x).diff(x)
>>> eq.subs(x, sqrt(y/2))
⎛d       ⎞│    ___   ___
⎜──(f(x))⎟│  ╲╱ 2 ⋅╲╱ y
⎝dx      ⎠│x=───────────
                  2

it's a little ugly because I have to manually invert the substitution
and also the derivative is still expressed in terms of "x". I would
like to get:

f'(y) * 4*x

or

f'(y) * 4*sqrt(y/2)

I was wondering whether there is any support for changing a symbolic
ODE from one variable to another.
The confusing notion is that if you write f(x) and f(y), it's not
clear whether it's the same function, just relabeling the independent
variable,
or whether those are two different functions, one is f(x), and the
other is f(y) = f(2*x**2).

So I think that when I change the independent variable like this, I
should also change the name of the function. What would be the best
way to do that?

Ondrej

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@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