Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Substitute formal function by an expression in a differential equation

This is a follow up to substitute expression instead of formal function symbol. I tried to no avail to apply the workaround proposed there for the following application where I build a differential equation involving a formal function P:

  sage: x,y = var('x,y')
  sage: P = function('P',x,y)
  sage: z = var('z')
  sage: C = function('C',z)
  sage: equation = P(x=z,y=C) == 0
  sage: dequation = diff(equation, z)

and then I would want to substitute P by a specific expression:

  sage: Q(x,y) = y^2 - y + x
  sage: dequation.substitute_function(P,Q)

But whatever I tried, I got:

   D[0](C)(z)*D[1](P)(z, C(z)) + D[0](P)(z, C(z)) == 0

Is there a natural syntax to achieve this? If not, should this be a ticket?

Thanks!