Comment #11 on issue 1525 by smi...@gmail.com: No integration by substitution
http://code.google.com/p/sympy/issues/detail?id=1525

A problem with the use of u, however, is getting rid of it later:


    h[1] >>> f=Function('f');f(2*x).diff(x)
    2*D(f(_u), _u)
    h[2] >>> _.subs(f,cos)
    2*D(cos(_u), _u)
    h[3] >>> _.doit()
    -2*sin(_u)

But what we want is
    h[4] >>> cos(2*x).diff(x)
    -2*sin(2*x)

So we need a way to replace the u with 2*x. There is no unevaluated subs, so perhaps Limit could do the trick?

    h[7] >>> 2*Limit(f(u).diff(u),u,2*x)
    2*Limit(D(f(u), u), u, 2*x)
    h[8] >>> _.subs(f,cos)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "sympy\core\basic.py", line 958, in subs
        return self._subs_old_new(old, new)
      File "sympy\core\cache.py", line 101, in wrapper
        func_cache_it_cache[k] = r = func(*args, **kw_args)
      File "sympy\core\basic.py", line 967, in _subs_old_new
        return self._eval_subs(old, new)
      File "sympy\core\mul.py", line 906, in _eval_subs
        return fallback()
      File "sympy\core\mul.py", line 859, in fallback
        self.args])
      File "sympy\core\basic.py", line 973, in _eval_subs
        return self.func(*[arg._eval_subs(old, new) for arg in self.args])
    AttributeError: 'str' object has no attribute '_eval_subs'
    h[8] >>> Limit(f(u).diff(u),u,2*x).args
    (D(f(u), u), u, 2*x, '+')

OOPS. Limit has non-Basic args. That should be changed to use -1 and +1 rather than '-' and '+'. The idea is that the Limit when done with doit should return the intended value.

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

Reply via email to