Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#2,189 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
C#
スター
831
フォーク
79
平均マージ
1時間 16分
マージ済み PR(30日)
521

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ASC-Community/AngouriMath のほかの issue

ASC-Community/AngouriMath の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。