Hi Sartaj,

I think you didn't understood my point. I am looking for mathematical 
substitution, not exact
substitution.

exp(5*x).xreplace({exp(5*x): sin(5*x)}) is just a mere example of usage of 
xreplace. I am not
looking for exact replacement. the exponent can be anything

For example:

>>> sin(exp(x)).some_replace_func({exp: x})

>>> sin(x)

>>> exp(5*x).some_replace_func({exp(x): sin(x)})
>>> exp(5*x)


Thanks,
Best,

Adrian

On Friday, August 14, 2015 at 1:48:44 AM UTC+5:30, Sartaj Singh wrote:
>
> Try this,
>
> >>> exp(5*x).xreplace({exp(5*x): sin(5*x)})
> sin(5*x)
>
> On 14 August 2015 at 00:24, Adrián Ashley <[email protected] <javascript:>> 
> wrote:
>
>> Hello,
>>
>> How can I substitute/replace something mathematically from an expression:
>>
>> For example:
>>
>> >>> exp(5*x).xreplace({exp(x): sin(x)})
>> >>> exp(5*x)   # I would expect sin(x)**5 here
>>
>>
>> In better way to do the above thing?
>>
>> Thanks,
>> Best,
>>
>> --
>> Adrian
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] <javascript:>
>> .
>> Visit this group at http://groups.google.com/group/sympy.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sympy/4be0109e-a665-4c89-8774-0300163250f0%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sympy/4be0109e-a665-4c89-8774-0300163250f0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Regards
> *Sartaj Singh*
>
> *Mathematics and Computing*,
> Indian Institute of Technology,
> Varanasi - 221 005 INDIA
>
> E-mail: [email protected] <javascript:>, *[email protected] 
> <javascript:>*
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/d2ac3304-e18c-4578-84ed-e4ada95e5c02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to