Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Substituting for a derivative's variable is dropped: derivative(x^3, x) at x = 1 evaluates to 3 x^2

Đã đóng
#2,189 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading the existing tests and implementation for Substitute on derivative and indefinite integral nodes, then compare them with the FreeVariables behavior and the test pinned by #1045. Add coverage for the derivative and integral examples in the issue, including evaluation after substitution. Done means substitution yields the expected values, with behavior for unevaluated derivatives such as derivative(f(x), x) at a point decided and covered.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Substitute leaves the variable of a derivative alone, and so does the variable of an indefinite integral. The answer evaluated afterwards is wrong:

master 5e7731fe2 and 2.6.0 should be
"derivative(x^3, x)".ToEntity().Substitute("x", 1).Evaled 3 * x ^ 2 3
"derivative(x^3, x, 2)".ToEntity().Substitute("x", 2).Evaled 2 * x * 3 12
"integral(x^2, x)".ToEntity().Substitute("x", 1).Evaled x ^ 3 / 3 + C 1/3 + C

Substituting and evaluating do not commute: derivative(x^3, x).Evaled is 3 * x ^ 2, in which x is free.

FreeVariables already reports that x as free. #1045 left both nodes out of its binders because "d/dt denotes a function of t", and pinned that with a test. Substitute still treats the variable as bound. That reading dates from 2020 (x = 0 -> derive(temp_1 ^ 2 + a, temp_1) -> derive(temp_1 ^ 2 + a, temp_1)), and #1811 kept it.

What is open is how to write a derivative that cannot be computed, evaluated at a point: derivative(f(x), x) with x := 1. SymPy writes Subs(Derivative(f(x), x), x, 1). Two candidates here:

  • apply(lambda(x, derivative(f(x), x)), 1);
  • a node for evaluation at a point.
Ngôn ngữ chính
C#
Star
831
Fork
79
Merge trung bình
1 giờ 16 phút
Pull request đã merge (30 ngày)
521

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ASC-Community/AngouriMath

Tất cả issue của ASC-Community/AngouriMath

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.