Opened 10 years ago

Closed 10 years ago

#644 closed defect (fixed)

[with patch] (sin + cos)(1) does not work

Reported by: robertwb Owned by: mhansen
Priority: major Milestone: sage-2.8.15
Component: calculus Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by was)

Both sin and cos are functions of one (undetermined) variable, and can be called, but when one performs arithmetic on them this changes.

Maybe there should be a CallableSymbolicExpressionRing? with an unnamed variable that coerces into any CallableSymbolicExpressionRing? with a specified variable name?

sage: f = sin
sage: g = cos
sage: f(1)
sin(1)
sage: g(1)
cos(1)
sage: h = f+g
sage: h(1)
sin + cos # should be sin(1)+cos(1)
sage: f = 3*sin
sage: f(1)
3*sin # should be 3*sin(1)

Attachments (1)

644.patch (4.7 KB) - added by mhansen 10 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by robertwb

Better formatting:

sage: f = sin
sage: g = cos
sage: f(1)
sin(1)
sage: g(1)
cos(1)
sage: h = f+g
sage: h(1)
sin + cos         # should be sin(1)+cos(1), or at least throw an error
sage: f = 3*sin
sage: f(1)
3*sin             # should be 3*sin(1)

comment:2 Changed 10 years ago by was

  • Description modified (diff)
  • Milestone set to sage-2.9

comment:3 Changed 10 years ago by robertwb

Also should have

sage: f(x) = x^2
sage: f + sin
x |--> sin(x) + x^2

comment:5 Changed 10 years ago by mhansen

  • Milestone changed from sage-2.9.1 to sage-2.8.15
  • Owner changed from was to mhansen
  • Status changed from new to assigned
  • Summary changed from (sin + cos)(1) does not work to [with patch] (sin + cos)(1) does not work

This patch should be applied after #644.

Changed 10 years ago by mhansen

comment:6 Changed 10 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from assigned to closed

Merged in 2.8.15.alpha1.

Note: See TracTickets for help on using tickets.