That is precisely what I was looking for.

On Tuesday, April 19, 2022 at 3:24:00 PM UTC+1 gu...@uwosh.edu wrote:

> Alternative path that works better with complicated derivatives. Also 
> shows the nicer output inside Jupyter notebooks.
> [image: Screen Shot 2022-04-19 at 9.23.21 AM.png]
>
> On Tuesday, April 19, 2022 at 8:16:25 AM UTC-5 gu...@uwosh.edu wrote:
>
>> Is this the behavior you are trying to get?
>>
>>
>> >>> from algebra_with_sympy import *
>> >>> algwsym_config.output.human_text=True
>> >>> var('psi k x')
>> (psi, k, x)
>> >>> eq1=Eqn(psi, exp(I*k*x))
>> >>> eq1
>> psi = exp(I*k*x)
>> >>> eq2 =diff(eq1,x)
>> >>> eq2
>> Derivative(psi, x) = I*k*exp(I*k*x)
>> >>> eq2.subs({exp(I*k*x):psi})
>> Derivative(psi, x) = I*k*psi
>>
>> Jonathan
>> On Tuesday, April 19, 2022 at 7:50:54 AM UTC-5 andre...@gmail.com wrote:
>>
>>> When I differentiate the function
>>>
>>> ψ = exp(I*(k*x))
>>>
>>> I get
>>>
>>> i*k*exp(I*(k*x)).    [which is  i*k*ψ] 
>>>
>>> Is there a way to get exp(I*(k*x)) substituted with  ψ, in order to get 
>>> the shorter expression i*k*ψ ?
>>>
>>> Thanks,
>>> André
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/1deb7d10-ff35-44dc-99f9-3cb5a6534fbcn%40googlegroups.com.

Reply via email to