TransWikia.com

Derivative not evaluating when function defined

Mathematica Asked by Decebalus on August 30, 2020

I have the following code

ExD = Sum[D[y[n, t], t], {n, 0, 1}];
ExS = Sum[y[n, t], {n, 0, 1}];
σ[0] = 1;
σ'[0] = 1;
y[0, t_] = σ[0] + t σ'[0]
ExD
ExS

Note that when executed, ExD is still general for D[y[0,t],t], while ExS prints y[0,t] as it was defined. I cannot seem to figure out why the first derivative with respect to the second variable of y[0,t] does not evaluate even though y[0,t] is clearly defined and prints properly. Do I need to use Evaluate[] here?

One Answer

I just realized if I use := here instead of = for ExD it will evaluate the derivative every time D[y[0,t],t] is called. This solves my problem.

Answered by Decebalus on August 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP