id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
15025,automatically injected function does not work with desolve,dkrenn,,"The following does not work:
{{{
sage: x = var('x')
sage: f = function('y', x)
sage: desolve(diff(y,x)-y == 0,y)
Traceback (click to the left of this block for traceback)
...
TypeError
}}}
altough {{{y}}} is automatically injected to the gobal namespace.
This is because {{{y}}} is of the wrong type:
{{{
sage: f, type(f)
(y(x), sage.symbolic.expression.Expression)
sage: y, type(y)
(y, sage.symbolic.function_factory.NewSymbolicFunction)
}}}
It works with {{{f}}}:
{{{
sage: desolve(diff(f,x)-f == 0,f)
c*e^x
}}}
This is confusing, especially, since in the docstring of {{{function}}} under ""Note"" you can find
> The new function is both returned and automatically injected into the global namespace.
Therefore, it is not absurd to assume that this automatically injected variable is the one I want to use, i.e. the one you would get by {{{y = function('y', x)}}} (similar to the {{{var}}}-command).
(If this is behavior of {{{function}}} is (really) on purpose, then at least the error message of {{{desolve}}} should be more clearifying and give a hint.)
",defect,needs_review,major,sage-duplicate/invalid/wontfix,symbolics,,desolve function,,,,,N/A,,,,,